-
Notifications
You must be signed in to change notification settings - Fork 37.7k
wallet: support bip388 policy with external signer #33008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33008. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. LLM Linter (✨ experimental)Possible typos and grammar issues:
drahtbot_id_4_m |
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
8e9c541
to
061789c
Compare
061789c
to
391584d
Compare
391584d
to
a551603
Compare
bc842eb
to
f87abd6
Compare
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
f87abd6
to
d27a29a
Compare
4330f54
to
f2c78a5
Compare
In the range of devices supporting miniscript, only Ledger requires the software to store the Proof Of Registration, other devices stores it internally(SpecterDiy, BitBox, Coldcard, Jade) or not at all (Krux). |
f2c78a5
to
f581e7a
Compare
@pythcoiner thanks, updated the description. |
External signers such as Ledger, BitBox02 and Jade, when used with multisig, use BIP388 to display (and constrain) descriptor policies to their users.
At least in the case of Ledger (no others so far, see #33008 (comment)) this requires us to hold on to an hmac, which proves to the device that the user previously reviewed and approved it.
This PR adds a new RPC call
registerpolicy
which converts our descriptor(s) into a BIP388 policy (partially implemented), calls a new HWI methodregister
(implemented) and stores the resulting HMAC (implemented).When signing a transaction using HWI's
signtx
it passes the HMAC along with the PSBT (TODO).For convenience the HMAC can be retrieved via
getwalletinfo
(implemented). This is useful for scenario's where we can't (yet) complete a transaction via HWI calls.Note that the HMAC itself is not specified in BIP388 and may be different for different hardware vendors. So we'll store and echo any hex string the device gives us.
An alternative approach to directly supporting BIP388 policies would be to pass the involved descriptors to HWI and have it figure out how to derive a policy.
Testing:
bitcoin rpc registerpolicy
bitcoin rpc getwalletinfo
to see the hmacTODO:
Descriptor
class instead regex madness, implement all constraintsDepends on:
register
command: Add register command for BIP388 policies bitcoin-core/HWI#791--hmac
argument forsigntx
(if set, bypass the current auto-registration workaround)Potential followups: