Repository navigation
2.3.1: seed safety fixes, smaller bundle, CI - #80
Merged
Merged
Conversation
Fixes tools that could show a wrong seed as if it were right, or leave seed material on the page: - Seed XOR: XOR the entropy (matches COLDCARD's own test vectors) and refuse bad words, bad checksums and shares of another length with a visible error instead of a valid looking wrong result. Typed shares are no longer overwritten when the seed changes. - One Time Pad: refuse unknown words and damaged or mismatched keys; a decryption that fails the checksum shows nothing. Reading the pad no longer depends on host byte order. - Clear seed wipes every tool's input, derived keys and the BIP85 parent chain. Seed changes no longer leave the old account keys, Ypub/Zpub, BIP85 password or XOR result on screen. - BIP85: the Compact SeedQR is only shown for BIP39 children; for WIF, xprv and hex it encoded a different secret from the one displayed. - Ask before replacing a loaded seed (typing entropy, BIP85 Load Child, Learn's "Try another seed"). The entropy box is no longer filled with the BIP39 seed hex, and emptying it keeps other panels' input. - Passphrase tester escapes the pasted address before showing it. - PayNym avatars are only fetched from an explicit button. - Diceware rolls use rejection sampling instead of a biased modulo. - Foundation Shard: state that generated shares are not device-signed, so a Passport will not load them from a KeyCard. Release and build: - dist/index.html rebuilt, including the #76 fixes that the signed 2.3.0 artifact is missing. - Content-Security-Policy in the built page: no network access except the opt-in PayNym images and BIP-353 DNS-over-HTTPS lookups. - Silent Payments bundle built without the Node crypto polyfill and the unused wordlists: sp.js 3.05 MB to 0.73 MB, dist 13.1 MB to 10.8 MB. Checked against the previous bundle on 850 random cases, no differences. - README: correct signing key and fingerprint, and how to reproduce a release from its tag. - Commit package-lock.json, add .nvmrc, `npm run release:check`, and a CI workflow that runs the tests and checks dist matches the source. - Remove the unused @bcts/uniform-resources dependency, qrScanner.js, slip39.js and its build script, and zxcvbn.js.map. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the places where the Seed Tool could show a wrong seed as if it were right, or leave seed material on the page after the user thought it was gone. Also shrinks the bundle by 2.3 MB, adds a Content Security Policy, and adds CI. Version 2.3.1.
Wrong-but-valid output
Seed material left behind
Seed replaced without asking
Smaller fixes
os/keycard/src/implementation.rs), and the tool leaves all three at zero.window.onclickoverwriting the first, so clicking outside the info modal closes it again.Build and release
dist/index.htmlis rebuilt. The signed 2.3.0 artifact was built before FIX: pad raw entropy hex to preserve leading zero bits (#76) #77 and FIX: clearing stale entropy output discarded the user's own input (#76) #78 and doesn't contain their fixes.dev.htmlhas no policy, so hot reload keeps working.sp.jsgoes from 3.05 MB to 0.73 MB, anddist/index.htmlfrom 13.1 MB to 10.8 MB. No minification was added tobuild.js, so the page's own code stays readable.package-lock.jsonis committed, plus an.nvmrc,npm run release:check, and a CI workflow that runs the tests and fails ifdist/index.htmldoesn't match the source.@bcts/uniform-resourcesdependency,qrScanner.js,slip39.jsand its build script, andzxcvbn.js.map.Test plan
npm test: 3 suites.test/seed-safety.test.jsis new, with 19 tests: COLDCARD and BIP39 vectors for Seed XOR, OTP round trips and rejections, clearing, PayNym, diceware distribution and passphrase escaping. One test was added to the entropy suite. The shared vm harness moved totest/harness.js.sp.jschecked against the previous bundle on 850 random cases (addresses, decoding, sender outputs for p2wpkh, p2tr, p2pkh and p2sh-p2wpkh, tagged hashes): 0 differences.dist/index.html, exercised in a browser:npm run release:checkpasses. The build is deterministic.Before publishing
dist/index.htmland publish it as 2.3.1. It still needs to be signed with the release key; the olddist/signature.txtbelongs to 2.3.0 and isn't included.Cache-Controlon bitcoiner.guide. That's nginx config, and it would take this file from 10.8 MB to about 1.5 MB on the wire.🤖 Generated with Claude Code