wallet: add codex32 argument to addhdkey #32652

pull roconnor-blockstream wants to merge 12 commits into bitcoin:master from roconnor-blockstream:codex32 changing 19 files +1648 −46
  1. roconnor-blockstream commented at 10:05 pm on May 30, 2025: contributor

    Rebase of #27351 onto #29136.

    WIP. Testcases don’t pass yet.

    This PR introduces the ability to import BIP 93/codex32 master seeds with the addhdkey command. It currently expects seeds to be provided in either as a single seed or as a list of shares which can be assembled via Shamir Secret Sharing.

  2. descriptor: Add unused(KEY) descriptor
    unused() descriptors do not have scriptPubKeys. Instead, the wallet uses
    them to store keys without having any scripts to watch for.
    06e6c21d4a
  3. test: Simple test for importing unused(KEY) 55c8f7ba81
  4. wallet: Add addhdkey RPC b7d15f9cd3
  5. wallet, rpc: Disallow import of unused() if key already exists 5f1908402c
  6. wallet, rpc: Disallow importing unused() to wallets without privkeys b23cefb4f3
  7. DrahtBot commented at 10:06 pm on May 30, 2025: contributor

    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/32652.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK achow101

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #bitcoin-core/gui/872 (Menu action to export a watchonly wallet by achow101)
    • #32784 (wallet: derivehdkey RPC to get xpub at arbitrary path by Sjors)
    • #32741 (rpc: add optional nodeid param to filter getpeerinfo by waketraindev)
    • #32489 (wallet: Add exportwatchonlywallet RPC to export a watchonly version of a wallet by achow101)
    • #30243 (descriptors: taproot partial descriptors by Eunovo)
    • #29136 (wallet: addhdkey RPC to add just keys to wallets via new unused(KEY) descriptor by achow101)
    • #28690 (build: Introduce internal kernel library by TheCharlatan)
    • #28333 (wallet: Construct ScriptPubKeyMans with all data rather than loaded progressively 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 typos and grammar issues:

    • addhkey takes at most one key type -> addhdkey takes at most one key type [RPC error message mistypes the command name, risking confusion]

    drahtbot_id_4_m

  8. DrahtBot added the label Wallet on May 30, 2025
  9. DrahtBot added the label CI failed on May 30, 2025
  10. DrahtBot commented at 10:38 pm on May 30, 2025: contributor

    🚧 At least one of the CI tasks failed. Task previous releases, depends DEBUG: https://github.com/bitcoin/bitcoin/runs/43216931922 LLM reason (✨ experimental): The CI failure is due to a compilation error caused by an invalid use of dynamic_cast on a non-pointer type.

    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.

  11. achow101 commented at 8:48 pm on June 2, 2025: member

    Concept ACK-ish

    This is certainly better than the previous approach.

  12. Hack importdescriptors to look for private keys in the wallet 18a14d30c8
  13. bech32: expose the character conversion functionality
    In the next commit we will implement a new checksum, codex32, which uses
    the same encoding and HRP rules as bech32 and bech32m, but has a
    substantially different checksum verification procedure. To minimize
    duplicated code, we expose the character conversion in a new
    bech32::internals module.
    bc533749ab
  14. codex32: implement encoding and decoding 6c1ae6d751
  15. codex32: introduce Lagrange interpolation and derived shares bddedc2e4f
  16. codex32: provide user-readable error types 1157b73f8a
  17. wallet: add ability for `addhdkey` to import a codex32 seed 386fab75e2
  18. codex32: add functional test for seed import 3335c14373
  19. roconnor-blockstream force-pushed on Jun 24, 2025

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-07-01 00:12 UTC

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