New to Bitcoin? Start at 1.1
2.6Lesson 6 of 7
Can Bitcoin be hacked?
This lesson answers
- Can Bitcoin be hacked?
- Has Bitcoin ever been hacked?
- What is a 51% attack?
- Can someone guess my private key?
- How do people lose bitcoin to hackers?
Nobody has stolen bitcoin by breaking Bitcoin's rules or its cryptography. A few serious bugs have been found over the years and fixed. Almost every theft you read about happened around Bitcoin: at exchanges, on infected devices, or by tricking people into giving away their keys.
- Guesses per second, all miners
- …exahashes: billions of billions
- Difficulty
- …
To rewrite recent blocks, an attacker would need more computing power than all of this together, and the electricity to run it.
See it on satoshis.watch →What has gone wrong in Bitcoin itself
| When | What happened |
|---|---|
| August 2010 | An overflow bug let a transaction in block 74,638 create about 184 billion bitcoin. A fixed version was out within hours, the honest chain overtook the bad block the next day, and those coins are not in today's record. |
| March 2013 | A difference between two software versions split the chain for several hours. Miners and developers agreed to follow the older side, and it rejoined. |
| September 2018 | A bug that could have let a miner create extra coins was found and fixed before anyone used it. |
What a 51% attack can and can't do
Someone controlling most of the mining power could add blocks faster than everyone else. That would let them undo their own recent payments, called a double spend, or keep certain payments out of blocks. It would not let them take coins from other people's addresses, change the 21 million limit, or rewrite old history cheaply: nodes would still refuse any block that breaks the rules. The cost of the computing power above is what makes even the limited attack impractical.
Could someone guess your key?
A private key is a random number about 78 digits long. There are so many possible keys that guessing one with ordinary computers isn't possible in practice. The keys that have been cracked were not random: they were made from a phrase someone typed in, or by faulty software. Quantum computers are a separate question, covered in quantum computers and Bitcoin.
Where people actually lose bitcoin
- Exchange hacks. In 2016 about 120,000 bitcoin were stolen from an exchange called Bitfinex; US authorities seized most of it in 2022. Other exchanges have been hacked or have simply failed; see on an exchange or in your own wallet.
- Infected devices. Malware that swaps a copied address for the attacker's, or reads wallet files.
- Tricks. Fake apps, fake support staff and fake websites that ask for a seed phrase. See seed phrases and backups.
Check yourself
Practice, not a test. Think of your answer first, then reveal it.
1Could an attacker with most of the mining power take coins from your wallet?Reveal
No. They could try to undo their own recent payments or block some payments, but they can't sign for coins they don't hold the keys to.
2Most stolen bitcoin was taken how?Reveal
From exchanges, from infected devices, or from people tricked into revealing their keys or seed phrase, not by breaking Bitcoin itself.
3What happened with the 2010 overflow bug?Reveal
A bug let one transaction create about 184 billion bitcoin. A fix was released within hours and the block was replaced, so those coins are not in today's record.
Sources
- Bitcoin Core, CVE-2018-17144 full disclosure (2018).
- BIP 50: the March 2013 chain fork and how it was resolved.
- The 2010 overflow: Strange block 74638, bitcointalk.org, August 2010 (CVE-2010-5139).
- Exchange thefts: US Department of Justice, press release on the 2016 Bitfinex hack, February 2022.
- Hashrate and difficulty: read from a Bitcoin node.