A "brainwallet" turns a phrase into a key
The seductive idea: memorize a passphrase, and never store a key anywhere. The wallet just hashes your phrase into the private key:
No file, no paper, nothing to steal — it's "in your brain." The problem: an attacker can run the exact same hash on every phrase they can think of, and they can think of billions.
Entropy is the whole game
"Entropy" = how many equally-likely possibilities there are. A real random key has 256 bits → 2²⁵⁶ options. A human phrase has far fewer:
| Secret | Rough entropy | Time to exhaust* |
|---|---|---|
| Random 256-bit key | 256 bits | longer than the universe |
| 12-word BIP39 seed | 128 bits | infeasible |
| Random 12-char password | ~72 bits | centuries+ |
| A memorable sentence / quote | ~30–50 bits | hours to days |
| A famous phrase / single word | < 30 bits | seconds |
*order-of-magnitude, for intuition. Attackers don't guess randomly — they start with leaked password lists, quotes, song lyrics and dictionaries, so "clever" phrases fall first.
Proof you can run yourself (on a key we make here)
A victim picks the famous xkcd phrase. A tiny attacker dictionary finds it almost immediately — no curve broken, just a guessed password:
# secp256k1 order n, pubkey->address helpers omitted for brevity import hashlib def key_from_phrase(p): return int.from_bytes(hashlib.sha256(p.encode()).digest(),"big") % n victim = "correct horse battery staple" # a "memorable" brainwallet victim_addr = priv_to_address(key_from_phrase(victim)) dictionary = ["password","bitcoin","hunter2","letmein", "correct horse battery staple","satoshi nakamoto"] for i,guess in enumerate(dictionary,1): if priv_to_address(key_from_phrase(guess)) == victim_addr: print(f"FOUND after {i} guesses: {guess!r}"); break # → FOUND after 5 guesses: 'correct horse battery staple'
This isn't hypothetical
Public "brainwallet draining" has been documented for years: researchers and attackers precompute the address for millions of common phrases, watch the blockchain, and sweep any that ever receive coins — often within seconds of a deposit. Quotes, Bible verses, song lyrics, "`bitcoin`", a single word — all emptied. The lesson is brutal and simple: if a human can remember it, a machine can guess it.
The fix
Don't derive keys from phrases you invent. Let a real random source do it:
• Use a wallet that generates a BIP39 seed from a hardware random number generator (128–256 bits of true entropy — unguessable).
• A hardware wallet, or any reputable wallet's "create new wallet", does this correctly.
• If you want something memorable, use a long diceware passphrase (6+ random words from a physical dice roll) — that's real entropy, not a phrase you chose because it felt clever.