wallet: render BIP388 wallet policies #32659

issue Sjors openend this issue on June 2, 2025
  1. Sjors commented at 11:49 am on June 2, 2025: member

    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 https://github.com/bitcoin-core/HWI/pull/647 as well as through other (?) tools.

  2. willcl-ark added the label Wallet on Jun 2, 2025
  3. willcl-ark added the label RPC/REST/ZMQ on Jun 2, 2025
  4. enirox001 commented at 9:52 pm on June 2, 2025: contributor
    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.
  5. Sjors commented at 10:18 am on June 4, 2025: member

    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.

  6. enirox001 commented at 6:41 pm on June 5, 2025: contributor

    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.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-06-15 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me