Skip to main content

validate_xpub_bytes

Function validate_xpub_bytes 

Source
pub fn validate_xpub_bytes(d: &Descriptor) -> Result<(), Error>
Expand description

Validate that every Pubkeys TLV entry’s 33-byte compressed pubkey field (bytes 32..65 of the 65-byte payload) parses as a valid secp256k1 point. The 32-byte chain code prefix is unvalidated (any 32 bytes are a structurally valid BIP 32 chain code).

Per spec v0.13 §6.4: failure → Error::InvalidXpubBytes { idx }. When d.tlv.pubkeys is None (template-only mode), this is a no-op.