Byzantine Fault Tolerance (BFT) in Blockchain

Byzantine Fault Tolerance (BFT) in Blockchain

6 mins read14.8K Views Comment
Updated on Jan 27, 2023 17:55 IST

Byzantine Fault Tolerance (BFT) is a consensus mechanism that works on resolving Byzantine Generals’ problem in a decentralized network.

2022_04_Feauture-images-naukri20.jpg

Introduction

Whenever it comes to consensus discussion, the Byzantine general’s problem is one of the most complex and controversial. In 2008, with the inception of Bitcoin, Satoshi Nakamoto claimed to solve the byzantine problem with the proof of work (PoW) consensus mechanism. However, it was just the first step in achieving consensus in a decentralized network. This article will explain the Byzantine problem and Byzantine Fault Tolerance (BFT) Consensus Mechanism in Blockchain. It further goes through a practical byzantine fault tolerance (pBFT) consensus approach to tackle the problem.

Let’s begin with the Byzantine general’s problem.

Recommended online courses

Best-suited Blockchain courses for you

Learn Blockchain with these high-rated online courses

1.7 L
2 years
1.7 L
2 years
1.14 L
3 years
1.8 L
10 months
3.15 L
9 months
1.18 L
5 months

What is the Byzantine Generals’ Problem?

Byzantine Generals’ problem was acknowledged in 1982 as a logical decision puzzle. Its basis on how generals of the same side with different troops might have a communication problem in making decisions about the next move against the enemy

Let’s see the below diagram to understand the problem thoroughly.

The problem states like a group of generals with their army are about to attack their enemy. They surrounded the enemy’s castle from 4 different directions. Now how would they communicate the decision of attacking or retreating at the same time?

Here, a synchronized and concurrent attack on the enemy will be a success.

example

Following are problems that may arise while sharing the decision from one general to another:

  • The messenger might get captured while delivering the decision.
  • What if an imposter altered the message received.
  • How can a general make sure if he received the message from the expected general?
  • What if other generals become traitors and they send the message to attack, but they actually retreat.

How can the system be sure that each general will attack at the same time from their designated location? Is there no way but to trust each other completely?

Blockchain seems to resolve this problem with the Byzantine fault tolerance (BFT) consensus mechanism.

What is Byzantine Fault Tolerance (BFT)?

To ensure the success of the generals’ team, they need an algorithm that could adhere to the following conditions:

  • All the troop generals need to agree on the next action of the plan.
  • The generals should be trustworthy and loyal to the system.
  • Generals must not get influenced to become network traitors.
  • They need to follow the algorithm of the system.
  • The group of generals needs to reach a consensus or decision, irrespective of the traitors’ actions.
  • The system or network should not lead to a 51% attack at any point of action.

Byzantine Fault Tolerance (BFT) is a consensus approach that resists a system to get into the Byzantine Generals’ problem. It also means the system should stay intact even if one of the nodes (or general) fails. In addition, BFT aims to reduce the effect of malicious byzantine nodes (or general) on the network.

What is Practical Byzantine Fault Tolerance (PBFT)?

In an attempt to overcome the Byzantine problems,  Barbara Liskov and Miguel Castro introduced a Practical Byzantine Fault Tolerance (pBFT) consensus algorithm in 1999. They aim to ensure a practical byzantine state machine replication for tolerating malicious or byzantine nodes.

The pBFT follows an asynchronous approach. The following are essential aspects of the pBFT consensus algorithm:

  • All nodes are assembled in a sequence. 
  • One network node serves as a leader node, and the rest of them are backup nodes.
  • The primary or leader node serves the client’s request. It works as a moderator between client and backup nodes.
  • All nodes are capable of communicating with other nodes to check the honest nodes. 
  • Honest nodes should be able to reach a consensus for the next global change in the network based on majority rule.
  • It identifies the source of the message to make sure it’s sent by the correct sender.
  • Ensures the message has not been modified or corrupted in between.

As we went through the principles of pBFT. Let’s see how it works?

How does the PBFT Algorithm work?

The PBT highly depends on the condition that the maximum number of malicious or byzantine nodes must exceed one-third of all the nodes in the network. Hence, the security of the network is directly dependent upon the number of total honest nodes.

In short, a pBFT system can handle ‘f’ faulty or byzantine nodes where there are 3f + 1 total number of nodes on the network.

Following is the process of pBFT consensus algorithm:

  1. A client sends a request to the leader node.
  2. Then the leader node floods the request to all backup nodes.
  3. All the nodes work on the request and send a reply to the client.
  4. The client waits for (f + 1) replies from all the nodes with the same result. Here, f = number of possible faulty nodes.

The pBFT mechanism consists of 3 phases:

  1. Pre-prepare phase: The leader node sends out a pre-prepared message to each backup node.
  1. Prepare: After receiving the pre-prepared message from the leader, the backup nodes send the prepared message as a reply to all other nodes including the leader. A node is considered prepared only if it has received pre-prepared by the leader and seen (2f + 1) number of prepared messages from other nodes.
  1. Commit: If the nodes are prepared, they send a commit message. If a node receives (f + 1) commit messages, they carry out the client’s request.

The below diagram shows the working of the pBFT algorithm.

example2

The whole process of verification in a distributed system uses the concept of digital signatures. The validity message and sender are ensured using sequence numbers and metadata.

Blockchain like Zilliqa, Hyperledger fabric, and Tendermint uses the Practical Byzantine Fault Tolerance (pBFT) algorithm.

Benefits of PBFT

Following are the advantages of the pBFT consensus algorithm:

  • A pBFT doesn’t require carrying out high mathematical computations like PoW.
  • It is an energy-efficient consensus model.
  •  A block of transactions here does not need to follow multiple confirmations by each node. Hence, it requires less time.
  • As pBFT requires every node to participate and serves the client request, each node gets the reward. Hence low reward variance between each node.

Limitations of PBFT

Following are the disadvantages of the pBFT consensus algorithm:

  • pBFT has a high communication overhead that will increase with the number of nodes in the network.
  • It has scalability issues with more extensive networks.
  • pBFT is susceptible to Sybil attacks in which one node controls or acts as multiple network nodes.

In Conclusion

In the above article, we covered Byzantine Fault Tolerance (BFT) thoroughly. Along with its working pros, and cons. Hope you learned and enjoyed reading this article. Please share your comments and queries in the link below.

Recently completed any professional course/certification from the market? Tell us what liked or disliked in the course for more curated content.

Click here to submit its review with Shiksha Online.

FAQs

What is Byzantine Node?

It is the malicious faulty node in the network which might lead to network failure and corruption.

What is a 51% attack on a network?

A 51% attack means gaining at least 51% of the computation power of the whole network (in the case of PoW), else gaining 51% of staked coins in the network (in the case of PoS).

What is Sybil Attack?

A single node that pretends to be multiple nodes for responding in the attackeru2019s favor. Here, an attacker can control and manipulate the network with the majority.

What is the Consensus Mechanism?

The consensus mechanism helps network participants decide the following global change (like adding a new block of transactions) in the network

What is proof of work (PoW)?

Proof of Work (PoW) in the blockchain is a consensus mechanism that lets miners add a new block to the network based on the computation done to find the perfect hash.

What are the other blockchain consensus?

Some alternative consensus protocols include Proof of Work (PoW), Proof-of-Stake (PoS), Delegated Proof-of-Stake (DPoS), Proof-of-Burn (PoB), Proof-of-Authority (PoA), Proof-of-Importance (PoI), Proof-of-Elapsed-Time (PoET), Proof of Capacity (PoC), Proof of Activity (PoA) and many more.

About the Author

This is a collection of insightful articles from domain experts in the fields of Cloud Computing, DevOps, AWS, Data Science, Machine Learning, AI, and Natural Language Processing. The range of topics caters to upski... Read Full Bio