Brute Force Bitcoin

Blog

What Actually Breaks Bitcoin Wallets

Coins do get stolen. Never by guessing a random key. Here is what goes wrong instead, and what it means for anyone holding bitcoin.

The board will show zero funded matches for as long as it exists. That does not mean bitcoin is never stolen. It means it is never stolen this way. When keys are lost to someone else, it is because the key was not as random as everyone thought, or because a person handed it over.

Keys that were not random

A key is only as good as the random numbers behind it. In August 2013, Bitcoin developers warned that a flaw in Android's random number generator had left wallet apps on that platform exposed. Signatures made on affected phones could reuse a value that is supposed to be used once, and anyone who spots that reuse can work out the private key from public information. Coins were taken, and wallet apps rushed out fixes.

Reusing that one-time value is fatal however good the key itself is. It has caught out software more than once, which is why serious wallets now derive it carefully instead of trusting a random number generator to behave.

Keys that a person chose

A "brain wallet" turns a phrase into a key by hashing it, so you can keep your key in your head. The trouble is that people choose phrases other people also choose: song lyrics, quotes, famous passwords. Attackers hash huge lists of them in advance and watch the resulting addresses. Researchers who looked into this, in a well-known talk at DEF CON in 2015, found brain wallets being emptied within seconds of being funded.

That is the board's lesson in reverse. Guessing works fine when the space is small. Two to the power of 256 is not small. A phrase you thought of is.

Keys that were meant to be found

Since 2015 a long-running public puzzle has kept a row of addresses funded whose keys are deliberately small: the key for puzzle number n sits below 2n. The early ones fell almost immediately, and each later one takes vastly more computing than the last. Puzzle number one is the key 1, the address you will meet in A Private Key Is Just A Number. The puzzle is the best demonstration there is of how fast the work grows: every extra bit of key doubles it.

Keys that were handed over

Most losses are not cryptography at all. Malware that reads a wallet file, a fake support agent asking for a seed phrase, a phishing site that looks like a wallet, a photo of a recovery sheet in someone's cloud storage, an exchange that gets hacked. In every case the key was copied, not guessed.

What this means for you

  • Let well-established wallet software make your keys. Never make one up.
  • Never type a seed phrase or private key into a website, including one that says it is checking it for you. This site never asks for one, and never will.
  • Keep the recovery phrase offline, and assume anyone who asks for it is trying to take your coins.

Get those right and the only way left in is the one on the board. You have seen how that goes.

Next: A Private Key Is Just A Number