Skip to content

Conversation

@OttoAllmendinger
Copy link
Contributor

This PR adds comprehensive PSBT (Partially Signed Bitcoin Transaction)
validation and transaction parsing capabilities to the wasm-utxo module.
It focuses on:

  1. Adding input validation to ensure PSBT inputs belong to the specified
    wallet by verifying key derivations and implementing replay protection

  2. Reorganizing code structure by moving BitGo PSBT functionality from
    root module to fixed_script_wallet where it logically belongs

  3. Implementing a new BitGoPsbt class for transaction parsing with:

    • Network-specific deserialization
    • Wallet script identification
    • Input validation with replay protection
    • Output classification (internal vs external)
    • Fee and spend amount calculations

The implementation provides detailed error reporting and includes
comprehensive tests across all supported networks.

Issue: BTC-2652

OttoAllmendinger and others added 2 commits November 7, 2025 17:53
Move BitGo PSBT functionality from root module to fixed_script_wallet
where it logically belongs. Update imports and paths across files to
maintain functionality. Also move psbt_wallet_input.rs into the
bitgo_psbt module.

Issue: BTC-2652

Co-authored-by: llm-git <llm-git@ttll.de>
Implements a new BitGoPsbt class that allows parsing PSBT transactions to
identify wallet inputs and outputs. This implementation provides:

- PSBT deserialization with network-specific handling
- Transaction parsing with wallet script identification
- Input validation with replay protection support
- Output classification (internal vs external)
- Fee and spend amount calculations

The implementation extracts derivation info from PSBT inputs/outputs to
match against wallet keys, providing a structured view of transactions
for wallet UIs and validation purposes.

Added comprehensive tests for the new functionality across all supported
networks. Includes TypeScript definitions and integration with existing
fixed script wallet functionality.

Issue: BTC-2652

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2652.bitgo-psbt-parse branch from c540467 to 7d39f45 Compare November 7, 2025 16:53
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review November 7, 2025 16:56
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner November 7, 2025 16:56
@OttoAllmendinger OttoAllmendinger merged commit 126d4b9 into master Nov 7, 2025
1 check passed
@OttoAllmendinger OttoAllmendinger deleted the BTC-2652.bitgo-psbt-parse branch November 7, 2025 17:09
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