Skip to content

feat(wasm-utxo): add PSBT global xpub extraction and sorting#192

Merged
OttoAllmendinger merged 1 commit intomasterfrom
BTC-3000.add-get-wallet-keys
Mar 5, 2026
Merged

feat(wasm-utxo): add PSBT global xpub extraction and sorting#192
OttoAllmendinger merged 1 commit intomasterfrom
BTC-3000.add-get-wallet-keys

Conversation

@OttoAllmendinger
Copy link
Contributor

Add getGlobalXpubs() method to extract global xpubs from PSBTs,
and implement getWalletKeysFromPsbt() utility to sort unordered
xpubs into canonical [user, backup, bitgo] order by validating
against PSBT wallet inputs.

This supports legacy cold wallets where PSBTs were built with
derived keys but only root xpubs are available. The sorting
algorithm tries all 6 permutations and validates each against
wallet inputs to find the correct ordering. Works for all script
types including p2tr.

Issue: BTC-XXXX

Co-authored-by: llm-git llm-git@ttll.de

@OttoAllmendinger OttoAllmendinger force-pushed the BTC-3000.add-get-wallet-keys branch from 5dc7786 to 54379f6 Compare March 5, 2026 09:10
Add `getGlobalXpubs()` method to extract global xpubs from PSBTs,
and implement `getWalletKeysFromPsbt()` utility to sort unordered
xpubs into canonical [user, backup, bitgo] order by validating
against PSBT wallet inputs.

This supports legacy cold wallets where PSBTs were built with
derived keys but only root xpubs are available. The sorting
algorithm tries all 6 permutations and validates each against
wallet inputs to find the correct ordering. Works for all script
types including p2tr.

Issue: BTC-XXXX

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-3000.add-get-wallet-keys branch from 54379f6 to 75561a9 Compare March 5, 2026 09:26
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review March 5, 2026 11:06
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner March 5, 2026 11:06
@OttoAllmendinger OttoAllmendinger merged commit b46483a into master Mar 5, 2026
12 checks passed
@OttoAllmendinger OttoAllmendinger deleted the BTC-3000.add-get-wallet-keys branch March 5, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants