Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

verify_ecdsa_signature_auto_recovery

Verify a Bitcoin ECDSA signature with automatic y_parity detection

This function tries both y_parity values (false and true) to find a match with the provided public key. This is useful when the y_parity is unknown or when working with DER signatures that don’t include recovery information.

Arguments

  • message_hash - The hash of the message that was signed
  • r - The r component of the signature
  • s - The s component of the signature
  • public_key - The public key to verify against

Returns

  • bool - True if signature is valid with either y_parity value

Fully qualified path: alexandria_btc::legacy_signature::verify_ecdsa_signature_auto_recovery

pub fn verify_ecdsa_signature_auto_recovery(
    message_hash: u256, r: u256, s: u256, public_key: BitcoinPublicKey,
) -> bool