Current location - Quotes Website - Signature design - Byzantine problem and * * * knowledge algorithm
Byzantine problem and * * * knowledge algorithm
The "Byzantine general problem" is a classic problem, which is described as follows: Byzantium is the capital of the Eastern Roman Empire, and its army is divided into many divisions, each led by a general. These generals communicated through messengers and reached a plan of * * * joint operations. Some generals may be traitors and want to undermine this process, which will lead to the failure of those loyal generals to reach a unified battle plan. This problem lies in how to make loyal generals reach a unified battle plan under such circumstances and avoid the traitors misleading the battle plan.

In point-to-point and distributed blockchain, Byzantine problem is often used to compare how nodes acquire * * * knowledge. Universality refers to reaching a unified battle plan for each node, that is, achieving * * * knowledge, correctly packaging and verifying the block data, and preventing malicious nodes (traitor generals) from destroying the operation of the blockchain.

As the name implies, it is a mechanism that can solve the Byzantine problem, make each node reach * * * knowledge, and solve the * * * knowledge problem, also called * * * knowledge algorithm. In all kinds of * * * recognition algorithms, there has always been an "impossible trinity" problem. This triangle refers to "safety", "decentralization" and "speed", that is to say, it is difficult to guarantee speed, safety and decentralization at the same time, and the three often take care of one thing and lose the other.

At present, there are dozens of algorithms for * * * knowledge, and the computer industry has been in the research stage, which does not mean that any algorithm is perfect.

Let's first look at two algorithms, pBET and POW, how secure, decentralized and fast they are.

Practical Byzantine fault tolerance is an early algorithm for * * * recognition. One of the principles of pBFT is that the minority is subordinate to the majority. Nodes send messages about decisions to each other, and whoever agrees with the decision will have more people. So in this system, security increases with the number of honest nodes. Honest nodes agree with the correct decision and reject the wrong decision of malicious nodes. As long as the number of malicious nodes is less than 1/3 of the total number, * * * knowledge can be guaranteed.

Acquiring * * * knowledge can be simplified into four steps:

PBFT uses voting mechanism to elect leading nodes in a round robin manner.

The leader initiates the decision and broadcasts it to the auxiliary node.

All nodes, including the leading node and the auxiliary node, send responses.

What time? When the+1 node sends the same response, the response is considered valid.

If the leader has malicious behavior, he can be deleted by most nodes.

According to the principle that the minority is subordinate to the majority. Theoretically, as long as the number of malicious nodes is less than 1/2, why should the fault-tolerant number of PBFT algorithm meet the requirement that the number of malicious nodes is less than 1/3 of the total number?

Because PBFT algorithm needs to support not only fault-tolerant nodes, but also fault-tolerant evil nodes. Suppose the number of nodes in the cluster is n, and the problematic node is F. Among the problematic nodes, it can be either a faulty node or a bad node, or just a faulty node or just a bad node. Then there will be the following two extreme situations:

(1) These F problematic nodes are both faulty nodes and evil nodes, so according to the principle that the minority is subordinate to the majority, the normal nodes in the cluster only need one more node than F nodes, that is, f+ 1 node, and the number of correct nodes will be more than the number of faulty nodes, so the cluster can reach * * knowledge, that is, the total number of nodes is F+(F+.

(2) Fault nodes and evil nodes are different nodes. Then there will be f evil nodes and f wrong nodes. When nodes are found to be evil nodes, they will be excluded from the cluster, leaving F failed nodes. Then, according to the principle that the minority is subordinate to the majority, the normal nodes in the cluster only need one more node than the F node, that is, f+ 1 node, and the number of nodes will be more than the number of failed nodes, so that the cluster can realize * * * recognition. So the number of all types of nodes adds up to f+ 1 normal node, f fault node and f evil node, that is, 3f+1= n.

Based on the above two situations, the maximum number of fault-tolerant nodes supported by PBFT algorithm is (n- 1)/3, which is less than 1/3.

Advantages and disadvantages of pBFT

PBFT system does not need high computing resources or a lot of energy to run. PBFT can quickly reach * * * knowledge when there are few nodes, because all nodes are constantly communicating with each other. Once the nodes agree on the decision, the transaction is completed.

However, the shortcomings of pBFT are also obvious: frequent communication makes it only work normally in networks with limited number of nodes. With each new node joining the network, the communication overhead increases exponentially, and the time required for response also increases.

PBFT networks are also vulnerable to Sybil attacks. Witches are different nodes created by malicious hackers. Hackers can control more nodes than 1/3, and the system will not be able to achieve correct cognition.

From the perspective of impossible trinity, it can be seen that pBFT is fast with few nodes, but its security is poor and its decentralization degree is low. Too many nodes will lead to slow speed.

Satoshi Nakamoto designed the POW*** knowledge mechanism to solve the scalability problem of the above classical pBFT knowledge.

As mentioned above, it takes too long for pBFT to broadcast continuously and then count the number of messages of nodes. How does POW do it: I don't want to calculate whether the number of nodes exceeds 2/3. I just choose one node, and according to its decision, all other nodes synchronize its decision. This saves the time-consuming operation of communicating at all nodes and then calculating the number of nodes.

Then, which node encapsulates the block is very important. What if it is a malicious node? Packaged nodes must be required. Which node has the right to package? That is to solve complex mathematical problems, commonly known as digging. Nodes must spend a lot of computing power and power to win the right to package blocks at one time. This cost limits the witch attack of hackers.

If the rights of the package were really robbed by hackers, what might be the problem?

(1) stealing sugar oranges

Can a hacker steal a sugar orange from an address that belongs to another user and is not controlled by her? The answer is no, even if this round is the next block on the blockchain packaged by hackers, she can't steal other people's bitcoins. To do this, the hacker needs to initiate an effective transaction to transfer Bitcoin to his address. This requires hackers to forge the signature of the bitcoin owner, but if the digital signature mechanism is secure, she can't do it. As long as the encryption foundation behind it is solid, it is impossible for her to steal Bitcoin easily.

(2) Denial of service attack

Let's consider another attack. Assuming that the hacker doesn't like a user named Bob, the hacker can decide that she won't put any transactions initiated by Bob into the block she proposed. In other words, she refused to provide services to Bob. Although this is an effective attack that hackers can carry out, fortunately, it is only a small problem. If Bob's transaction is not put into the next block packaged by the hacker, Bob only needs to wait until the next honest node initiates the block, and his transaction record will be put into this block. So this is actually not an effective attack.

In other words, the hacker spent a lot of money to get this package, but it can't play an effective attack. Because of the mechanism of punishing malicious nodes and rewarding honest nodes, * * knowledge is realized.

Despite the improvement, prisoners of war have also brought other problems. The workload proves that all nodes need to solve complex mathematical problems, which will consume a lot of energy, that is, the so-called mining power consumption. Moreover, the time to solve complex mathematical problems is not short, about 10 minutes.

From the perspective of impossible trinity, POW is highly decentralized and safe, but the speed is still a little slow, but at least it will not grow exponentially because there are more nodes like pBFT.

* * * There are various algorithms for recognition. The POW of sugar orange does not really solve the problem of distributed * * * recognition, nor can it be perfectly applied to other scenes. However, it solves the problem of * * * knowledge of sugar orange in this specific scenario of monetary system. Powder is very effective in sugar orange.