
What is PBFT?
PBFT (Practical Byzantine Fault Tolerance) is an excellent consensus algorithm for organization consortiums where members are partially trusted.
An Introduction to PBFT (Consensus Algorithm)
PBFT (Practical Byzantine Fault Tolerance) consensus algorithm allows a distributed system to reach a consensus even when a small number of nodes demonstrate falsifying information.
During information transmission, PBFT uses cryptographic algorithms such as signature, signature verification, and hash to ensure that everything is
- Irrevocable
- Unforgeable and
- Indisputable.
- Optimizes the BFT algorithm
- Reducing its complexity from exponential to polynomial.
First, reaching a consensus at its core is a matter of majority rule. Nodes in the system will act on the consensus reached by the majority of the nodes.
There are a certain number of fault nodes in the system, and these fault nodes might broadcast to a group of non-fault nodes (non-byzantine nodes) that it has sided with a certain request while broadcasting to a different group of nodes the exact opposite nodes.
Next, the system will still be able to reach a consensus under the worst circumstances.
In certain situations, the non-fault nodes are divided into two parts due to network partition:
- f non-fault nodes side with message A, then these nodes constitute Set (A, f); or
- f non-fault nodes side with message B, so these nodes constitute Set (B, f); and
- f fault nodes tell the non-fault nodes on
- A’s side that they support message A and tell the ones on B’s side that they support message B.
Now in Set(A, f)’s point of view, message A has gathered 2f votes. In Set (B, f)’s point of view, message B has gathered 2f votes. Then after the remaining 1 non-fault node takes a stance, one of the sets would become the majority and the other would become the minority.
According to the majority rule, the system is able to reach a consensus. After the network partition is fixed, Set (B, f) will also know that a consensus is reached and will therefore execute it.
Process of PBFT Algorithm
Roles:
Client: Nodes that are responsible for sending transaction requests are client nodes.
Primary: It is the main nodes that are responsible for packing transactions into Techpay blocks and finalizing blocks.
Each consensus-reaching process has one and only one Primary node.
Replica: These nodes are responsible for finalizing blocks. Multiple replica nodes is used in each consensus-reaching process
Both Primary and Replica nodes are consensus nodes.
Steps of PBFT consensus algorithm:
It consists of the following steps: Firstly, client sends requests; system plans the three-phase consensus process; client receives the response and confirms that the consensus is reached.
After this, the Primary node (R0 in this case) transmits the pre-prepare message, the system starts to accomplish the three-phase consensus.
The client request can be viewed as a set of multiple transactions.
What type of phase in which consensus algorithms consist of ?
Consensus protocol
PBFT consensus consists of three phases:
- Pre-Prepare
- Prepare and
- Commit
These three phases together form the core of the PBFT consensus algorithm.
Pre-Prepare: Primary node is responsible for generating pre-prepare messages and verifying the requests. Then, the Primary node will transmit the pre-prepare messages to all Replica nodes. After receiving the messages, Replica nodes will verify these messages and then transmit a corresponding prepared message. It will be elected to strike a consensus and respond to Client in a limited time, so as to fulfill the availability requirement.
Prepare: Gathering prepared messages. After a certain node gathers 2f+1 prepare messages, it will ensure that it is ready for Techpay block submission and start to transmits commit messages;
Commit: Gathering commit messages. After a certain node gathers 2f+1 commit messages, it will process the native requests cached locally and make changes to the system state.
- Pros of PBFT consensus algorithm: Certain number of Byzantine nodes provide safety and activity for an distributed system.
- Improving on the BFT (Byzantine Fault Tolerance), PBFT algorithm lowers the systematic complexity from the exponential level to the polynomial level.
- PBFT consensus mechanism guarantees that the distributed system It is fit for scenarios on private and alliance chains. strong consistency.
So, that BFT is applicable to real systems.
Types of Byzantine Failures:
There are two categories of failures of Byzantine that are considered.
- One is fail-stop(in which the node fails and stops operating)
- Arbitrary-node failure.
Some of the arbitrary node failures are followings:
- Failure to return a result
- Respond with an incorrect result
- Respond with a deliberately misleading result
- Respond with a different result to different parts of the system
Advantages of PBFT
Energy efficiency : Distributive consensus is achieved by PBFT without carrying out complex mathematical computations(like in PoW).
Zilliqa employs pBFT in combination with PoW-like complex computations round for every 100th block.
Transaction finality: The transactions do not require multiple confirmations(like in case of PoW mechanism in techpay where every node verifies all the transactions before adding the new block to the blockchain; confirmations can take few minutes depending upon how many entities confirm the new block) after they have been finalized and agreed upon the transactions.
Low reward variance: Every node in the network takes part in responding to the request by the client and hence every node can be leading to low variance in rewarding the nodes that help in decision making.
PBFT consensus algorithm are broken into 4 phases:
- Firstly, The client sends a request to the primary(leader) node.
- Then the primary(leader) node transmits the request to all the secondary(backup) nodes.
- The Primary and secondary nodes perform the service requested and then send back a reply to the client.
- when the client receives ‘m+1’ replies from different nodes in the network it shows that request is served successfully
where m is the maximum number of faulty nodes allowed
Limitations of pBFT
- The pBFT consensus model works efficiently only when the number of nodes in the distributed network is small due to the high communication overhead that increases exponentially with every extra node in the network.
Sybil attacks : The pBFT mechanisms are susceptible to Sybil attacks, where one entity(party) controls many identities. As the number of nodes in the network increases, sybil attacks become increasingly difficult to carry out.
- PBFT mechanisms have scalability issues too.
- It is used in combination with other mechanism(s).
Scaling : pBFT does not scale well because of its communication(with all the other nodes at every step) overhead. The time taken to respond to the request as the number of nodes in the network increases.
Read also :Cryptocurrency is a Hype or Reality ?