You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a 2-of-2 multisig between Bitcoin Core and a (physical) Ledger Nano X. The keypath uses MuSig2 and then there's one fallback script path per device that works after one day and three days.
On the Bitcoin Core side I'm using a slightly modified version of the branch here: bitcoin/bitcoin#29675 (modifications were just to create the wallet using an unused descriptor and addhdkey RPC).
I'm using the 2.4.0 testnet app and tweaked moosig.py to perform the device steps. (returning early and/or skipping previous steps where needed)
Here's the descriptor including the Bitcoin Core (test) private key, which you should be able to import into a blank wallet (not watch-only):
@0 is the device [c5f97abd/87h/1h/0h]tpubDC7VXdmq5VRJVjk3FwoUfCNDZMaoGtjdRESPR6NKXtMskS6c6qekcmzv9USCDTPY3zpzmoKEzBcEKGYUw6LEGAnYM2xxuS8ytK5Nnq49uMS
@1 is Bitcoin Core (xpub version): [2562bd2d/44h/1h/0h]tpubD6NzVbkrYhZ4WZHAxkposYodz9hNfKcKC9JdZRSQcQW6fGdHEnaaa8ZmNvfTYsWPPwCubgf7ijbjVPSC6Q4zrgCK9m3p8baQSqHrAMLd4DP
Registration worked fine, and I took note of the HMAC. IIRC it warned about the unusual derivation, but otherwise recognized itself and the other side.
I had Bitcoin Core generate a deposit address (getnewaddress RPC) and didn't try displaying it.
After funding and confirmation, I tried spending some of it using the send RPC. This generates the following PSBT:
Just in case here's an alternative PSBT generated with an unmodified bitcoin/bitcoin#29675 @ d4693372eb1bb13e24e01438c5dc6d9811929982, which has the same length and causes the same failure.
The device then prompts me to approve the transaction. It recognized the policy. My understanding is that this prompt is for signing the script path, since the keypath public nonce commitment should be silent.
But it crashes, after the last approval step (fees) and after confirming "sign transaction":
🐮 Requesting pubnonce (Round 1)
Traceback (most recent call last):
File "/Users/sjors/dev/moosig/moosig.py", line 103, in <module>
main(client)
File "/Users/sjors/dev/moosig/moosig.py", line 84, in main
signer_1.generate_public_nonces(psbt)
File "/Users/sjors/dev/moosig/utils/musig2.py", line 812, in generate_public_nonces
res = self.client.sign_psbt(psbt, self.wallet_policy, self.wallet_hmac)
File "/Users/sjors/dev/moosig/venv/lib/python3.10/site-packages/ledger_bitcoin/client.py", line 330, in sign_psbt
raise DeviceException(error_code=sw, ins=BitcoinInsType.SIGN_PSBT)
ledger_bitcoin.exception.errors.IncorrectDataError: ('0x6a80', 'Error in <BitcoinInsType.SIGN_PSBT: 4> command', '')
The same descriptor and policy with the script path fallbacks works fine (once I learned that the PSBT needs to contain either no public nonces or all of them). So my guess is that the combination trips it up.
I haven't tried a unilateral spend from the Bitcoin Core side yet since it's not spendable yet (the ledger side should be now), so there's also the possibility that it's just not spendable if my manual miniscript skills failed me.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
See also bitcoin/bitcoin#29675 (comment)
I created a 2-of-2 multisig between Bitcoin Core and a (physical) Ledger Nano X. The keypath uses MuSig2 and then there's one fallback script path per device that works after one day and three days.
On the Bitcoin Core side I'm using a slightly modified version of the branch here: bitcoin/bitcoin#29675 (modifications were just to create the wallet using an
unused
descriptor andaddhdkey
RPC).I'm using the 2.4.0 testnet app and tweaked moosig.py to perform the device steps. (returning early and/or skipping previous steps where needed)
Here's the descriptor including the Bitcoin Core (test) private key, which you should be able to import into a blank wallet (not watch-only):
I funded it on testnet4 but it should work on any test network if you fund it yourself. Feel free to sweep some, but do leave a bit behind.
First I registered the policy (crafted by manually editing the descriptor):
tr(musig(@0,@1)/**,{and_v(v:pk(@0/**),older(144)),and_v(v:pk(@1/**),older(432))})
@0
is the device[c5f97abd/87h/1h/0h]tpubDC7VXdmq5VRJVjk3FwoUfCNDZMaoGtjdRESPR6NKXtMskS6c6qekcmzv9USCDTPY3zpzmoKEzBcEKGYUw6LEGAnYM2xxuS8ytK5Nnq49uMS
@1
is Bitcoin Core (xpub version):[2562bd2d/44h/1h/0h]tpubD6NzVbkrYhZ4WZHAxkposYodz9hNfKcKC9JdZRSQcQW6fGdHEnaaa8ZmNvfTYsWPPwCubgf7ijbjVPSC6Q4zrgCK9m3p8baQSqHrAMLd4DP
Registration worked fine, and I took note of the HMAC. IIRC it warned about the unusual derivation, but otherwise recognized itself and the other side.
I had Bitcoin Core generate a deposit address (
getnewaddress
RPC) and didn't try displaying it.After funding and confirmation, I tried spending some of it using the
send
RPC. This generates the following PSBT:Just in case here's an alternative PSBT generated with an unmodified bitcoin/bitcoin#29675 @ d4693372eb1bb13e24e01438c5dc6d9811929982, which has the same length and causes the same failure.
JSON version
This doesn't contain a public nonce (which would require a
processpsbt
call).I hardcoded that as
psbt_base64
intomoosig.py
.And then try to get the public nonce:
The device then prompts me to approve the transaction. It recognized the policy. My understanding is that this prompt is for signing the script path, since the keypath public nonce commitment should be silent.
But it crashes, after the last approval step (fees) and after confirming "sign transaction":
The same descriptor and policy with the script path fallbacks works fine (once I learned that the PSBT needs to contain either no public nonces or all of them). So my guess is that the combination trips it up.
I haven't tried a unilateral spend from the Bitcoin Core side yet since it's not spendable yet (the ledger side should be now), so there's also the possibility that it's just not spendable if my manual miniscript skills failed me.
The text was updated successfully, but these errors were encountered: