2 min to read.
51% Attack
An attack in which one party controls most of a blockchain's mining or staking power and can rewrite recent transactions.
What is a 51% Attack?
A 51% attack is an attack on a blockchain in which one party, or a coordinated group, controls more than half of the network's mining power (in proof of work) or staked coins (in proof of stake). With that majority the attacker can outpace honest participants and rewrite recent transaction history.
How it works
In a proof-of-work network, nodes follow the valid chain with the most accumulated work. An attacker with most of the hashrate can secretly mine an alternative chain faster than everyone else combined. When that longer chain is published, nodes switch to it and the blocks it replaces are discarded. The attacker can use this to spend coins, wait until the payment is accepted, and then erase it from history, which is a double spend. The attacker can also refuse to include other people's transactions.
What an attacker cannot do
A majority attacker cannot create coins beyond what the protocol allows, cannot spend coins from addresses whose private keys they do not hold, and cannot cheaply change old history, because each extra block that has to be replaced adds cost. Rules checked by every full node stay in force.
Example
A merchant accepts a payment after one confirmation and ships the goods. The attacker then releases a longer private chain in which the same coins went back to the attacker's own wallet. The merchant's payment vanishes from the ledger.
Why it matters
The cost of gaining a majority is a core measure of a blockchain's security. Networks with a very large hashrate or stake are expensive to attack. Small networks, especially ones that share a mining algorithm with a bigger chain, have been attacked this way. This is why exchanges and merchants wait for several confirmations before treating a payment as final.
Common misunderstanding
"51%" is shorthand. An attacker with somewhat less than half of the power can still succeed some of the time, and holding a majority does not give control over other users' funds.