Skip to content

wallet: render BIP388 wallet policies #32659

Closed

Description

@Sjors

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.

Activity

  1. enochaz commented on Jun 2, 2025

    @enochaz
    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.

  2. Sjors commented on Jun 4, 2025

    @Sjors
    MemberAuthor

    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.

  3. enochaz commented on Jun 5, 2025

    @enochaz
    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.

  4. Sjors commented on Jul 21, 2025

    @Sjors
    MemberAuthor

    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.

  5. Sjors commented on Aug 5, 2025

    @Sjors
    MemberAuthor

    #33008 now has some very rudimentary code that loops through our descriptors and constructs a BIP388 policy if possible.

  6. Sjors commented on May 15, 2026

    @Sjors
    MemberAuthor

    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.

  7. Sjors commented on Aug 6, 2026

    @Sjors
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions