Skip to content

Conversation

@OttoAllmendinger
Copy link
Contributor

This PR makes several improvements to the transaction signing functionality in
the abstract-utxo module:

  • Changes signTransaction to return a transaction object instead of an object
    with txHex string, enabling direct manipulation before serialization
  • Splits the large sign.ts file into smaller, focused modules for better
    maintainability:
    • signLegacyTransaction.ts for legacy transaction format
    • signPsbt.ts for PSBT-related signing functionality
    • SigningError.ts for error classes
  • Adds transaction decoding utilities to support both utxolib and wasm-utxo
    backends
  • Replaces signAndVerifyPsbt test with signPsbtWithMusig2Participant test

These changes improve code organization, maintainability, and provide more
flexibility for transaction handling.

Issue: BTC-2806

@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review December 2, 2025 20:17
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner December 2, 2025 20:17
OttoAllmendinger and others added 4 commits December 3, 2025 09:42
…bject

Change the return type of `signTransaction` to return a transaction object
instead of an object containing a txHex string. This allows callers to
work with the transaction object directly before serializing it.

Issue: BTC-2806

Co-authored-by: llm-git <llm-git@ttll.de>
Split the large sign.ts file into smaller, more focused modules:
- signLegacyTransaction.ts for legacy transaction format
- signPsbt.ts for PSBT-related signing functionality
- SigningError.ts for error classes

This refactoring improves code organization and makes it easier to maintain
the different signing pathways.

Issue: BTC-2806

Co-authored-by: llm-git <llm-git@ttll.de>
Replace signAndVerifyPsbt test with signPsbtWithMusig2Participant test
to verify that this function works with a mock Musig2Participant.

Issue: BTC-2806

Co-authored-by: llm-git <llm-git@ttll.de>
Refactor transaction decoding logic into separate helper functions to support
both utxolib and wasm-utxo backends. Extract string-to-buffer conversion
into a reusable utility function.

Issue: BTC-2806

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2806.refactor-signtx branch from 0ef3d03 to 1121868 Compare December 3, 2025 08:42
@OttoAllmendinger OttoAllmendinger merged commit 6e44eca into master Dec 3, 2025
14 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