An offline fairness test for dice used to generate Bitcoin seeds. Built for 16-sided
binary dice (faces 0000–1111), and also works for 2, 4, 6, 8, 10, 12 and 20-sided dice.
Record your test rolls by tapping faces (or typing hex digits), and the page runs a chi-square goodness-of-fit test, a per-bit balance test, and flags faces that show up far more or less often than expected. Runs can be saved in your browser and exported as CSV or JSON.
Test rolls only. Never enter the rolls you'll use for a real seed, here or in any other tool.
- Online / install as an app: open https://dice.cypherhive.com, then on iPhone tap Share → Add to Home Screen, or on Android / desktop Chrome / Edge choose Install app. After the first visit it works with no connection.
- Fully offline: download
dice-entropy-check.htmlfrom the latest release and open it in any browser. It's a single self-contained file.
-
Read it. All of the logic is in
index.html(identical to the release'sdice-entropy-check.html): plain HTML, CSS and JavaScript with no dependencies, no build step, and no external resources.sw.jsis a ~50-line service worker that only caches this app's own files for offline use. -
Network access is blocked. The page's Content-Security-Policy starts with
default-src 'none', so the browser refuses fetch, XHR, WebSocket, beacons, fonts and form posts. The only same-site files it may load are its own icon, manifest andsw.js. Confirm the code never assigns tolocationor callswindow.open. -
Test it offline. Turn on airplane mode and open it. Everything works.
-
Check the hash against
SHA256SUMSand the author's signed Nostr announcement:shasum -a 256 --ignore-missing -c SHA256SUMS # macOS / Linux certutil -hashfile dice-entropy-check.html SHA256 # Windows
-
Check the math. Export your rolls as CSV and re-run the test elsewhere, e.g.
scipy.stats.chisquare(counts)in Python. The p-values match SciPy to machine precision.
Each release's hash is also published in a Nostr note signed by the author's key, so a copy of this repo or website that's been tampered with can be caught even if GitHub or the domain were compromised.
v1.0.0 — signed note on Nostr
1c4942b43136a238b161c8216ae1ea7aae0faea7c6c061ba9eba800166f6f78c dice-entropy-check.html
How to check it:
- Hash your copy of the file (commands above) and confirm it matches the hash in the note.
- Open the note in any Nostr client. Clients verify the note's Schnorr signature automatically, so the text
can't have been altered since it was signed. To check it yourself, fetch the raw event JSON and verify
its signature with a command-line Nostr tool such as
nak. - Confirm the note's author is the real @ChuckinBitcoin key: it's the same npub that posts as @ChuckinBitcoin on Nostr and is linked from the author's other profiles. Watch out for look-alike accounts.
A matching signature shows the file is the one the author published. It does not by itself prove the code is safe; that's what reading it (step 1 above) is for.
| File | Purpose |
|---|---|
index.html |
The whole app |
sw.js |
Offline cache for the installable version |
manifest.webmanifest |
App name and icons for installing |
icons/ |
App icons |
SHA256SUMS |
Hashes of every file |
CNAME |
Custom domain for GitHub Pages |
Upload the folder to any static web host (it can live in a subfolder such as /dice/).
HTTPS is required for the install-as-app feature; the page itself works anywhere.
When you change any file, bump VERSION in sw.js so installed copies pick up the update,
then regenerate the hashes:
cp index.html dice-entropy-check.html
shasum -a 256 index.html dice-entropy-check.html sw.js manifest.webmanifest icons/* > SHA256SUMS
rm dice-entropy-check.htmlBuilt by @ChuckinBitcoin (Nostr & X). Statistics based on the original chi-square fair-die spreadsheet by @ineedanewgame.
MIT. See LICENSE.