Skip to content

Conversation

@OttoAllmendinger
Copy link
Contributor

@OttoAllmendinger OttoAllmendinger commented Dec 2, 2025

This PR includes several key improvements to the UTXO signing architecture:

  • Refactors the signing flow by splitting sign.ts into smaller, focused modules
  • Renames signPsbt to getMusig2Nonces to better reflect its functionality
  • Updates getMusig2Nonces to accept UtxoPsbt objects directly for type safety
  • Moves signTransaction away from AbstractUtxoCoin to a standalone module
  • Adds configuration option to exclude p2trMusig2 script path inputs from ACID tests
  • Improves error reporting by including script type in InputSigningError

The changes aim to improve code organization, reduce circular dependencies,
and enhance the developer experience when working with MuSig2 and PSBT
signing.

BTC-2806

OttoAllmendinger and others added 7 commits December 2, 2025 13:57
Adds configuration option to exclude p2trMusig2 script path inputs
from ACID test suites, as they often require special handling.

Issue: BTC-2806

Co-authored-by: llm-git <llm-git@ttll.de>
Rename method to better reflect its actual functionality as a getter for
MuSig2 nonces rather than a signing operation. Keep the old method as
deprecated to maintain backward compatibility.

Issue: BTC-2806

Co-authored-by: llm-git <llm-git@ttll.de>
Move RootWalletKeys type definition to utxo-lib from abstractUtxoCoin
to better organize code structure and eliminate circular dependencies.

Issue: BTC-2806

Co-authored-by: llm-git <llm-git@ttll.de>
Move signTransaction function to standalone module that doesn't depend on
AbstractUtxoCoin. Move DecodedTransaction type to types.ts to break
dependency cycle.

Issue: BTC-2806

Co-authored-by: llm-git <llm-git@ttll.de>
Include PSBT script type in InputSigningError to improve debugging of
transaction signing issues. This provides better visibility into which
input types are failing during the signing process.

Issue: BTC-2806

Co-authored-by: llm-git <llm-git@ttll.de>
Update the getMusig2Nonces method to accept a UtxoPsbt object directly
instead of a hex string. This improves type safety and reduces unnecessary
encoding/decoding. Also add a helper method decodeTransactionAsPsbt to
validate and cast decoded transactions to UtxoPsbt.

Update dependent functions to use the new method signature and refactor
to avoid unnecessary conversion steps.

Issue: BTC-2806

Co-authored-by: llm-git <llm-git@ttll.de>
Tests the signAndVerifyPsbt function for transaction signing, verifying
that it correctly signs PSBTs and validates signatures for different
input types.

Issue: BTC-2806

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2806.add-signtx-tests branch from 6d0f574 to cc18fec Compare December 2, 2025 13:00
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review December 2, 2025 13:33
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner December 2, 2025 13:33
@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2806.add-signtx-tests branch from cc18fec to 1eee8fe Compare December 2, 2025 13:36
@OttoAllmendinger OttoAllmendinger merged commit ebed7be into master Dec 2, 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.

4 participants