Merged
Conversation
8f512a1 to
84093f8
Compare
Add opt-in PSBT support for legacy v1 wallet transactions. When `usePsbt: true` is passed to `createTransaction`, the function now returns a PSBT hex in the `transactionHex` field instead of a legacy unsigned transaction hex. Key changes: - Add `buildPsbt` function in transactionBuilder.ts that constructs a PSBT with embedded signing metadata (BIP32 derivation paths, redeem/witness scripts, global xpubs) - Add `createRootWalletKeysFromV1Keychains` helper to convert v1 keychain format to utxo-lib's RootWalletKeys - Update `signTransaction` in wallet.ts to auto-detect PSBT format using `utxolib.bitgo.isPsbt()` and route to appropriate signing - Add comprehensive tests verifying PSBT output matches legacy tx structure The PSBT format embeds all signing metadata directly in the transaction, eliminating the need for a separate `unspents` array. This prepares v1 wallets for gradual migration to PSBT-based signing. Default behavior remains legacy format for backward compatibility. Use `usePsbt: true` to opt-in to PSBT format. TICKET: BTC-2894 TICKET: BTC-2894
Add PSBT transaction building capability for legacy v1 wallets with gradual rollout: - 10% of mainnet transactions use PSBT format - 100% of testnet transactions use PSBT format - Explicit usePsbt: true/false always takes precedence TICKET: BTC-2894
84093f8 to
27d650f
Compare
27d650f to
1c1bde1
Compare
OttoAllmendinger
approved these changes
Jan 1, 2026
lcovar
added a commit
that referenced
this pull request
Jan 5, 2026
Revert "Merge pull request #7792 from BitGo/BTC-2894-v1.psbt"
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.
commit: ea36e1b
Add opt-in PSBT support for legacy v1 wallet transactions. When
usePsbt: trueis passed tocreateTransaction, the function nowreturns a PSBT hex in the
transactionHexfield instead of a legacyunsigned transaction hex.
Key changes:
buildPsbtfunction in transactionBuilder.ts that constructsa PSBT with embedded signing metadata (BIP32 derivation paths,
redeem/witness scripts, global xpubs)
createRootWalletKeysFromV1Keychainshelper to convert v1keychain format to utxo-lib's RootWalletKeys
signTransactionin wallet.ts to auto-detect PSBT formatusing
utxolib.bitgo.isPsbt()and route to appropriate signingstructure
The PSBT format embeds all signing metadata directly in the
transaction, eliminating the need for a separate
unspentsarray.This prepares v1 wallets for gradual migration to PSBT-based signing.
Default behavior remains legacy format for backward compatibility.
Use
usePsbt: trueto opt-in to PSBT format.commit: 8d81f4c
Add PSBT transaction building capability for legacy v1 wallets with
gradual rollout:
commit: 8f512a1
Add fallback mechanism for PSBT transactions in the SDK. When PSBT
is requested but fails, automatically retry with legacy transaction
format and record the error details for reporting.