Repository navigation
Remove internal hardened BIP32 derivation via Bitcoin Core HD-key RPCs #6
Description
Activity
- added a commit that references this issue
on Sep 17, 2026 - addedenhancementNew feature or requestNew feature or requestgate: adversarial reviewResolve, merge, or explicitly defer before the next full adversarial review.Resolve, merge, or explicitly defer before the next full adversarial review.
on Sep 21, 2026 BenWestgate commented
on Sep 25, 2026 OwnerAuthorMore actionsCurrent-state audit (updated 2026-09-27):
reviewability-v1already implements the #6 production boundary. Python stops at stdlib BIP32 root validation/root xprv serialization; Bitcoin Core v32gethdkeys/derivehdkeyperforms hardened account derivation and public-key conversion. No scratch-wallet fallback is used.PR #7 is now refreshed onto
reviewability-v1at head4ceedeef, mergeable, with a green Python 3.10–3.15/full test matrix. It removes the remaining Pythonbip32/Coincurve oracle from tests and CI. PR #51 is restacked on that exact head at0466510, is mergeable, and its pinned real-Core v32.0rc2 fixture-verification job passes. The prior conflict/no-fresh-run blocker is resolved.Review/merge #7 first, then retarget/merge #51 onto
reviewability-v1. After both land, #6’s implementation and independent real-Core coverage are complete for the v1 gate.- addedarea: ciContinuous integration and workflow configuration.Continuous integration and workflow configuration.area: wallet/coreWallet integration and Bitcoin Core boundaries.Wallet integration and Bitcoin Core boundaries.
on Sep 25, 2026 - added 3 commits that reference this issue
on Sep 28, 2026 - added a commit that references this issue
on Oct 2, 2026
Follow-up to #3.
Goal
Remove the temporary Python implementation of hardened BIP32 child derivation from the Bitcoin Core integration. Python should stop at validating/serializing the BIP32 root xprv/tprv; Bitcoin Core should perform hardened derivation and public-key work.
Verified Core 31.1 behavior
Bitcoin Core v31.1.0 has
createwalletdescriptorandgethdkeys, but does not exposeaddhdkey,derivehdkey, orsethdseedRPCs.A root key can nevertheless be made known to a descriptor wallet by importing one inactive descriptor containing the root xprv/tprv.
gethdkeysthen returns the corresponding xpub/tpub, andcreatewalletdescriptorsuccessfully derives the standard account-0 descriptors with origin metadata.Using the public synthetic BIP93 test seed, this was verified on both networks:
44h/0h/0h,49h/0h/0h,84h/0h/0h,86h/0h/0h44h/1h/0h,49h/1h/0h,84h/1h/0h,86h/1h/0hSo
createwalletdescriptorworks on non-mainnet as well as mainnet. Its fixed account0his acceptable for the current codex32 integration.Remaining problem
createwalletdescriptoris wallet-stateful: the wallet must already know the private HD key, and the RPC adds descriptors to that wallet. That is usable for private-wallet initialization, but it is not a clean stateless replacement forpublic_descriptors()/ watch-only export. Using a scratch wallet would persist secret material and introduces cleanup/lifecycle concerns.The newer
derivehdkeydesign would be the clean primitive once it exists in a Bitcoin Core release that codex32 supports, because it can return the derived xpub plus key origin without requiring Python to implement hardened child derivation.Implementation plan
importdescriptors→gethdkeys→createwalletdescriptorflow, restricted to account 0.derivehdkey, use it for explicit hardened paths and consume Core's returned origin + xpub/tpub._hardened_childand non-root child-xprv serialization from codex32 once all public descriptor and multisig-account derivation paths use Core.Acceptance criteria