Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

verify_signature

Verifies a signature according to the BIP-340 using Signature struct.

This function checks if the signature is valid for a message m with respect to the public key px.

Arguments

  • px: u256 - The x-coordinate of the public key.
  • sig: Signature - The signature containing r, s, and y_parity.
  • m: ByteArray - The message for which the signature is being verified.

Returns

  • bool - true if the signature is verified for the message and public key, false otherwise.

Fully qualified path: alexandria_btc::bip340::verify_signature

pub fn verify_signature(px: u256, sig: Signature, m: ByteArray) -> bool