File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,18 @@ import { isDescriptorWalletData } from './descriptor/descriptorWallet';
8484
8585import ScriptType2Of3 = utxolib . bitgo . outputScripts . ScriptType2Of3 ;
8686
87- export type TxFormat = 'legacy' | 'psbt' ;
87+ export type TxFormat =
88+ // This is a legacy transaction format based around the bitcoinjs-lib serialization of unsigned transactions
89+ // does not include prevOut data and is a bit painful to work with
90+ // going to be deprecated in favor of psbt
91+ // @deprecated
92+ | 'legacy'
93+ // This is the standard psbt format, including the full prevTx data for legacy transactions.
94+ // This will remain supported but is not the default, since the data sizes can become prohibitively large.
95+ | 'psbt'
96+ // This is a nonstandard psbt version where legacy inputs are serialized as if they were segwit inputs.
97+ // While this prevents us to fully verify the transaction fee, we have other checks in place to ensure the fee is within bounds.
98+ | 'psbt-lite' ;
8899
89100type UtxoCustomSigningFunction < TNumber extends number | bigint > = {
90101 ( params : {
@@ -972,7 +983,7 @@ export abstract class AbstractUtxoCoin extends BaseCoin {
972983 }
973984
974985 if ( isTestnet ( this . network ) ) {
975- return 'psbt' ;
986+ return 'psbt-lite ' ;
976987 }
977988
978989 const walletFlagMusigKp = wallet . flag ( 'musigKp' ) === 'true' ;
Original file line number Diff line number Diff line change @@ -103,11 +103,11 @@ function runTest(params: {
103103
104104describe ( 'txFormat' , function ( ) {
105105 describe ( 'getDefaultTxFormat' , function ( ) {
106- // All testnet wallets default to PSBT
106+ // All testnet wallets default to PSBT-lite
107107 runTest ( {
108- description : 'should always return psbt for testnet' ,
108+ description : 'should always return psbt-lite for testnet' ,
109109 coinFilter : ( coin ) => utxolib . isTestnet ( coin . network ) ,
110- expectedTxFormat : 'psbt' ,
110+ expectedTxFormat : 'psbt-lite ' ,
111111 } ) ;
112112
113113 // DistributedCustody wallets default to PSBT (mainnet only, testnet already covered)
@@ -161,5 +161,11 @@ describe('txFormat', function () {
161161 expectedTxFormat : 'psbt' ,
162162 requestedTxFormat : 'psbt' ,
163163 } ) ;
164+
165+ runTest ( {
166+ description : 'should respect explicitly requested psbt-lite format' ,
167+ expectedTxFormat : 'psbt-lite' ,
168+ requestedTxFormat : 'psbt-lite' ,
169+ } ) ;
164170 } ) ;
165171} ) ;
You can’t perform that action at this time.
0 commit comments