Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

verify_ecdsa_signature_coords

Verify a Bitcoin ECDSA signature using Cairo’s built-in verification (legacy coords format)

This function uses Cairo’s optimized ECDSA verification through public key recovery. It validates the signature by recovering the public key from the signature and message, then comparing it with the expected public key.

Arguments

  • message_hash - The hash of the message that was signed (typically a transaction hash)
  • signature - The ECDSA signature (r, s components and y_parity for recovery)
  • public_key - The public key coordinates to verify against

Returns

  • bool - True if signature is valid, false otherwise

Fully qualified path: alexandria_btc::legacy_signature::verify_ecdsa_signature_coords

pub fn verify_ecdsa_signature_coords(
    message_hash: u256, signature: Signature, public_key: BitcoinPublicKeyCoords,
) -> bool