MintDice Blog Post Image

What Is a Consensus Attack and How Networks Prevent It

Although blockchain can be a very secure way to pay and send money to friends, like anything in life, it does have its weaknesses. One of these weaknesses is a consensus attack.

Blockchains use consensus among all nodes on a network to approve transactions. If the consensus process is attacked, this can cause fraudulent transactions to be confirmed. Read on to learn all about consensus attacks and how networks prevent them.

Pexels Sebastian 411207

What is a Consensus Attack?

A consensus attack is an attack on the process blockchain nodes use to come to an agreement. It is this agreement that allows transactions to be approved or denied. When this process is attacked, it is usually disrupted for the purpose of trying to fool the blockchain into wrongly approving a transaction.

There are a few types of consensus attacks that we will discuss in detail in the next section.

51% Attack

The most common consensus attack is a 51% attack. For this attack, malicious actors seek to control more than 50% of the nodes on a network. While this may be easy when using smaller networks, note that Bitcoin currently has over 18,000 nodes, and therefore any attacker wanting to do the 51% attack would need to set up and operate a massive 9,000 nodes in order to attack the Bitcoin blockchain.

If the hacker is able to control over 51% of nodes, however, they can do several malicious things, like double-spend funds, stop transactions, and even stop the progress of a blockchain. However, as we mentioned above, this is a very difficult task unless the blockchain is relatively new and only operates on a few nodes. But once the nodes pass 100, it is too difficult for most malicious actors to set up enough nodes to perpetuate this scheme.

Sybil Attack

The next most common consensus attack is a Sybil attack, and it is actually quite similar to a 51% attack. However, to perpetuate a Sybil attack, a hacker has to create fake nodes. Once these are created, the hacker can disrupt the blockchain process and prevent the addition of new nodes to the blockchain. This is, of course, very serious, as it can bring the blockchain to a halt, but we find the financial damage done is much less than with a successful 51% attack, as hackers can’t use the fake nodes to process transactions in their favor.  

**Note that a POW blockchain like Bitcoin is immune to Sybil attacks as the verification processes for nodes in POW blockchains are stringent. It is more common in POS blockchains like Solana.

Eclipse Attack

An Eclipse attack is when hackers manipulate the incoming our outcoming traffic for a node, possibly causing the node to make different decisions than it normally would. While this can be bad when executed on a large scale, like Sybil attacks, it is mostly performed with the goal of disrupting the blockchain and doesn’t carry as much financial gain.

Forking Attack

A forking attack is when a malicious actor forces a blockchain to split on a temporary basis. This is very bad, as it allows the hacker to double-spend until the blockchain is recompiled. That being said, forking attacks are very difficult to execute, and most blockchains take steps to prevent them from happening.

Pexels Pixabay 373543

How Do Blockchains Stop Consensus Attacks?

As you can see, consensus attacks can be very serious, and as such, most blockchain creators set up controls to prevent the attacks from happening.

1. Choosing Proof of Authority (POA)

The POA consensus mechanism only allows nodes to be appointed by the creators of the blockchain. As you can imagine, this makes it nearly impossible to add fake nodes or to create a 51% attack. However, this is also not what blockchain was created for, as it centralizes the power. As such, the POA consensus mechanism is frowned on by many—and for a good reason.

2. Starting With a Large Number of Nodes

One of the best ways to prevent a 51% attack is to have a large number of nodes up and running when the blockchain goes online. Of course, this is easier said than done, and even Satoshi Nakamoto only had a single node online at the advent of Bitcoin.

That being said, newer blockchains with companies backing them (like Binance, for example) often come online with several nodes and work to add new ones rapidly to help protect against the 51% attack.  

3. Applying Transaction Endorsement

Many businesses utilizing blockchain protect their assets by requiring transaction endorsement. This means that transactions must be endorsed by a certain party or node in order to be processed, and they can quickly identify malicious nodes or unusual actions. Of course, this goes back to the POA consensus mechanism and is therefore not utilized by truly decentralized blockchains.

4. Don’t Use POW

Unfortunately, the POW consensus mechanism is the most susceptible to 51% attacks. While you don’t have to immediately go to the polar opposite, POA, any other consensus mechanism, including POS, offers more protection from the 51% attack than POW. That being said, remember that POW is safe from a Sybil attack when many other blockchains aren’t—so you will need to take other steps to protect from that.

5. Delaying Blockchain Confirmations

One of the best methods blockchains use to protect against 51% attacks is by delaying the blockchain confirmations. This allows the network nodes time to notice when something may be amiss with some of its nodes.

6. Penalty System

Another method that is effective against the problem of 51% spend is to have a penalty system that penalizes nodes for bad behavior. In POS, the penalty can be locking up funds needed to participate in consensus, and in POW, the penalty could be disallowing the node from future transaction confirmations. While you might already be nodding your head, wondering why not everyone does this, know that this is expensive and difficult to implement, and therefore most decentralized POW blockchains don’t have the funds (or coders) to do so.

 

Conensus attack | 51% attack | Protecting against consensus attacks | Sybil attack | Eclipse attack

Check out our games!

Wager cryptos with our provably fair casino games!