Skip to content

Conversation

@OttoAllmendinger
Copy link
Contributor

@OttoAllmendinger OttoAllmendinger commented Nov 17, 2025

This PR refactors and enhances transaction format selection in abstract-utxo
with a focus on PSBT (Partially Signed Bitcoin Transaction) defaults.

Changes

  • Extract format selection logic into a dedicated getDefaultTxFormat function
  • Default to psbt-lite format for all testnet coins (including ZCash testnet)
  • Update transaction format selection logic for special wallet types
  • Add comprehensive unit tests covering all wallet configurations
  • Simplify conditional logic throughout the codebase
  • Improve maintainability by replacing hardcoded lists with dynamic function calls

Default PSBT conditions:

  • All testnet coins now default to psbt-lite format
  • Bitcoin mainnet uses PSBT for specific wallet types (distributedCustody)
  • Improved test coverage across various wallet configurations

Issue: BTC-2732, BTC-1322

OttoAllmendinger and others added 7 commits November 17, 2025 15:26
Add unit tests for transaction format selection logic in abstract-utxo,
testing various wallet configurations and their default formats.
Verify PSBT defaults for testnet coins, Bitcoin mainnet, and special
wallet types like distributedCustody.

Issue: BTC-2732

Co-authored-by: llm-git <llm-git@ttll.de>
…tion

Extract format selection logic to a new method getDefaultTxFormat to make
the code more modular and easier to test. This simplifies
getExtraPrebuildParams and improves test coverage by allowing direct
testing of format selection.

Issue: BTC-2732

Co-authored-by: llm-git <llm-git@ttll.de>
Prevents ZCash transactions from defaulting to PSBT format due to
compatibility issues. Refactored the condition logic to handle the ZCash
exception early in the decision flow instead of in multiple places.

Issue: BTC-2732, BTC-1322

Co-authored-by: llm-git <llm-git@ttll.de>
Force PSBT format for all testnet coins regardless of wallet type.
Previously, only hot wallets defaulted to PSBT in testnet. Now all
testnet wallets will use PSBT by default.

Issue: BTC-2732

Co-authored-by: llm-git <llm-git@ttll.de>
Remove special case for ZCash - all testnets now default to PSBT format.
Simplify conditional logic by removing unnecessary ZCash exclusions
from unit tests and defaulting logic.

Issue: BTC-2732

Co-authored-by: llm-git <llm-git@ttll.de>
…d chain list

Replace hardcoded list of non-PSBT coin types with a direct call to
getDefaultTxFormat method, making tests more maintainable and accurate.

Issue: BTC-2732

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review November 17, 2025 15:11
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner November 17, 2025 15:11
Change the default transaction format on testnets from 'psbt' to
'psbt-lite', which uses a more efficient serialization that omits full
prevTx data. Add documentation for transaction format options.

Issue: BTC-2732

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger merged commit bcfd011 into master Nov 17, 2025
15 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