If you are interested in blockchain and cryptocurrency, you may have heard of the term "51% attack". But what does it mean and how does it affect the security and integrity of a decentralized network? In this article, we will explain the concept of a 51% attack, its potential consequences, and how different blockchains try to prevent it.
What is a 51% Attack?
A 51% attack is a potential attack on a blockchain network, where a single entity or organization is able to control the majority of the hash rate, potentially causing network disruption. In such a scenario, the attacker would have enough mining power to intentionally exclude or modify the ordering of transactions. They could also reverse transactions during their control - leading to double-spending problems.
A successful majority attack would also allow the attacker to prevent some or all transactions from being confirmed (transaction denial of service) or prevent some or all other miners from mining, resulting in what is called a mining monopoly. On the other hand, a majority attack does not allow the attacker to reverse transactions from other users, or create transactions and push them to the network. Changing the block reward, creating tokens out of thin air, or stealing tokens that do not belong to the attacker are also considered impossible.
How Likely is a 51% Attack to Happen?
One of the main advantages of blockchain and its underlying technologies is the decentralized nature of building and validating data. Nodes work in a decentralized way to ensure compliance with the protocol rules and that all network participants agree on the current state of the blockchain. This means that most nodes need to regularly reach consensus on the mining process, the software version used, the validity of transactions, and so on.
The Bitcoin consensus algorithm (Proof of Work) ensures that only when network nodes agree that the block hash provided by the miner is accurate (i.e., the block hash proves that the miner did enough work and found a valid solution to the block problem), the miner can validate a new block of transactions. The blockchain infrastructure - as a decentralized ledger and distributed system - prevents any centralized entity from exploiting the network for its own purposes, which is why there is no single authority on the Bitcoin network.
The mining process (in PoW-based systems) involves investing a lot of electricity and computational resources, and the performance of the miners depends on the size of the computational power they have, which is usually called hash rate or hash power. There are many mining nodes in different locations, competing to be the next one to find a valid block hash and receive newly generated bitcoins as a reward. In this case, the mining power is distributed among different nodes around the world, which means that the hash rate is not controlled by a single entity. Or at least it should not be.
But what happens when the hash rate distribution is not good enough? For example, what if an entity or organization is able to obtain more than 50% of the hash power? One possible outcome is what we call a 51% attack, also known as a majority attack.
How to Prevent a 51% Attack?
Because blockchains are maintained by distributed network nodes, all participants cooperate in the process of reaching consensus. This is one of the reasons why they tend to be highly secure. The larger the network, the stronger the protection against attacks and data corruption.
When it comes to Proof of Work blockchains, the more hash rate the miners have, the greater the chance of finding the next block's valid solution and getting the reward. This is true because mining requires countless hash attempts, and the higher the computational power, the more attempts per second.
Some early miners joined the Bitcoin network, contributing to its growth and security. As the price of bitcoin as a currency increased, countless new miners entered the system, aiming to compete for the block reward (currently set at 12.5 BTC per block). Such fierce competition is one of the reasons for Bitcoin's security. If it were not for acting honestly and striving to obtain the block reward, the miners would have no incentive to invest large amounts of resources.
Therefore, due to the size of the network, a 51% attack on Bitcoin is unlikely. Once the blockchain grows large enough, the likelihood of a person or group gaining enough computational power to overwhelm all other participants drops rapidly to very low levels. In addition, as the chain grows, it becomes more and more difficult to change previously confirmed blocks, as the blocks are linked together by cryptographic proofs. For the same reason, the more confirmations a block has, the higher the cost of changing and restoring the transactions in it. Therefore, a successful attack may only be able to modify the transactions of the last few blocks in a short period of time.
Furthermore, imagine such a scenario: a malicious entity, not driven by profit, decides to attack the Bitcoin network at any cost, just to destroy it. Even if the attacker managed to disrupt the network, the Bitcoin software and protocol would quickly modify and adjust to cope with the attack. This would require other network nodes to reach consensus on these changes, but in an emergency, this could happen quickly. Bitcoin has a strong resilience to these types of attacks and is considered the most secure and reliable cryptocurrency in existence.
While it is difficult for an attacker to obtain more computational power than the rest of the Bitcoin network, it is not difficult to do so on smaller cryptocurrencies. Compared to Bitcoin, alternative tokens have relatively lower hash power to protect their blockchains. Low enough to make a 51% attack a real possibility. Some of the notable cryptocurrencies that have fallen victim to a majority attack include Monacoin, Bitcoin Gold, and ZenCash.