I’m building an open-source, offline inheritance tool (btcguardianshq). An heir rebuilds a BIP39 seed from encrypted Shamir shares on Tails, then signs a P2WPKH PSBT (BIP84, m/84'/1'/0'/0/0, signet only for now).
My read-only step already decodes the PSBT, totals inputs, outputs and fee, and refuses PSBTs whose bip32Derivation paths use coin type 0′.
For the signing step I plan to:
- Build the HD root with
bip32.fromSeed(seed, network). - Sign with
psbt.signAllInputsHD(root), so only inputs whosebip32Derivationmaster fingerprint matches get signed. - Validate the signatures, then write a new PSBT file and finalise it in Bitcoin Core (
finalizepsbt).
Questions:
- Is
signAllInputsHDthe right approach, or should I derive the key per input and check that the pubkey inbip32Derivationmatches before callingsignInput? - Should I refuse inputs that only have
nonWitnessUtxo, or that have both UTXO fields but they disagree? - Are there other checks worth doing before signing, such as SIGHASH type, change output belonging to the same wallet, or a sanity limit on the fee?
Code is MIT licensed. All testing uses fake or signet data only.












