Introduction to the principle of PBFT algorithm

What is PBFT?

Practical Byzantine Fault Tolerance, Practical Byzantine Fault Tolerance.

What is BFT?

Byzantine Fault Tolerance, the Byzantine general problem.

What is the problem with the Byzantine generals?

Simply put, it is a question of the minority subordinating to the majority. Every fief of the Byzantine Roman Empire was stationed with an army led by a general, and the generals could only rely on messengers to pass messages. During the war, the Byzantine army can only win the victory if it has a numerical advantage. However, there may be traitors in the army, and when the enemy forces unite with them more than the number of loyal generals, the offensive will fail.

The pBFT algorithm is mainly proposed to solve the Byzantine general problem.

The prerequisite for solving this problem is that the communication must be reliable. If the communication is unreliable, there is no solution to the problem. In the Byzantine Generals problem, it is almost impossible or very difficult to reach agreement through unreliable communication. Therefore, this problem must be solved on the premise of reliable communication. That is, the ability to keep the system running normally even when there are some malicious components on the system constantly sending error messages.

PBFT principle

One node in the system will be regarded as the master node, and the other nodes are all child nodes. All nodes in the system will communicate with each other, and the ultimate goal is that everyone can reach a consensus on data based on the principle of the minority obeying the majority.

The basic process of pbft algorithm mainly has the following four steps:

  1. The client sends a request to the master node

  2. The master node broadcasts the request to other nodes, and the node executes the three-phase consensus process of the pbft algorithm.
  3. After the node has processed the three-stage process, it returns a message to the client.
  4. After the client receives the same message from f+1 nodes, it means that the consensus has been completed correctly.

Why does it mean that the consensus has been completed correctly after receiving the same message from f+1 nodes? It can be seen from the derivation in the previous section that, no matter in the best case or the worst case, if the client receives f+1 nodes

Guess you like

Origin blog.csdn.net/smilejiasmile/article/details/114555402