View Source Secp256k1.Schnorr (secp256k1 v0.3.3)

Module implementing Schnorr signatures as defined in BIP340

Link to this section Summary

Functions

Generate Schnorr signature of a hash (AUX is randomly generated)

Generate Schnorr signature of a hash and specify AUX - NOT RECOMMENDED

Generate Schnorr signature of message (can be hash or custom length message)

Generate Schnorr signature of arbitrary message (AUX is randomly generated)

Generate Schnorr signature of a arbitrary message and specify AUX - NOT RECOMMENDED

Validate Schnorr signature

Link to this section Functions

Link to this function

sign32(msg_hash, seckey)

View Source
@spec sign32(msg_hash :: Secp256k1.hash(), seckey :: Secp256k1.seckey()) ::
  Secp256k1.schnorr_sig()

Generate Schnorr signature of a hash (AUX is randomly generated)

Link to this function

sign32(msg_hash, seckey, aux)

View Source
@spec sign32(
  msg_hash :: Secp256k1.hash(),
  seckey :: Secp256k1.seckey(),
  aux :: <<_::32, _::_*8>>
) :: Secp256k1.schnorr_sig()

Generate Schnorr signature of a hash and specify AUX - NOT RECOMMENDED

@spec sign(message :: binary(), seckey :: Secp256k1.seckey()) ::
  Secp256k1.schnorr_sig()

Generate Schnorr signature of message (can be hash or custom length message)

Link to this function

sign_custom(message, seckey)

View Source
@spec sign_custom(message :: binary(), seckey :: Secp256k1.seckey()) ::
  Secp256k1.schnorr_sig()

Generate Schnorr signature of arbitrary message (AUX is randomly generated)

Link to this function

sign_custom(message, seckey, aux)

View Source
@spec sign_custom(
  message :: binary(),
  seckey :: Secp256k1.seckey(),
  aux :: <<_::32, _::_*8>>
) ::
  Secp256k1.schnorr_sig()

Generate Schnorr signature of a arbitrary message and specify AUX - NOT RECOMMENDED

Link to this function

valid?(signature, message, pubkey)

View Source
@spec valid?(
  signature :: Secp256k1.schnorr_sig(),
  message :: binary(),
  pubkey :: Secp256k1.xonly_pubkey()
) :: boolean()

Validate Schnorr signature