Skip to content

Conversation

@Sjors
Copy link
Member

@Sjors Sjors commented Jun 20, 2025

Given a (blank) wallet with an unused(KEY) descriptor, derivehdkey "m/87h/0h/0h" gets the xpub or xpriv at any given path.

This is particularly useful for multisig setup where it's not desirable to use our default derivations (e.g. 44h).

I updated the multisig tutorial and the functional test.

Based on:

@DrahtBot DrahtBot changed the title wallet: derivehdkey RPC to get xpub at arbitrary path wallet: derivehdkey RPC to get xpub at arbitrary path Jun 20, 2025
@DrahtBot
Copy link
Contributor

DrahtBot commented Jun 20, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32784.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK rkrux

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #33874 (wallet: refactor ProcessDescriptorImport by naiyoma)
  • #33008 (wallet: support bip388 policy with external signer by Sjors)
  • #32489 (wallet: Add exportwatchonlywallet RPC to export a watchonly version of a wallet by achow101)
  • #31668 (Added rescan option for import descriptors by saikiran57)
  • #30341 (Permit Combiner to strip bip32_deriv information by willcl-ark)
  • #29136 (wallet: addhdkey RPC to add just keys to wallets via new unused(KEY) descriptor by achow101)

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 places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

  • memcpy(origin.fingerprint, descendant.vchFingerprint, 4) in src/rpc/util.cpp

2026-01-05

@DrahtBot
Copy link
Contributor

🚧 At least one of the CI tasks failed.
Task lint: https://github.com/bitcoin/bitcoin/runs/44475268764
LLM reason (✨ experimental): The CI failure is caused by errors from the lint check 'py_lint', specifically due to unused imports flagged by ruff.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

src/rpc/util.h Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In util.h: “@params[in] path” → “@param[in] path” [Doxygen tag typo]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressesd -> addresses [extra “d” makes “addresses” misspelled]

@rkrux
Copy link
Contributor

rkrux commented Jul 18, 2025

Very nice, Concept ACK.
I will review this PR.

@Sjors Sjors force-pushed the 2025/06/gethdkey branch 2 times, most recently from 380a57f to 017fb68 Compare August 1, 2025 10:52
@Sjors
Copy link
Member Author

Sjors commented Sep 26, 2025

(will rebase this later)

achow101 and others added 12 commits January 2, 2026 16:51
unused() descriptors do not have scriptPubKeys. Instead, the wallet uses
them to store keys without having any scripts to watch for.
Use derivehdkey instead of extracting each participant xpub (and
derivation info) from  the listdescriptors output.

Additionally use the new <0;1> descriptor syntax.

Finally this commits adds a few debug log lines, and expand the
explanation for why we use m/44h/1h/0h.
Use derivehdkey instead of extracting each participant xpub
from  the listdescriptors output.

Additionally use the new <0;1> descriptor syntax.

Also use bitcoin rpc instead of bitcoin-cli.
@Sjors Sjors force-pushed the 2025/06/gethdkey branch from 017fb68 to 2d40e1e Compare January 5, 2026 04:05
@Sjors
Copy link
Member Author

Sjors commented Jan 5, 2026

Rebased after #32821 landed and #29136 was rebased. Re-tested by having an LLM follow the tutorial.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants