Skip to main content

Module validate

Module validate 

Source
Expand description

Decoder-side validation per spec §7.

Functions§

validate_explicit_origin_required
Validate that every @N in a non-canonical wrapper has an explicit origin path on the wire — either via OriginPathOverrides[idx] or via a non-empty entry in the path_decl (shared or divergent).
validate_multipath_consistency
Validate that all multipaths in shared default + overrides share the same alt-count.
validate_placeholder_usage
Validate the BIP 388 well-formedness of placeholder usage in the tree.
validate_tap_script_tree
Validate that all leaves in a tap-script-tree are permitted-leaf tags per §6.3.1.
validate_xpub_bytes
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).