The 51% attack against Bitcoin (and why you've gotten it wrong)

in LeoFinancelast year


You have probably heard about the 51% attack on proof-of-work chains, like Bitcoin. Here I'm going to explain the attack vector from miners on the bitcoin network, and why most people way overestimate the magnitude of it.


Bitcoin is a network of nodes (computers) which run the bitcoin open source software which simply put, could be thought as a distributed ledger. These nodes as a whole control the rules of the network according to which miners add transactions. Miners cannot change the rules that the nodes enforce. If a 51% attacker tries to change the rules, they will find their mined blocks being rejected by the nodes. This means that they also can't create fraudulent transactions aka. steal money.

The only shenanigan a miner can pull off is...

The double spend attack

The "true state" of the blockchain is decided by the nodes to be the chain that is the longest. Miner with 51% of hash rate or more could force a reorganization of the blockchain by mining a longer chain. In practice what they could do with this, is retract a transaction.

Note: technically the longest chain isn't decided based on the amount of blocks, but on the amount of total work, thus, might make sense to call it the "heaviest" chain.

Attack by a (profit oriented) miner

There are two types of entities I can think of that would perform a double spend attack: a profit oriented miner and a government trying to destroy the trust of people to an alternate monetary network.

Let's go through the miner scenario first.

How to perform a double spend attack:

  1. Send Bitcoin to an exchange
  2. Trade it for fiat or other cryptocurrency and withdraw it
  3. Reorganize the Bitcoin chain to a version where the Bitcoin transaction to the exchange never happened
  4. Send the original Bitcoin to another exchange and sell it there

However, most exchanges as a security measure won't let you withdraw your money until at least few block confirmations. Because the further history you go, the harder and costly it'll be to reorganize the chain, thus less likely to happen. Remember, you have to use electricity to build the "stealth chain". Also, an exchange could increase the block confirmation time even more should they observe sudden major drop in hashpower which would indicate a potential double spend attack.

So as a miner you'd have to take a lot of risk by building your own "stealth chain" the block mining rewards of which you get only if you manage to reorganize the chain. Also, you'd have to clean the money you acquired fraudulently.

Furthermore, it makes little sense for a miner to do something that would question the value proposition of the thing it mines.

Also, another major disincentive for a profit oriented entity to perform a double spend attack is

Coinbase transaction maturity period

Coinbase transaction is the first transaction in a block which is the reward that a miner gets, and it can be spent only after 100 blocks. So, in the case of a miner that would reorganize a chain, let's say 6 blocks deep, if the miner had found one block or more during those 6, they would never be able to get or spend those rewards.

All miners have incentive to continue to build on the heaviest chain to get access to their mining rewards, and makes malicious reorganizing uneconomical.

Government attack

Should government make a double spend attack, they would not care about making profit. However, they would have to buy most of the ASICs from existing miners because there's not enough fresh miners to buy, which would get costly when adding the electricity. Furthermore, an operation of such magnitude would not go unnoticed, and honest miners would prepare for it.

At this point it might not be even possible for a single government to pull it off due to the massive size of processing power which keeps growing. And it is even more unlikely for several jurisdictions to co-operate on such a scale.

At the end of the day, it would just be an innumerably costly denial of service attack. Remember, forced miner reorganization can only retract transactions, not create them without the appropriate keys.

There are easier ways for government to create fear, uncertainty and doubt by just spilling nonsense in the media.

Mining Pools

Mining pools regularly come up as source of an attack for Bitcoin. The thing is, none of the pools have custody over the hashing power of individual miners. They can point their hashing power to another pool in a second. And while a pool with more than 50% hashing power could attempt a double spend attack, it would make no sense, because the pools are profit seeking businesses in themselves. If they would make such an attempt, miners would immediately shift their hashing power to another pool because they want their rewards and the malicious pool would die. Same thing happens if more than one pool would co-operate.


In the end, the attack vector from miners is only a retraction of transactions which – instead of breaking the protocol – would in practice create a minor nuisance which at worst would lead to a loss for a business. This would not go unnoticed and the entity would be taken a legal stance against for having acquired something without a pay.

And for a malicious government to pull a dos attack, it could create some fear, but they never did it even when Bitcoin was in its infancy, and at this point it might be flat out impossible due to continuously growing processing power. And even if they pulled it off, they would just deplete their resources at a loss and eventually die off.

This is the theoretical worst-case-scenario that can happen to Bitcoin without involving nuking of the whole internet down. Miners pose no existential risk to Bitcoin.

There is a reason for using proof-of-work, because it solves the double spend problem with introducing real economical consequence to trying change history and aligning the incentives for building on top of the same chain by having the coinbase transaction maturity period.


Congratulations @celestal! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You distributed more than 29000 upvotes.
Your next target is to reach 30000 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

Hive Power Up Day - May 1st 2023
The Hive Gamification Proposal
Support the HiveBuzz project. Vote for our proposal!

Yo man, what's new with you, where are you?

How's the Spa business going?

Massage is only part time on the side now with paid work. Massage was too uncertain and stressfull, not enough clients.