Satoshi Nakamoto and the Byzantine General Problem

Reposted from: https://www.jianshu.com/p/5fea30b25f0a

Many people may have heard of the Byzantine generals problem, but they do not know what it means. This article will talk about what the Byzantine generals problem is from a non-professional perspective.

The Byzantine Generals Problem, first proposed by Leslie Lamport and two others in 1982, is a simple story model that has puzzled computer scientists for decades.

The story goes something like this:

The Byzantine Empire, the Middle Ages Turkey, had enormous wealth and was surrounded by 10 neighbors for a long time, but the Byzantine walls were so strong that no single neighbor could successfully invade. Any invasion by a single neighbor will fail, and may itself be invaded by 9 other neighbors. The Byzantine Empire's defense capability was so strong that at least half of the ten neighboring states attacked at the same time before it was possible to break through.

However, if one or several of the neighbors themselves promised to attack together, but the actual process turned out to be betrayal, the invaders could all be wiped out.

So each side acted cautiously and dared not easily trust its neighbors. This is the Byzantine Generals problem.

In the Byzantine problem, the most important thing for the neighboring countries is: how can all the generals reach a consensus to attack the Byzantine Empire.

Reaching a consensus is not as simple as sitting down and having a meeting. Some generals have unfathomable scheming and duplicity. If there are traitors, various problems may arise:

  • Traitors may trick some generals into taking offensive action themselves.
  • Traitors may encourage other generals to act.
  • Traitors may confuse other generals into receiving inconsistent information and thus become confused.

In response to the in-depth study of the Byzantine problem, scientists have come to a conclusion: if the number of traitors is greater than or equal to 1/3, the Byzantine problem is unsolvable.

The interpretation process can be explained with an adjutant model:

Suppose there are only 3 people, A, B, C, if one of the three is a traitor. When A issues an order to attack, B, if he is a traitor, may tell C that he has received an order to "retreat." At this time, C received an "attack" and a "retreat", so C was confused by the information and was at a loss.

If A is a traitor. He tells B to "attack" and C to "retreat". When C told B that he had received the "retreat" order, B was unable to keep up with C because he had received the commander's order to "attack".

For the above reasons, in a system with only three roles, as long as one of them is a traitor, that is, the number of traitors is equal to 1/3, the Byzantine problem is unsolvable.

Of course, as long as the number of traitors is less than 1/3, the problem is still solvable.

The scientists came up with an oral information protocol and a written agreement.

Solution One: Use Verbal Messages

Verbal Messages Even if the generals send someone to convey the message verbally, the actual meaning of the verbal message is:

  • Every message sent is delivered correctly
  • The recipient of the message knows who sent the message
  • Silence (not messaging) can be detected

The algorithm of the oral protocol is very simple. If one of the nodes, such as 1, publishes a message, 2 and 10 all receive the message of 1, and then 2 and 10 also relay it to other nodes. Each node is the transmitter of the information. One round Down, each node will have 10 pieces of information (attack or retreat), if there is a traitor, the information may have inconsistent information about attacking or not attacking. Everyone is equivalent to having a ledger of news in their hands. How to make decisions? If more than half of the people say to attack, then taking an offensive action will be successful, so even if there are traitors at this time, as long as the majority listens to the majority, it is beneficial for the minority to obey the majority to act.

This verbal agreement algorithm also has obvious shortcomings: the oral agreement does not tell who the previous source of the message is, that is, the message cannot be traced back to the source, and it is difficult to find the traitor if the information is inconsistent.

Solution 2: Use a written agreement

It can be assumed that there are 10 countries, and each country can send people to send letters to each country. For example, they agreed to "one day at six o'clock in the morning, we will attack Byzantium together, and we will sign the letter when we agree." If the country receiving the letter agrees, it can sign and seal the original letter.

Compared with the oral agreement, the written agreement actually means that an implicit condition is added to this multi-person general model:

  • Generals can use signature technology, which cannot be forged and can be discovered once tampered with.
  • At the same time anyone can verify the authenticity of the signature.

Written agreements are compared to oral agreements, all messages are recorded, which solves the problem of traceability.

But in reality there may still be various problems:

  • Communication between neighbors in the Middle Ages could only be done by messengers on horseback. The generals did not trust each other, and it was impossible for them to gather in person for meetings. Physical distance caused delays in information transmission.

  • A truly trusted signature system is difficult to achieve. The problem of forged signatures is also unavoidable.

  • The preservation of signed message records is difficult to escape from centralized institutions.

In addition, if each country sends messengers to the other 9 countries, it will take 90 transmissions to complete a round of information exchange in this network, but each country may return different attack times. In this asynchronous communication condition Now, to be able to reach a consensus is a big problem.

That is, if you can rely on a centralized and trusted institution, you may be able to integrate the signature records of multiple parties, and it is easier to achieve the unity of opinion among the 9 countries, but this is a false assumption, because the premise is that the network does not trust each other. .


This is a distributed network composed of neighboring countries that do not trust each other . In order to obtain the maximum benefit, they must work together to complete it. How to reach a consensus has become a difficult problem.

Leslie Lambert proposed the "Byzantine Generals Problem", but it was Satoshi Nakamoto who really solved the problem.

The Ultimate Solution: Blockchain Technology

The existence of the Internet first reduces the cost of information circulation. Each general is equipped with a computer, which solves the problem of time delay caused by horse-riding communication in the "written agreement".

If several of the 10 generals send messages at the same time, it will inevitably cause confusion in the system, causing each to talk about their own attack time plans, and it will be difficult to unify their actions.

Anyone can initiate an offensive message, but who sends it? Satoshi Nakamoto cleverly added the cost of sending information to the system , that is: only one node can spread information in a period of time.

The cost of adding it is "workload" - a node must complete a computational job to spread the message to the city-states, and of course, whoever completes the job first can spread the message.

When a node sends a unified attack message, each node must sign and seal the message from the initiator to confirm their identity. Satoshi Nakamoto here cites modern cryptography to sign this message.

This encryption technology - asymmetric encryption can completely solve the signature problem that was difficult to solve in ancient times:

  • privacy of messaging
  • able to confirm identity
  • Signature cannot be forged or tampered with

Asymmetric encryption algorithms use two different keys for encryption and decryption. These two keys are what we often hear as "public key" (public key) and "private key" (private key).

The public key and the private key generally appear in pairs. If the message is encrypted with the public key, the private key corresponding to the public key is required to decrypt it; similarly, if the message is encrypted with the private key, the public key corresponding to the private key is required to decrypt.

The role of asymmetric encryption is to protect the content of the message and allow the recipient of the message to determine the identity of the sender.

For example, General A wants to send a message to General B. In order to prevent the message from leaking, General A only needs to use B's public key to encrypt the information, and B's public key is public, and B only needs to decrypt it with his own private key. That's it.

General B wants to declare his identity on the letter. He can write a "signature text" by himself, sign it with his private key, and broadcast it. Everyone can verify the signature based on B's public key and determine B's identity.

Thus, an untrusted distributed network becomes a trusted network where all participants can agree on something.

Written here, and finally understand the meaning of proof of work (Proof Of Work). Some people say that mining wastes huge social resources, but the cost of building trust is not 0. Mining is the best way to maintain the reliability of the Bitcoin network.

Proof of work, a simple understanding is a proof. In reality, graduation certificates and driver's licenses belong to proof of work. It is used to test the results to prove how much work you have done in the past.

In the Byzantine system, adding proof of work is actually a simple and rude introduction of a condition: everyone should not be too busy to send messages, all come to a question, and whoever is the smartest is eligible to send a message first.

This question must be absolutely fair. When Satoshi Nakamoto designed Bitcoin, he used a proof-of-work mechanism called hash cash . To find a random number in a transaction block, the computer can only use the exhaustive method to find a random number. To find this random number, it can be said that whether it can be found depends on luck, so for each node, only randomness is truly fair in this world. The best way to achieve randomness is to use mathematics. All generals are looking for consensus. The process, with the help of mathematical logic recognized by everyone.

What if different generals solved the problem successively and released news to the network successively, so that each node would receive the news of attacking or not attacking from different nodes? Only the oldest initiator is valid. Satoshi Nakamoto ingeniously designed a time stamp to stamp the time of each general when he solved the problem (block time).

Then why do the generals have to do proof of work together? Satoshi Nakamoto can also set up a reward mechanism. The reward mechanism of Bitcoin is that each block is packaged, and currently it rewards 25 Bitcoins. Of course, the reward mechanism of the Byzantine generals problem can be to divide the benefits obtained by Byzantium.

By the way, what if there is betrayal?

In this distributed network:

  • Each general has a message ledger that is synchronized with other generals in real time.
  • The signature of each general in the ledger can verify the identity. If any messages are inconsistent, you can know which generals the messages are inconsistent.
  • Although there is inconsistent news, as long as more than half of the people agree to attack, and the minority obeys the majority, a consensus is reached.

Thus, in a distributed system, although there are bad people, bad people can do anything (not limited by the protocol), such as not responding, sending wrong information, sending different decisions to different nodes, different wrong nodes joining together to do bad things, etc. Wait. However, as long as the majority of people are good people, it is entirely possible to achieve consensus in a decentralized manner .

The consensus mechanism on the blockchain mainly solves the problem of who will construct the block and how to maintain the unity of the blockchain.

The Byzantine fault tolerance problem needs to be solved as well, who initiates the information and how to realize the unified synchronization of the information.

Here you can also know that the Internet-based blockchain technology overcomes the shortcomings of oral agreements and written agreements, uses message encryption technology, and a fair workload proof mechanism to create a set of protocols that all generals agree with , with the emergence of this protocol, the Byzantine general problem has been perfectly solved.

Great innovations often stand on the shoulders of their predecessors. Satoshi Nakamoto is the integrator of various cutting-edge technologies. Under such integrated innovation, ancient intractable diseases become no longer a problem.




Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326264304&siteId=291194637