Repository navigation
Reduce secp256k1 supply-chain trust in backup/recovery path #3
Copy link
Copy link
Closed
Labels
area: ciContinuous integration and workflow configuration.Continuous integration and workflow configuration.area: securitySecurity invariants, hardening, and security-sensitive boundaries.Security invariants, hardening, and security-sensitive boundaries.area: wallet/coreWallet integration and Bitcoin Core boundaries.Wallet integration and Bitcoin Core boundaries.enhancementNew 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.
Description
Activity
- added a commit that references this issue
on Sep 21, 2026 - addedgate: adversarial reviewResolve, merge, or explicitly defer before the next full adversarial review.Resolve, merge, or explicitly defer before the next full adversarial review.area: ciContinuous integration and workflow configuration.Continuous integration and workflow configuration.area: securitySecurity invariants, hardening, and security-sensitive boundaries.Security invariants, hardening, and security-sensitive boundaries.area: wallet/coreWallet integration and Bitcoin Core boundaries.Wallet integration and Bitcoin Core boundaries.
on Sep 24, 2026 BenWestgate commented
on Sep 27, 2026 OwnerAuthorMore actionsCurrent release-gate status: the production backup/recovery path on
reviewability-v1no longer depends on Pythonbip32/Coincurve for root validity or hardened derivation; stdlib code validates/serializes the root and Bitcoin Core v32 performs the wallet-side hardened derivation/public-key work. PR #7 is the remaining test/CI cleanup that removes the Python wallet oracle and secp256k1 dependency from the documented.[dev]contributor path; #51 independently checks its frozen fingerprints against real pinned Core. #7 is not ready to close this issue today: #36 has moved its head to8338c72, which is currently non-mergeable againstreviewability-v1and has no fresh workflow run. Refresh/revalidate #7 first, then #3/#6 can close with it.Reacted by Ben Westgate- added 3 commits that reference this issue
on Sep 28, 2026 - added a commit that references this issue
on Oct 2, 2026
Metadata
Metadata
Assignees
Labels
area: ciContinuous integration and workflow configuration.Continuous integration and workflow configuration.area: securitySecurity invariants, hardening, and security-sensitive boundaries.Security invariants, hardening, and security-sensitive boundaries.area: wallet/coreWallet integration and Bitcoin Core boundaries.Wallet integration and Bitcoin Core boundaries.enhancementNew 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.
Problem
On
reviewability-v1, the documented CLI install path is substantially hardened:bip32is pinned to a specific Git commit and hash, andcoincurve==21.0.0is installed with--require-hashes. That protects users who follow the reviewed installation procedure from silently receiving a later malicious upstream release.However, the runtime/package architecture still has a concentrated trust point:
codex32→bip32→coincurve→ libsecp256k1src/codex32/profiles/ms32.pyimportsbip32.BIP32, and_bip32_node()callsBIP32.from_seed(). The security model explicitly treats BIP32 and Coincurve as trusted cryptographic dependencies.There are two related concerns:
bip32>=5,<6, withbip32allowing a Coincurve range) rather than the repository's hash-pinned lockfiles. A malicious future version inside those ranges could therefore enter an environment without any change to codex32 source.The hash-pinned install procedure mitigates the first concern for the prescribed CLI installation, but it does not remove the architectural trust chokepoint.
Proposed direction
Make the codex32 backup/recovery core independent of secp256k1-native dependencies, and move wallet derivation / descriptor functionality behind an explicit wallet-integration boundary.
In particular, BIP32 root validity does not require public-key point multiplication. Root validation can be implemented using stdlib primitives:
Bitcoin seed;ILas an integer;IL == 0orIL >= n.That would allow creation, parsing, sharing, recovery, correction, and validation of master-seed backups without importing Coincurve at all.
Wallet-specific operations that need fingerprints, xpubs, or descriptors could continue to use a secp256k1 implementation, but only when the user explicitly invokes that functionality.
Desired security property
A user should be able to create, verify, split, recover, and correct a codex32 master-seed backup without loading third-party native cryptographic code into the secret-handling process.
The remaining secp256k1 trust boundary should be limited to wallet interoperability/derivation, where it is actually required.
Possible implementation shape
bip32/coincurvefrom modules needed by backup/recovery operations.bip32orcoincurveinstalled.This would improve both reviewability and resistance to a maintainer/package-registry compromise without requiring codex32 to reimplement general secp256k1 arithmetic.