What is a 51% attack and how to detect it?

Despite the inordinate amount of resources needed to engineer them, small-cap cryptocurrencies are still susceptible to a 51% attacks.

Despite being underpinned by blockchain technology that promises security, immutability, and complete transparency, many cryptocurrencies like Bitcoin SV (BSV), Litecoin (LTC) and Ethereum Classic (ETC) have been subject to 51% attacks several times in the past. While there are many mechanisms by which malicious entities can and have exploited blockchains, a 51% attack, or a majority attack as it is also called, occurs when a group of miners or an entity controls more than 50% of the blockchain’s hashing power and then assumes control over it. 

Arguably the most expensive and tedious method to compromise a blockchain, 51% of attacks have been largely successful with smaller networks that require lower hashing power to overcome the majority of nodes.

Understanding a 51% attack 

Before delving into the technique involved in a 51% attack, it is important to understand how blockchains record transactions, validate them and the different controls embedded in their architecture to prevent any alteration. Employing cryptographic techniques to connect subsequent blocks, which themselves are records of transactions that have taken place on the network, a blockchain adopts one of two types of consensus mechanisms to validate every transaction through its network of nodes and record them permanently.

While nodes in a proof-of-work (PoW) blockchain need to solve complex mathematical puzzles in order to verify transactions and add them to the blockchain, a proof-of-stake (PoS) blockchain requires nodes to stake a certain amount of the native token to earn validator status. Either way, a 51% attack can be orchestrated by controlling the network’s mining hash rate or by commanding more than 50% of the staked tokens in the blockchain.

PoW vs PoS

To understand how a 51% attack works, imagine if more than 50% of all the nodes that perform these validating functions conspire together to introduce a different version of the blockchain or execute a denial-of-service (DOS) attack. The latter is a type of 51% attack in which the remaining nodes are prevented from performing their functions while the attacking nodes go about adding new transactions to the blockchain or erasing old ones. In either case, the attackers could potentially reverse transactions and even double-spend the native crypto token, which is akin to creating counterfeit currency.

Diagrammatic representation of a 51% attack

Needless to say, such a 51% attack can compromise the entire network and indirectly cause great losses for investors who hold the native token. Even though creating an altered version of the original blockchain requires a phenomenally large amount of computing power or staked cryptocurrency in the case of large blockchains like Bitcoin or Ethereum, it isn’t as far-fetched for smaller blockchains. 

Even a DOS attack is capable of paralyzing the blockchain’s functioning and can negatively impact the underlying cryptocurrency’s price. However, it is improbable that older transactions beyond a certain cut-off can be reversed and thus puts only the most recent or future transactions made on the network at risk.

Is a 51% attack on Bitcoin possible?

For a PoW blockchain, the probability of a 51% attack decreases as the hashing power or the computational power utilized per second for mining increases. In the case of the Bitcoin (BTC) network, perpetrators would need to control more than half of the Bitcoin hash rate that currently stands at ~290 exahashes/s hashing power, requiring them to gain access to at least a 1.3 million of the most powerful application-specific integrated circuit (ASIC) miners like Bitmain’s Antminer S19 Pro that retails for around $3,700 each. 

This would entail that attackers need to purchase mining equipment totaling around $10 billion just to stand a chance to execute a 51% attack on the Bitcoin network. Then there are other aspects like electricity costs and the fact that they would not be entitled to any of the mining rewards applicable for honest nodes. 

However, for smaller blockchains like Bitcoin SV, the scenario is quite different, as the network’s hash rate stands at around 590PH/s, making the Bitcoin network almost 500 times more powerful than Bitcoin SV.

 In the case of a PoS blockchain like Ethereum, though, malicious entities would need to have more than half of the total Ether (ETH) tokens that are locked up in staking contracts on the network. This would require billions of dollars only in terms of purchasing the requisite computing power to even have some semblance of launching a successful 51% attack. 

Moreover, in the scenario that the attack fails, all of the staked tokens could be confiscated or locked, dealing a hefty financial blow to the entities involved in the purported attack.

How to detect and prevent a 51% attack on a blockchain?

The first check for any blockchain would be to ensure that no single entity, group of miners or even a mining pool controls more than 50% of the network’s mining hashrate or the total number of staked tokens. 

This requires blockchains to keep a constant check on the entities involved in the mining or staking process and take remedial action in case of a breach. Unfortunately, the Bitcoin Gold (BTG) blockchain couldn’t anticipate or prevent this from happening in May 2018, with a similar attack repeating in January 2020 that lead to nearly $70,000 worth of BTG being double-spent by an unknown actor. 

In all these instances, the 51% attack was made possible by a single network attacker gaining control over more than 50% of the hashing power and then proceeding to conduct deep reorganizations of the original blockchain that reversed completed transactions.

The repeated attacks on Bitcoin Gold do point out the importance of relying on ASIC miners instead of cheaper GPU-based mining. Since Bitcoin Gold uses the Zhash algorithm that makes mining possible even on consumer graphics cards, attackers can afford to launch a 51% attack on its network without needing to invest heavily in the more expensive ASIC miners. 

This 51% attack example does highlight the superior security controls offered by ASIC miners as they need a higher quantum of investment to procure them and are built specifically for a particular blockchain, making them useless for mining or attacking other blockchains.

However, in the event that miners of cryptocurrencies like BTC shift to smaller altcoins, even a small number of them could potentially control more than 50% of the altcoin’s smaller network hashrate. 

Moreover, with service providers such as NiceHash allowing people to rent hashing power for speculative crypto mining, the costs of launching a 51% attack can be drastically reduced. This has drawn attention to the need for real-time monitoring of chain reorganizations on blockchains to highlight an ongoing 51% attack. 

MIT Media Lab’s Digital Currency Initiative (DCI) is one such initiative that has built a system to actively monitor a number of PoW blockchains and their cryptocurrencies, reporting any suspicious transactions that may have double-spent the native token during a 51% attack.

Cryptocurrencies such as Hanacoin (HANA), Vertcoin (VTC), Verge (XVG), Expanse (EXP), and Litecoin are just a few examples of blockchain platforms that faced a 51% attack as reported by the DCI initiative. 

Of them, the Litecoin attack in July 2019 is a classic example of a 51% attack on a proof-of-stake blockchain, even though the attackers did not mine any new blocks and double-spent LTC tokens that were worth less than $5,000 at the time of the attack. 

This does highlight the lower risks of 51% attacks on PoS blockchains, deeming them less attractive to network attackers, and is one of the many reasons for an increasing number of networks switching over to the PoS consensus mechanism.

Leave a Reply

Your email address will not be published. Required fields are marked *