Repository navigation
create: Draw randomness from Core and OS - #201
BenWestgate wants to merge 2 commits into
Conversation
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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
BenWestgate
left a comment
There was a problem hiding this comment.
AI-assisted review. ACK 0d5df21 (static code/security review). Nine changed files reviewed; no reportable security findings. CI is green. I did not independently rerun the live Bitcoin Core regtest.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d5df2128b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if self._folder: | ||
| shutil.rmtree(self._folder, ignore_errors=True) | ||
| detach = ("/usr/bin/hdiutil", "detach", "-force", self._disk) | ||
| if self._disk and not subprocess.run(detach, capture_output=True, check=False).returncode: |
There was a problem hiding this comment.
Defer interrupts until filesystem cleanup finishes
If Ctrl-C, SIGHUP, or SIGTERM arrives during rmtree or the macOS detach subprocess, KeyboardInterrupt escapes immediately: only the preceding RPC cleanup catches it. On the successful-draw path, __call__ does not retry _close(), so the encrypted wallet can remain undeleted or the RAM disk can remain mounted, and the CLI prints only the generic interruption message without identifying the leftover resource. Catch and defer interruptions throughout filesystem cleanup as well, completing or reporting each cleanup step before propagating the interruption.
Useful? React with 👍 / 👎.
Use the injected entropy boundary from #200 to source every fresh CLI draw from
CoreEntropy: hash a fresh Bitcoin Core xprv with 32 independent OS-random bytes, and fail closed if Core or temporary-wallet cleanup fails.The temporary wallet is encrypted, relocked and unloaded for each draw. Supported termination signals become cleanup interruptions before another card is emitted. Security/user docs cover RAM-backed storage, disk fallback and leaked-wallet limits.
Validation: 347 Core/CLI/generation tests pass;
git diff --checkpasses. The same implementation was independently security-reviewed before this split, including a 22/22 Linux/Core 32.0rc4 run; obtain a current-head review for this rebased commit.This replaces the oversized review unit in #145.