It is difficult to form a consensus in a distributed system even when some nodes fail or respond with faulty values (malicious nodes). It is known as the Byzantine generals' problem. Since this problem's inception, many consensus algorithms have been made which are Byzantine fault tolerant(when correctly working nodes in a system can reach an agreement).
Practical Byzantine fault tolerance(pBFT) is also one of the consensus algorithms introduced to solve the Byzantine generals' problem.
Note: Read more about consensus algorithms here.
Types of Byzantine failures can be divided into the following two categories:
Fail-stop failure: Node permanently stops working and does not return any result.
Arbitrary node failure: Node does not stop permanently and shows one of the following behaviors:
a. It does not return a result.
b. It returns an incorrect result.
c. It deliberately returns a misleading result.
d. It returns different results to different parts of the system.
The pBFT algorithm provides practical state machine replication in which all nodes are sequentially ordered, with one node as the primary node and others as secondary nodes (backup/replica nodes). A pBFT can function on the condition that the total number of malicious nodes must be less than one-third of the total nodes
The pBFT consensus happens in the following five steps:
The client makes a request and sends it to the primary node.
The primary node broadcasts the request to all the secondary(backup) nodes. It is called the pre-prepare phase.
Then every node (primary and secondary) sends a prepare message to all other nodes.
Once every node receives
Once every node receives
The primary node is changed during every consensus round, and all nodes vote to elect a new primary node. It is also known as the view change protocol.
The following are a few advantages of using pBFT over other consensus algorithms:
Energy efficient: pBFT does not need to compute complex mathematical problems to reach a consensus. Therefore, it is much faster and energy efficient than algorithms such as proof of work.
Faster transaction finality: Consensus algorithms such as proof of work require confirmations from other nodes before adding it to their
Low reward variance: In pBFT, every node is participating in processing the client's request. Hence, every node can be incentivized, resulting in low reward variance and a more fair reward system.
Some limitations of pBFT are as follows:
Sybil attacks: A distributed network using pBFT is susceptible to Sybil attacks if one entity controls many nodes in the network. As the number of nodes increases, it becomes difficult to carry out a Sybil attack.
Scalability: As the number of nodes in the network increases, communication overhead (messages sent to other nodes) increases. It is shown by the equation,
Free Resources