shesek / minsc

A mini scripting language for all things Bitcoin
https://min.sc
MIT License
193 stars 19 forks source link

Support BIP32 hardended derivation #53

Closed shesek closed 1 month ago

shesek commented 1 month ago

Refactored into a new SlashOp.

Supports both XPRIV/0' and XPRIV/0h. Or with the wildcard modifier: XPRIV/*' and XPRIV/*h.

When converted into a pubkey, all hardened derivation steps are resolved and moved to the key origin, leaving only tailing non-hardened derivation steps. For example, pubkey(XPRIV/1'/2'/3/4) would give back [ffd2a052/1'/2']XPUB/3/4 (ffd2a052 being XPRIV's fingerprint).