Skip to main content

reconstruct_xpub

Function reconstruct_xpub 

Source
pub fn reconstruct_xpub(
    compact: &XpubCompact,
    origin_path: &DerivationPath,
) -> Result<Xpub>
Expand description

Reconstruct a full BIP 32 Xpub from a compact form + the origin path (which provides depth and child_number per Q-7’s reconstruction rule).

Per design/SPEC_mk_v0_1.md §3.6:

depth        := component_count(origin_path)
child_number := last_component(origin_path) (with hardened-bit encoding)

origin_path MUST be non-empty (caller responsibility; the spec guarantees this since standard-table indicators have ≥3 components and explicit-path encoding requires count ≥ 1).