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_no_empty_origin_overrides
Validate that no OriginPathOverrides[idx] entry is present-but-empty (zero path components). Per spec v0.13 §6.3 (I-1 hardening, P0 pathless/dead-card partial-decode).
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_use_site_overrides_canonical
D5(a) decode canonical-form check for use_site_path_overrides.
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).