On Entropy

Probability, Randomness, and the Safety of a Bitcoin Key
Imagined by Brian Hirschfield
Magic Internet Math Academy · 2026
Web Edition — Run Every Calculation Yourself
⤓ Download the PDF Edition
12 chapters 5 parts 3 appendices
Front Matter
PPrologue: The Weakest Link
A 256-bit key is unguessable — if it is actually random. The method and the road.
Part I — Chance
1Counting
Outcomes, arrangements, and the multiplication principle — including the twelve-word question.
2Probability
From counting to chances: independence, complements, and reading “1 in 2ⁿ” honestly.
3Expectation and the Long Run
Expected value and the law of large numbers — why a small chance per guess demands many guesses.
Part II — Entropy
4Information as Surprise
Bits as answers to yes-or-no questions; Shannon entropy built from counting.
5The Attacker's Metric
Min-entropy and guessing: the measure that matters when one guess steals everything.
6Where Randomness Comes From
Physical noise, OS entropy pools, PRNG vs CSPRNG, and dice.
Part III — The Key
7A 256-Bit Number
What a Bitcoin private key is, and the size of the space it hides in.
8Guessing Games at Scale
Brute-force physics and keyspace arithmetic — what an attack would actually cost.
Part IV — When Randomness Fails
9Low-Entropy Keys in the Wild
Brainwallet drains, KeyBleed, and mempool fee races over weak keys.
10The Nonce Catastrophe
One leaked nonce loses the key — and the deterministic fix.
Part V — Protecting the Key
11Seed Phrases
BIP 39: entropy to checksum to words — and why you never rearrange them.
12The Operational Checklist
Generate offline, hardware wallets, passphrases, backups: the practice.
Appendices & Reference
ANotation, Brick by Brick
Every symbol used in this book, built before it is used.
BTables: Powers of Two and Probability
Reference tables for counting, chance, and keyspace sizes.
CSpecimens and References
The real-world failures and sources behind the chapters.
Interactive Demos — Linkable & Shareable
⚡The Counting Playground
Choices multiply, live: stages, the doubling ladder, arrangements and choices in exact arithmetic. (Ch. 1)
⚡Two Measures of Surprise
Drag the chances and watch Shannon's average and the attacker's best guess move — the gap is the thief's discount. (Ch. 4 & 5)
⚡Roll Your Own Key
Coins, dice, and the 2048-word list: count the bits as you roll, and assemble a real draw in your browser. (Ch. 6)
⚡The Invoice
Price a brute-force search: rate, space, targets — and read the answer in universe-lifetimes. (Ch. 8)
⚡The Nonce Catastrophe, Step by Step
Two signatures, one reused nonce: walk the attacker's algebra and recover the key yourself. (Ch. 10)