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
BIP 388 wallet policies were introduced by @bigspider to make it easier to verify descriptors on a signing device.
A first step towards supporting them could be to add a policy and keys field to the getdescriptorinfo and listdescriptors RPC results. Only for the subset of descriptors that BIP388 allows.
These fields can be manually passed into HWI using this (somewhat old) PR bitcoin-core/HWI#647 as well as through other (?) tools.
Would be open to explore how we can add those policy and keys fields to the getdescriptorinfo and listdescriptors RPCs for BIP 388 wallet policies. I'll be diving into the BIP and the existing code in the next few days, and definitely checking out that older HWI PR for insights.
One caveat is that a wallet policy typically uses /** to indicate a combined receive and change descriptor <0;1>. Although we can import such combined descriptors, we store them seperately and forget about the unified original. So the listdescriptors command would return a useless policy value.
We could make listdescriptors smart, but it's perhaps better if don't give it a policy and keys field and instead introduce a new listwalletpolicies RPC that is smart (and only considers the subset of descriptors that comply with BIP388).
I therefore think (only) getdescriptorinfo is the easiest place to start.
Thanks for the clarification! That's a crucial point about listdescriptors and the /** handling.
I agree completely that getdescriptorinfo is the right place to start. My plan is to focus on implementing the policy and keys fields there, by adding logic to parse the input descriptor into a BIP 388 policy if it's compatible.
I'll keep the idea of a dedicated listwalletpolicies RPC in mind for a follow-up contribution, as that seems like the cleanest way to expose stored wallet policies without forcing listdescriptors into an awkward reconstruction.
Meanwhile I started working on #33008 which has most of the functionality to send a BIP388 policy to an external signer, get a resulting hmac and store that.
But I haven't worked on converting our descriptors to BIP388 policies yet.
Going to close this for now. With bitcoin-core/HWI#842 HWI will take care of converting descriptors to BIP388. It might still be useful for us to support this, but less urgent.
Activity
enochaz commentedon Jun 2, 2025
Would be open to explore how we can add those
policyandkeysfields to thegetdescriptorinfoandlistdescriptorsRPCs for BIP 388 wallet policies. I'll be diving into the BIP and the existing code in the next few days, and definitely checking out that older HWI PR for insights.Sjors commentedon Jun 4, 2025
One caveat is that a wallet policy typically uses
/**to indicate a combined receive and change descriptor<0;1>. Although we can import such combined descriptors, we store them seperately and forget about the unified original. So thelistdescriptorscommand would return a useless policy value.We could make
listdescriptorssmart, but it's perhaps better if don't give it apolicyandkeysfield and instead introduce a newlistwalletpoliciesRPC that is smart (and only considers the subset of descriptors that comply with BIP388).I therefore think (only)
getdescriptorinfois the easiest place to start.enochaz commentedon Jun 5, 2025
Thanks for the clarification! That's a crucial point about listdescriptors and the /** handling.
I agree completely that getdescriptorinfo is the right place to start. My plan is to focus on implementing the policy and keys fields there, by adding logic to parse the input descriptor into a BIP 388 policy if it's compatible.
I'll keep the idea of a dedicated listwalletpolicies RPC in mind for a follow-up contribution, as that seems like the cleanest way to expose stored wallet policies without forcing listdescriptors into an awkward reconstruction.
Sjors commentedon Jul 21, 2025
Meanwhile I started working on #33008 which has most of the functionality to send a BIP388 policy to an external signer, get a resulting hmac and store that.
But I haven't worked on converting our descriptors to BIP388 policies yet.
Sjors commentedon Aug 5, 2025
#33008 now has some very rudimentary code that loops through our descriptors and constructs a BIP388 policy if possible.
Sjors commentedon May 15, 2026
I closed #33008 and moved it to Sjors#91 on my own fork for now.
@rxbryan opened a draft PR #35287 to render BIP-388 wallet policies in
getdescriptorinfo.script: support BIP-388 wallet policies rendering
Sjors commentedon Aug 6, 2026
Going to close this for now. With bitcoin-core/HWI#842 HWI will take care of converting descriptors to BIP388. It might still be useful for us to support this, but less urgent.