Skip to content

Optionally pass BIP388 policy to displayaddress - #841

Draft
Sjors wants to merge 4 commits into
bitcoin-core:masterfrom
Sjors:2026/08/display-address-bip388
Draft

Optionally pass BIP388 policy to displayaddress#841
Sjors wants to merge 4 commits into
bitcoin-core:masterfrom
Sjors:2026/08/display-address-bip388

Conversation

@Sjors

@Sjors Sjors commented Aug 2, 2026

Copy link
Copy Markdown
Member

This adds BIP 388 wallet policy support to displayaddress, following the descriptor-based approach introduced in #791 and #792. The command takes a combined multipath descriptor and an address index, instead of requiring callers to construct a BIP 388 policy directly.

The existing direct descriptor use case remains supported, including the single-sig descriptor form used by Bitcoin Core wallets.

For Ledger, custom policies can be displayed using the opaque policy registration returned by registerpolicy. Standard policies do not require registration.

For BitBox02, the descriptor is translated to the device's registered policy format.

Includes unit tests and Ledger and BitBox02 simulator coverage.

PR is draft, because the first two commits are shared with #791.

Sjors and others added 2 commits August 2, 2026 12:59
Convert combined multipath output descriptors into BIP388 descriptor templates and key vectors, and validate that the result follows BIP388. Cover all canonical valid and invalid BIP388 policy vectors.

Co-authored-by: Codex (GPT-5.6 Sol) <noreply@openai.com>
Frame the device registration and policy name as separately length-prefixed fields before hex encoding the opaque value. Decode and validate all fields while allowing later fields to be appended.

Co-authored-by: Codex (GPT-5.6 Sol) <noreply@openai.com>
@Sjors Sjors mentioned this pull request Aug 2, 2026
2 tasks
Sjors and others added 2 commits August 2, 2026 19:33
Accept a combined multipath output descriptor, address index, optional registration, and change flag. Convert the descriptor to a BIP388 policy and display the selected address on Ledger devices.

Decode opaque Ledger registrations so the device registration and policy name do not need separate command-line arguments.

Co-authored-by: Codex (GPT-5.6 Sol) <noreply@openai.com>
Translate BIP388 policies into BitBox02 script configs and derive the selected receive or change address from the device key's multipath expression.

Cover branch selection with unit tests and display a registered policy address in the BitBox02 simulator suite.

Co-authored-by: Codex (GPT-5.6 Sol) <noreply@openai.com>
@Sjors
Sjors force-pushed the 2026/08/display-address-bip388 branch from 599b8a6 to 499c52a Compare August 2, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant