MuSig2 - #794
Conversation
|
Cherry-picked the latest version of all the independent PRs. Other than displaying an address this should be all you need to use MuSig2. |
5dd2951 to
ec2a844
Compare
|
Somehow I thought I already implemented sending, but it seems I didn't. Done now. Tested with key path as well as script path. |
|
Did a complete overhaul to match Sjors/async-hwi#2 (though just Ledger, we'll leave ColdCard for a followup). Much vibed, but manually tested. I'll extract smaller patches as separate PR's later. This PR is orthogonal to #819, however I would prefer to use the newer Ledger app version from it, since it contains various MuSig2 related fixes. |
|
Testing this out, I noticed that it seems like if the ledger is the last signer to add a pubnonce, and I pass that PSBT right back to |
Taken from LedgerHQ/app-bitcoin-new at 2.4.1 Conflicts: hwilib/devices/ledger.py Rename tx to psbt.
This adds support handling public nonces and partial signatures.
Co-authored-by: Claude (Opus 4.8) <noreply@anthropic.com>
Co-authored-by: Claude (Opus 4.8) <noreply@anthropic.com>
When Ledger is the last signer to add a pubnonce, no partial signatures exist yet. Detect its own pubnonce through the Taproot key origin so the next signtx call keeps all pubnonces and advances to partial signing. Cover the round-selection paths with focused unit tests.
|
Rebased and probably fixed the ledger is the last signer issue. I can't test this myself at the moment. |
This is based on:
To be used with, and developed in parallel to:
The general workflow is:
tr(musig(...))descriptorbitcoin-cli registerpolicy "MuSigTest"(Core callshwi registerand stores the hmac)bitcoin-cli walletdisplayaddress(Core callshwi displayaddress --policy-name ...)bitcoin rpc send '[{"bc1p...": 0.000001}]' fee_rate=1hwi signtx --policy-name ...per device), round 2 collects partial signatures, then Core aggregates and broadcastswalletprocesspsbtresumes the dancehwi signtx/walletprocesspsbtround-tripping by hand still works if you prefer to drive the rounds yourselfTo work around a Ledger quirk, we stash other participants' pubnonce and partial sig before sending it to the device and merge them back afterwards.
Works with the Ledger Bitcoin app 2.4.1, i.e. this does not depend on #819.
CI runs an end-to-end scenario (register → display → fund → 2-round spend → confirm) against a bitcoind built from the Core branch above, plus device tests for register/displayaddress against speculos.
Potential follow-ups: