You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0d5df21
Browse filesBrowse the repository at this point in the historyBrowse files
Use CoreEntropy for every fresh CLI draw, mixing a fresh Bitcoin Core xprv with independent OS bytes and failing closed when Core or cleanup fails. Keep temporary wallet keys encrypted, relock and unload each draw, convert termination signals into cleanup interruptions, and document the trust and disk-fallback boundaries. Add Core adapter, CLI, cleanup, interruption, and regtest coverage.
Copy file name to clipboardExpand all lines: docs/security/model.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ fingerprints, and wallet history cannot spend funds but remain privacy-sensitive
26
26
| Package API | Recovery, derivation, sharing, and wallet operations accept validated artifacts, not unchecked text. |
27
27
| Python process | Secret objects remain in process memory; normal output must not reveal them unintentionally. |
28
28
| Operator and paper | The operator controls transcription, physical recovery cards, wallet records, and acceptance of correction suggestions. |
29
-
| Entropy and root keys |The operating-system cryptographically secure random-number generator (OS-CSPRNG) and Python stdlib HMAC/SHA-512 primitives are trusted. codex32 performs only BIP32 root validation and root xprv/tprv serialization in process. |
29
+
| Entropy and root keys |Every random byte of `ms32 create` hashes a fresh Bitcoin Core HD key, from a generator that mixes in the operating-system cryptographically secure random-number generator (OS-CSPRNG), with 32 more OS-CSPRNG bytes; either source alone keeps the bytes unpredictable. Python stdlib HMAC/SHA-512 primitives are trusted. codex32 performs only BIP32 root validation and root xprv/tprv serialization in process. |
30
30
| Bitcoin Core | The selected `bitcoin-cli`, its configuration, the selected local Core instance, and the destination computer are trusted for fingerprints, hardened/public-key derivation, and wallet initialization. |
31
31
32
32
## Operator assumptions
@@ -64,8 +64,11 @@ The operator must:
64
64
implementation. Elliptic-curve public-key derivation used for fingerprints,
65
65
xpubs, and public descriptors is delegated to the separately running Bitcoin
66
66
Core process.
67
-
- Separate OS-CSPRNG calls provide opportunities to mix fresh noise but cannot
67
+
- Separate Core draws provide opportunities to mix fresh noise but cannot
68
68
guarantee new physical entropy between calls.
69
+
- The temporary randomness wallet's passphrase comes from the OS-CSPRNG. Where
70
+
no RAM folder exists, as on Windows, the encrypted wallet briefly sits on
71
+
disk. Swap, RAM disks and tmpfs can page memory, including secrets, to disk.
69
72
- A checksum, generation-padding hint, fingerprint, or correction candidate
70
73
does not authenticate a backup or prove the operator's intent.
71
74
- Creation feedback identifies correct groups but does not prove the recovery card was corrected.
@@ -132,8 +135,8 @@ Progressive group-level correctness feedback is explicitly accepted and does not
132
135
133
136
Confirmation shows that the operator can produce the correct recovery string during setup. It cannot prove that the physical backup was corrected rather than reconstructed using confirmation feedback.
134
137
135
-
The API accepts neither caller-provided entropy nor padding values, partial
136
-
bases, or resumable ceremony state. Fresh creation rejects final-share
138
+
The API draws randomness only from its caller's `entropy` source and accepts no
| Preflight | Before entropy or recovery input, explicit chain arguments probe the five standard local networks for Bitcoin Core 32 or newer. One response is selected automatically; multiple responses require operator selection. |
236
239
| Recovery identity |`ms32 wallet` and `ms32 create --existing` authenticate a recovered seed before any wallet is listed. Core derives the recovered fingerprint statelessly, and a mismatch raises `FingerprintMismatch` before any wallet RPC. The restore prompt does not show the recovered value, so the operator compares by typing the fingerprint from the wallet record. Without a record, the operator is shown the recovered fingerprint, whether the backup identifier was derived from the seed (the codex32 fingerprint rule, Bails' RIPEMD-160 rule, or its mid-2023 alpha's SHA-256 rule), and a warning, and then chooses. Fresh `ms32 create` has no pre-existing wallet to authenticate: it shows the newly created seed's fingerprint and requires the operator to acknowledge recording it. These checks catch mistakes such as wrong or mixed cards; anyone able to replace a threshold of cards could already read them. |
237
-
| Process boundary | codex32 invokes the reviewed `bitcoin-cli` from `PATH` as a child without a shell, direct RPC socket, wallet database, or wallet-creation operation. Every call uses loopback and the selected chain. |
240
+
| Process boundary | codex32 invokes the reviewed `bitcoin-cli` from `PATH` as a child without a shell, direct RPC socket, or wallet database; its only walletcreation is the temporary randomness wallet. Every call uses loopback and the selected chain. |
238
241
| Destination | Only an empty descriptor wallet with private keys enabled, no external signer, transactions, descriptors, keypool entries, or active scan is eligible. One eligible wallet is offered directly; multiple wallets are selected by number. New wallets are detected by polling, and rejection returns to every eligible wallet. The escaped name is confirmed exactly. |
239
242
| Seed source | The original ceremony result or validated recovered master seed supplies a root xprv for Core's reported chain. Core v32 creates BIP44, BIP49, BIP84, and BIP86 account-0 descriptors from that key. |
240
-
| Secret channel | The master xprv is sent only through the child's standard input. A timestamped rescan obtains one private descriptor from Core's captured stdout and returns it through stdin; neither value is printed or passed in arguments or diagnostics. codex32 has no passphrase channel and suppresses raw Core errors. |
243
+
| Secret channel | The master xprv is sent only through the child's standard input. A timestamped rescan obtains one private descriptor from Core's captured stdout and returns it through stdin; neither value is printed or passed in arguments or diagnostics. codex32 never handles the operator's wallet passphrase and suppresses raw Core errors. |
241
244
| Revalidation | Every destination property is checked again immediately before adding the key. `addhdkey` must accept it and `createwalletdescriptor` must return two public descriptors for each requested address type. Numeric recovery timestamps trigger Core's time-based rescan (genesis for `0`), with no guessed block height. Core is trusted to derive and store the wallet policy. |
242
245
| Relocking | Once Core reports an encrypted private-key wallet unlocked, a `finally`-protected obligation requests `walletlock` and verifies the locked state after success, failure, state change, or interruption. |
0 commit comments