Fried currency robot: block chain block chain practitioners who must know the six core algorithm

A: Byzantine Agreement

Byzantine story probably said so: the Byzantine Empire has a huge wealth, around 10 neighbors down to the birthday has been a long time, but the Byzantine walls towering, impregnable, not a single neighbor can be successful invasion. Any individual neighbors invasion will fail, but also may itself be invaded other nine neighbors. Byzantine defenses so strong, more than half of at least ten neighbors simultaneously attack, will it be possible to break. However, if one of them or several neighbors together to attack itself promised good, but the actual process occurs betrayal, then the intruder will probably be wiped out. So each party be careful, incredulous neighbors. This is the Byzantine generals problem.

In this distributed network where: Each general has a real-time synchronization with other general news accounts. There are books for each signature is the general's identity can be verified. If what messages are inconsistent, inconsistent messages can know what the generals. Despite inconsistent messages, as long as more than half agree attack, majority, consensus.

Thus, in a distributed system, in spite of the bad guys, the bad guys can do any thing (not protocol restrictions), such as no response, send the wrong message to send different decisions on different nodes, different error nodes together do bad things, etc. Wait. However, as long as most people are good people, it is entirely possible to the center to achieve consensus.

II: asymmetric cryptography

In the Byzantine agreement, if some 10 generals simultaneously initiating message, the system will inevitably lead to confusion, resulting in each side attack time program, consistent action difficult. Everyone can initiate the attack, but the issue of who actually do this just add a cost on it, namely:? Only one node can disseminate information over time. When a node sends a unified offensive messages, each node receives the originator of the message must be signed and sealed, to confirm their identity.

In today's view, asymmetric encryption technology can solve this problem signature. Encryption and decryption using asymmetric encryption algorithms two different keys. The two keys that we often hear of "public" and "private." Public and private keys appear in pairs,

If the message using the public key encryption, the public key corresponding to the private key required to decrypt; Similarly, if the message using the private encryption key that corresponds to that required public key can decrypt.

Three: fault tolerance

We assume in this network, messages may be lost, damaged, delayed repeatedly transmitted, and is inconsistent with the order of the received transmission. Furthermore, the nodes may be arbitrary behavior: may be added at any time, exit the network may discard the message, message forgery, stop working, various non-human or human failure may also occur. Our system consists of the consensus algorithm consensus nodes, providing fault tolerance. This fault tolerance includes both security and availability, and applies to any network environment.

Four: Paxos algorithm (consensus algorithm)

Paxos algorithm to solve the question of how a distributed system to agree on a value (resolution). A typical scenario is that in a distributed database system, if the same initial state of each node, each node performs the same sequence of operations, then they finally get a consistent state. To ensure that each node performs the same sequence of commands, it requires the implementation of a "consensus algorithm" on each instruction to ensure a consistent instructions each node to see. A general consensus algorithm can be applied in many scenarios is an important problem in distributed computing.

Communication nodes exist two models: the shared memory and message passing. Paxos algorithm is a kind of consensus algorithm based on message passing model.

Five: the consensus mechanism

Block chain consensus algorithm mainly work certificate and proof of interest. Take bits coins, in fact, from a technical point of view can be seen Hashcash PoW reusable, generating workload is demonstrated on the probability of a random process. New mining confidential currency, generating blocks, you must get the consent of all participants, and that miners must be the work of all the data block PoW proof. At the same time the miners have to constantly adjust to observe the difficulty of this work, because the network is required to generate an average of one block every 10 minutes.

Six: distributed storage

Distributed storage is a data storage technology, the use of disk space on each machine through a network, and a virtual storage device constituting these distributed storage resources, every corner of the data stored in the decentralized network. Therefore, distributed storage technology is not every computer store complete data, but the data stored in different cut of the computer. Details exchange, please add the author!

Guess you like

Origin blog.csdn.net/ofkings95/article/details/90767097