Skip to main content

parse_compact_xpub

Function parse_compact_xpub 

Source
pub fn parse_compact_xpub(bytes: &[u8]) -> Result<CompactXpub, CryptoError>
Expand description

Parse a DIP-15 compact extended-public-key plaintext into a CompactXpub.

Inverse of CompactXpub::to_bytes / compact_xpub_bytes. Rejects any input whose length is not exactly COMPACT_XPUB_LEN (69) bytes — the reference clients hard-check this on receive, so a non-69-byte payload is not a valid DIP-15 compact xpub and must be handled separately (e.g. a legacy 78/107-byte BIP32/DIP-14 serialization) by the caller.

§Errors

CryptoError::InvalidCompactXpubLength if bytes.len() != 69.