Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

verify_der_signature

Verify a DER-encoded Bitcoin signature

This function parses a DER-encoded signature and verifies it against the provided message hash and public key. Since DER signatures don’t include recovery information, it automatically tries both y_parity values.

Arguments

  • message_hash - The hash of the message that was signed
  • der_signature - DER-encoded signature bytes
  • public_key - The public key to verify against

Returns

  • bool - True if the DER signature is valid

Fully qualified path: alexandria_btc::legacy_signature::verify_der_signature

pub fn verify_der_signature(
    message_hash: u256, der_signature: Span<u8>, public_key: BitcoinPublicKey,
) -> bool