What Is a 51% Attack
One of the most well known blockchain attacks is the 51% attack. In a 51% attack, a malicious actor is able to control more than 50% of the hashing power and temporarily control the network for their benefit. Due to the way that Proof of Work systems operate, an individual (or coalition) with 51% hashing power could disrupt the block creation process in a variety of ways including: excluding or reordering transactions, preventing transaction from being confirmed, or preventing other miners from mining. In this post, I'll explain how a 51% attack works, what it can do, what it can't do, and try to offer some simple ways of mitigating this risk.
Double Spending Problem
One of the most important concerns about a 51% attack is that the attackers can "double spend coins." The actual process for initiating the "double spending" is a bit complex, but basically the attackers will create a "fork" of the chain into a legitimate chain and their own, evil chain, which they keep secret. While the attackers hold 51% of the has power, they race to add as many blocks as possible to their own chain.
When the attackers win a block reward, they will spend the coins on the honest chain. After the "evil" chain is discovered, the attackers are hoping that they have managed to add enough blocks to their own evil chain that it becomes the "longest chain" and is therefore recognized as legitimate. Since the attackers spend their coins on the old, honest chain, the coins were not spent on their own "evil" chain. Since the "evil" chain is now the longest chain, it becomes the official chain and shows that the attackers still have the coins in their wallet even though they were already "spent" on the honest chain.
Why 51% Attacks Aren't That Common
Blockchain networks are designed to be secure, and although there have been instances of successful 51% attacks, they are relatively uncommon. Blockchains have several features that make 51% attacks difficult or simply not worth it.
1). Gathering enough hashing power for a successful 51% attack can be expensive. As this chart shows, it would cost $716,000 dollars to purchase enough hashing power to 51% attack the Bitcoin network for just one hour and attacking ETH would cost around $418,000.
Not only can purchasing the power be expensive, it can be outright impossible in some cases. As the chart shows, even a hash-renting site like nice-hash simply wouldn't have enough hashing power available to sell to the attackers to overtake a larger network.
2). The immense cost of attacking a network reduces the economic incentive to conduct an attack. The news of an attack could cause a drastic fall in the price of the coin, so although the attackers would have spent vast amount of money to purchase hashing power or mining equipment for the attack, the value of the coins that they mined would likely be far below the price before the attack.
3). Attacking a large chain requires collaboration. As this chart shows, no single pool controls 50% of the BTC hashing power, in fact, not even any two pools combined create more than 50% of the hashing power. Attacking BTC would require lots of collaboration between attackers.
Discussion
The threat of a 51% attack can cause economic loss as well as loss of confidence in a blockchain. Thankfully, there are a variety of economic incentives that prevent such an attack, and most miners are incentivized to operate according to the rules out of self-interest. That being said, the possibility of 51% attacks is real and I understand that the thought of an attack can be concerning especially for a beginner. Although it is important to consider risks, it is also important to put those risks in perspective.
1). The first thing to know is that 51% attacks are not all powerful. Although a 51% attack can interfere with generating new blocks and prevent transactions from confirming, a 51% attack does not allow the attackers to change the underlying rules of the blockchain, generate coins from nothing, or steal funds directly from your account. Although it is possible, it would be extremely difficult to reverse past blocks; the older a transaction is, the more secure it is. This is one reason why many crypto platforms require a certain number of confirmations before they will credit the crypto to your account.
2). Well-established networks are more resistant to 51% attacks than smaller networks. As discussed in the first chart, it would cost several hundred thousand dollars to rent (if it was even possible) enough hash power to 51% attack Bitcoin for an hour, but it would take a mere $1 to 51% attack DeepOnion and $47 to 51% attack Verge. Simple economics means that smaller chains with lower hashing power are more susceptible to attack than larger chains.
Note - this is why Polkadot's ability to provide "pooled security" to small, newly-developed chains is such a huge deal.
3). The risk of a 51% attack on a well established network is far less than the risk of loosing your coins due to "operator error." Exchanges have been hacked before, and people fall for Bitcoin schemes all the time. However, the Bitcoin blockchain itself has never been hacked. You are much more likely to loose funds by riding your motorcycle in the rain and destroying your cell phone without backing up your seed phrase.
Summary
As with everything, there are inherent risks in crypto. However, I think understanding these risks and putting them in perspective is the key to making informed decisions. Although 51% attacks are a real threat, operating with well established blockchains, keeping your crypto in a secure wallet, and requiring a certain number of confirmations when receiving crypto are simple steps that dramatically reduce the risk of a 51% attack
Just remember that this is not financial advice, and you should always do your own research.
Thanks for reading!
References
https://www.youtube.com/watch?v=BuTj9raHQOU
https://blockpublisher.com/51-attack-on-ethereum-classic-has-been-successful-according-to-bitfly/
https://www.crypto51.app/
https://www.blockchain.com/pools
https://www.investopedia.com/terms/1/51-attack.asp
Image Credits