Skip to content

Conversation

@lcovar
Copy link
Contributor

@lcovar lcovar commented Dec 22, 2025

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

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
@lcovar lcovar requested a review from a team as a code owner December 22, 2025 23:55
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),
})
);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: add some sort of Dimensions support for wasm-utxo

@OttoAllmendinger OttoAllmendinger merged commit d6a558a into master Dec 23, 2025
26 of 27 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