Randomness: why it decides who owns your keys, and why a clock makes a terrible dice
A private key is just a number, and it's only yours if nobody else can guess it. When wallets drew that number from weak randomness, thieves recomputed the keys and took the coins: on Android phones in 2013 and with the bx seed command in 2023.
Anna makes her new key at the kitchen table. She rolls a die fifty times and writes down every number. Nobody saw the rolls. Nobody could have predicted them. Not even Anna.
Two doors down, a neighbour lets a machine pick his key. The machine doesn't roll anything. It looks at the clock and starts from the time. A patient thief doesn't need to break the lock. He only needs to try every second on the clock.
That's the whole article in one picture. A private key is just a number. Whoever can guess the number owns the coins, and how guessable it is depends entirely on how it was picked.
What it is
Randomness, in a wallet, is the raw material for your keys. The wallet draws random bits, called entropy, and turns them into a seed phrase and keys. Our article on why seed phrases have 12 or 24 words explains the 128 and 256 bits.
The maths of keys and signatures assumes those bits were unpredictable. If they weren't, the strongest curve in the world protects nothing. The thief doesn't attack the curve. He attacks the dice.
How it works
Take the two kitchen tables.
- Anna's dice. One roll of a fair die gives about 2.58 bits of randomness. Fifty rolls give about 129 bits, just over the 128 a 12-word phrase needs. The number of possible results is a number with 39 digits. Guessing it is not a plan, it's a lifetime hobby for the whole planet.
- The clock. Now start from the clock, counted in seconds, stored in 32 bits. That gives 4,294,967,296 possible starting points. It sounds like a lot. It's 136 years of seconds, and a computer can try them all.
The second table is not made up. In August 2023 a group of researchers published the Milk Sad disclosure about Libbitcoin Explorer, a command-line tool called bx. Its "bx seed" command used "a bad PRNG algorithm, seeded with only 32 bit of system time" to make wallet secrets (Milk Sad). Anyone could recompute the result "after a maximum of about 4.29 billion attempts", which the researchers put at "a few days of computation on the average gaming PC, at most".
Thieves did. The researchers trace the main theft to 12 July 2023, estimate that "over $900,000 USD worth of cryptocurrency assets were moved", and list confirmed thefts in bitcoin, ether and six other coins. The name comes from the first two words of the seed phrase bx produced at time zero: "milk sad". The official record, CVE-2023-39910, says the tool's "use of an mt19937 Mersenne Twister PRNG restricts the internal entropy to 32 bits regardless of settings", notes the vendor disputes it, and adds that it "was exploited in the wild in June and July 2023" (CVE-2023-39910).
Randomness also signs
Keys aren't the only place that needs dice. Bitcoin's original signature scheme, ECDSA, needs a fresh secret random number for every signature. Use the same one twice, and the private key can be worked out from the two signatures.
That's what happened on Android in 2013. On 11 August 2013, Bitcoin.org warned that a component of Android responsible for secure random numbers "contains critical weaknesses" and that every wallet generated on Android up to that point was at risk (Bitcoin.org). The same day, Bitcoin developer Mike Hearn wrote that "some signatures have been observed to have colliding R values, allowing the private key to be solved" (Hearn, 2013). Wallet apps released updates that moved coins to new keys.
The cure for that particular hole was published the same month: RFC 6979 derives the signature number from the key and the message, so signers "do not need access to a source of high-quality randomness" (RFC 6979). The key itself still has to come from good dice.
Why it matters
- You can't see bad randomness. A key from a clock looks exactly like a key from a die. Both are long strings of gibberish.
- The loss is silent and total. No password was stolen and no device was touched. The thief computed the key at home.
- One bug, thousands of victims. When a tool's randomness is weak, everyone who used it shares the same small pool of keys. A thief sweeps them all at once.
Where people get it wrong
- "Long key, so it's safe." Length shows how much room there is, not how much was used. bx produced normal-looking seed phrases from only 32 bits.
- "I'll pick my own words, I'm creative." People are worse dice than machines. Hand-picked words are far easier to guess.
- "Random means the website's generate button." A web page that shows you a key has seen your key.
- "Weak randomness only hits careless people." The Android users did nothing wrong. Their phones did.
Ask where your dice came from
Look at your own wallet and answer one question: where did the randomness come from? A hardware wallet or a well-known wallet app making the phrase on your own device is the normal answer. A website, a hand-picked phrase, a developer tool or a "brain wallet" from your favourite song lyrics is a reason to move the coins to a fresh wallet made properly.
The thieves in the Milk Sad case never touched a single wallet. They only read the clock. Turns out time really is money.
Frequently asked questions
Why does randomness matter for crypto wallets?
A private key is a number, and the coins belong to whoever knows it. If the number was picked from weak randomness, an attacker can recompute the same small set of possible keys and take the coins. Strong cryptography can't fix a guessable starting number.
What was the Milk Sad vulnerability?
It was a flaw in the "bx seed" command of Libbitcoin Explorer, disclosed in August 2023 and recorded as CVE-2023-39910. The command used a Mersenne Twister generator seeded with 32 bits of system time, so every possible wallet could be recomputed in about 4.29 billion attempts. Thieves exploited it in June and July 2023.
What happened with Android bitcoin wallets in 2013?
On 11 August 2013, Bitcoin.org warned that Android's secure random number component had critical weaknesses. Some signatures reused the same random value, which let attackers solve for the private key. Wallet apps released updates that moved funds to new keys.
How many dice rolls make a secure key?
One roll of a six-sided die gives about 2.58 bits of randomness. About 50 rolls give 129 bits, a little more than the 128 bits behind a 12-word seed phrase. The rolls must be real and private, and the wallet must turn them into words correctly.
Can I check whether my seed phrase was made with weak randomness?
Not by looking at it: weak and strong phrases look the same. What you can check is where it was made. If it came from a website, a tool not built for wallets, or words you picked yourself, move the coins to a wallet that generated a new phrase on your own device.
Sources
- Bitcoin.org, Android security vulnerability (11 August 2013)
- Mike Hearn, Android key rotation, Bitcoin development mailing list (11 August 2013)
- Milk Sad team, Milk Sad disclosure (8 August 2023)
- OSV, CVE-2023-39910 (published 9 August 2023)
- IETF, RFC 6979, Deterministic usage of DSA and ECDSA (T. Pornin, August 2013)

