feat: use wasm-utxo for PSBT creation in backupKeyRecovery#7794
Merged
OttoAllmendinger merged 1 commit intomasterfrom Dec 23, 2025
Merged
feat: use wasm-utxo for PSBT creation in backupKeyRecovery#7794OttoAllmendinger merged 1 commit intomasterfrom
OttoAllmendinger merged 1 commit intomasterfrom
Conversation
Replace utxolib with wasm-utxo as the default backend for creating PSBTs in backup key recovery. This provides better performance and modern transaction defaults. Changes: - Add createBackupKeyRecoveryPsbtWasm() using wasm-utxo's BitGoPsbt - Add ZcashBitGoPsbt support with block height for consensus branch ID - Keep utxolib implementation available via backend parameter - Export PsbtBackend type for callers to specify backend preference Key differences from utxolib: - Transaction version 2 (BIP68 support) instead of version 1 - RBF-enabled sequence numbers (0xFFFFFFFE) by default Ticket: BTC-2891 TICKET: BTC-2891
OttoAllmendinger
approved these changes
Dec 23, 2025
Comment on lines
+182
to
+195
| // Convert wasm-utxo PSBT to utxolib PSBT for dimension calculation and output addition | ||
| const psbt = utxolib.bitgo.createPsbtFromBuffer(Buffer.from(wasmPsbt.serialize()), network); | ||
|
|
||
| let dimensions = Dimensions.fromPsbt(psbt).plus( | ||
| Dimensions.fromOutput({ script: utxolib.address.toOutputScript(recoveryDestination, network) }) | ||
| ); | ||
|
|
||
| if (keyRecoveryServiceFeeAddress) { | ||
| dimensions = dimensions.plus( | ||
| Dimensions.fromOutput({ | ||
| script: utxolib.address.toOutputScript(keyRecoveryServiceFeeAddress, network), | ||
| }) | ||
| ); | ||
| } |
Contributor
There was a problem hiding this comment.
TODO: add some sort of Dimensions support for wasm-utxo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace utxolib with wasm-utxo as the default backend for creating PSBTs in backup key recovery. This provides better performance and modern transaction defaults.
Changes:
Key differences from utxolib:
Ticket: BTC-2891
TICKET: BTC-2891