51% Attack

Published on :

21 Aug, 2024

Blog Author :

N/A

Edited by :

N/A

Reviewed by :

Dheeraj Vaidya

What Is A 51% Attack?

A 51% attack is an attack that happens when miners in a network seize control of a network's hash rate for a specific blockchain. It suggests that the miners will possess more than 50% of the mining power and can mine more quickly than anyone else.

51% Attack 

When a hacker takes over a blockchain network, they can stop transactions from happening, change how new transactions are computed for priority, and even go back and undo records of their past transactions (a problem known as "double spending"). They can do all of these activities by changing the data encoded in the blockchain.

  • A 51% attack happens when one miner (or a group of miners) has control over more than half of the hash rate (or processing power) of a blockchain network.
  • Blockchains are used in cryptocurrency trading to track authorized transactions of digital currency as well as the mining of cryptocurrency tokens or coins. 
  • Attacks on a blockchain might also harm a cryptocurrency's reputation, which would cause investors to sell their crypto, depreciating its value.
  • One can reduce the likelihood of an attack by adding a "delay function" to their proof-of-work consensus process.

51% Attack Explained

A 51% attack happens when one miner (or a group of miners) has control over more than half of the hash rate (or processing power) of a blockchain network. Blockchains are used in cryptocurrency trading to track authorized transactions of digital currency as well as the mining of cryptocurrency tokens or coins. Data is gathered in groups, or blocks, and connected to build a data chain using blockchain technology.

With several cryptocurrencies, "miners" can try to modify them by adding blocks to these chains by employing mining machines to solve mathematical puzzles (proof of work). These machines are a network of computers. Cryptocurrency is awarded to miners who successfully add a block to the network. 

A blockchain network is made decentralized by disseminating its code to all miners. No single party can add or change data blocks at will. A data block cannot be modified and added to the blockchain unless all participants agree it is genuine. However, a hacker or group can establish their own consensus on block validity by controlling more than half of the processing power a blockchain uses.

In this situation, a 51% attack happens when miners (one or more) control more than 50% of a network's hash rate, computing power, or mining power. The hash rate shows the rate at which each mining device in the network operates. A good hash rate is useful to assess the network's health. The miners who carry out a successful 51 percent attack have control over the network and some of the transactions that take place on it. This could imply that the attackers can modify transactions (double spending). Such attacks on a blockchain might also harm a cryptocurrency's reputation, which would cause investors to sell their crypto, depreciating its value.

Examples

Check out these examples for a better idea:

Example #1

Let's say Dave owns 100 bitcoins and wants to spend five bitcoins on purchasing a high-value property. In normal circumstances, Dave will get the property, and the dealer or seller will get the bitcoins. However, if Dave performs the 51% attack, he could reverse the coin transfer and have both the property and the bitcoins. This allows him to spend those five bitcoins again (double spending).

Here, the initiation of a transaction is accompanied by the creation of a chain of data blocks. A genuine transaction chain is put into a local pool of unverified transactions waiting to be verified. In order to perform the attack, Dave picks up this original transaction, creates an offspring out of it, and keeps it private. The chain has two versions: one of the miners (Dave) and a genuine one. In the original version, the coin is spent.

On the other hand, it is not in the miner's offspring version. If Dave can add blocks to his version of the forged blockchain longer and faster than the rest and broadcast it to the public, it is acceptable in place of the genuine transaction. When the rest of the network notices the longer version, they switch to this chain (since the longest chain means there is a majority consensus). When the rest switch to corrupted blockchains, this will be verified and considered the true version. This makes the original version invalid. It will be reversed, and he will get his coins back.

Example #2

In 2019, Ethereum Classic (ETC), also known as Ethereum's little brother, was under 51% attacks. A single person was in control of 60% of the mining power. Through the action, they created a longer blockchain version and achieved consensus. Thus, it allowed them to double-spend. Double-spent digital currency totaling was an estimate of the value of $1.1 million.

How To Detect?

One of the best ways to detect an attack is to scan for miners or mining pools that control more than 50% of the network's mining hash rate. It could also be the total number of tokens staked. This step requires constant vigilance over the process. One can also detect them by adopting superior security controls.

How To Prevent?

One can reduce the likelihood of an attack by adding a "delay function" to their proof-of-work consensus process. The move aims to penalize miners who are preparing for an attack. This is a modification to the consensus algorithm that determines whether or not to accept blocks in a blockchain.

It penalizes blocks that have been privately mined (a predictor for a 51% attack) with a block acceptance delay based on how long the block was hidden from the public network. Because a delay function permits penalties and the attack necessitates a miner to construct blocks secretly before submitting them to the blockchain, such attacks are prohibitively expensive. There could also be another solution. Exchanges could freeze questionable deposits as a potential solution until the issue is remedied.

Frequently Asked Questions (FAQs)

1. Is a 51% attack on Bitcoin possible?

Bitcoins, like other altcoins, can be victims of 51% of attacks. There have been instances of someone attacking Bitcoin SV (a controversial Bitcoin fork). However, the cost of effort involved and the difficulty of acquiring the hashing power needed to indulge in attacks on Bitcoin prevent them from happening.

2. Is 51% attacks illegal?

Many governments have yet to regulate the crypto space. Hence, attacks related to subjects are still in the dark. There are no specific laws that prevent or punish miners for such attacks. The aftermath may be subject to legal scrutiny, depending on the impact. However, they are morally wrong.

3. Can a 51% attack reoccur?

There are always chances that such attacks could recur. The attacker is now experienced with the execution of the attack and may gain control over 51% of the network's hashing power again. It does not always need to be the same attacker, but the act of attack could be.

This has been a guide to what is a 51% Attack. Here we explain the topic in detail, including its examples and ways to detect and prevent it. You can learn more about it from the following articles –