Skip to content

Conversation

@OttoAllmendinger
Copy link
Contributor

This PR refactors the PSBT handling in the abstract-utxo package and adds
wasm-utxo support for recovery functions. Key changes include:

  • Refactored signAndVerifyPsbt to separate signing and finalization steps
  • Renamed signing functions to explicitly indicate utxolib dependencies
    (e.g., signPsbtsignPsbtUtxolib)
  • Added a unified signAndVerifyPsbt function that selects between utxolib
    or wasm-utxo implementations based on PSBT type
  • Changed PSBT creation functions to use coin name instead of network for
    more robust handling across implementations
  • Implemented PSBT signing with wasm-utxo for both backupKeyRecovery and
    crossChainRecovery functions

These changes improve modularity, type safety, and provide consistent
interfaces for both utxolib and wasm-utxo backends.

Issue: BTC-2909

OttoAllmendinger and others added 5 commits January 8, 2026 11:59
Refactor signAndVerifyPsbt to separate signing and finalization steps. Remove
isLastSignature parameter from the function to make it more modular and
focused on just signing. Finalization is now handled separately where needed.

Issue: BTC-2909

Co-authored-by: llm-git <llm-git@ttll.de>
Rename signPsbt.ts to signPsbtUtxolib.ts and update all references to
it. This improves clarity by making the utxolib dependency explicit in
the filename. Also rename signPsbtWithMusig2Participant to
signPsbtWithMusig2ParticipantUtxolib for consistency.

Issue: BTC-2909

Co-authored-by: llm-git <llm-git@ttll.de>
Add new function that selects between utxolib or wasm-utxo implementations
based on the PSBT type. This simplifies client code by providing a single
entry point for both signing implementations.

Issue: BTC-2909

Co-authored-by: llm-git <llm-git@ttll.de>
Change PSBT creation functions to use coin name instead of network. This
makes the code more robust against network naming differences between
utxolib and wasm-utxo.

The coin name is used to determine the network through helper functions,
ensuring consistency across recovery implementations.

Issue: BTC-2909

Co-authored-by: llm-git <llm-git@ttll.de>
Implement PSBT signing with wasm-utxo for both backupKeyRecovery and
crossChainRecovery. Add proper handling of both utxolib.UtxoPsbt and
fixedScriptWallet.BitGoPsbt objects for flexible backend usage.

This improves recovery functionality by maintaining separate code paths
for both utxolib and wasm-utxo backends with appropriate type safety.

Issue: BTC-2909

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review January 8, 2026 14:03
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner January 8, 2026 14:03
@OttoAllmendinger OttoAllmendinger merged commit 4e53e5a into master Jan 8, 2026
20 checks passed
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.

3 participants