Six core algorithms of blockchain technology

Blockchain Core Algorithm 1: Byzantine Agreement

  The story of Byzantium goes something like this: The Byzantine Empire had great wealth, and 10 neighbors around it had been around for a long time, but Byzantium stood tall and impregnable, and 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 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

  Blockchain Core Algorithm 2: Asymmetric Encryption Technology

  In the above-mentioned Byzantine 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 his own attack time plan, and it will be difficult to unify the actions. Anyone can initiate an attack, but who sends it? In fact, it only needs to add a cost, that is: only one node can spread the information for a period of time. When a node sends a unified attack message, each node must sign and seal the message from the initiator to confirm their identity.


  In today's view, asymmetric encryption technology can completely solve this signature problem. The encryption and decryption of asymmetric encryption algorithms use two different keys. These two keys are what we often hear as "public key" and "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.

  Blockchain Core Algorithm 3: Fault Tolerance

  We assume that in this network, messages can be lost, corrupted, delayed, sent repeatedly, and received in an inconsistent order than sent. In addition, the behavior of nodes can be arbitrary: they can join and leave the network at any time, discard messages, forge messages, stop working, etc., and various artificial or non-human failures may occur. Our algorithm provides fault tolerance to a consensus system composed of consensus nodes, which includes both security and availability, and is applicable to any network environment.

  Blockchain Core Algorithm 4: Paxos Algorithm (Consistency Algorithm)

  The problem solved by the Paxos algorithm is how a distributed system agrees on a certain value (resolution). A typical scenario is that in a distributed database system, if the initial state of each node is consistent, and each node performs the same sequence of operations, then they can finally get a consistent state. To ensure that each node executes the same sequence of commands, a "consistency algorithm" needs to be executed on each instruction to ensure that the instructions seen by each node are consistent. A general consensus algorithm can be applied in many scenarios and is an important problem in distributed computing. There are two models of node communication: shared memory and message passing. Paxos algorithm is a consensus algorithm based on the message passing model.


  Blockchain Core Algorithm 5: Consensus Mechanism

  Blockchain consensus algorithms are mainly Proof of Work and Proof of Stake. Take Bitcoin as an example, in fact, from a technical point of view, PoW can be regarded as a repeated Hashcash, and the generation of proof of work is a random process in terms of probability. To mine a new cryptocurrency, when generating a block, the consent of all participants must be obtained, and the miner must obtain a PoW proof of work for all data in the block. At the same time, miners have to observe and adjust the difficulty of this work from time to time, because the network requirement is to generate a block every 10 minutes on average.

 Blockchain Core Algorithm 6: Distributed Storage

  Distributed storage is a data storage technology that uses the disk space on each machine through the network, and forms a virtual storage device with these scattered storage resources, and data is stored in all corners of the network. Therefore, distributed storage technology does not store complete data on each computer, but cuts the data and stores it in different computers. It's like storing 100 eggs, not in the same basket, but in different places, adding up to 100 eggs.

Guess you like

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