区块链有什么算法吗,区块链有什么算法和技术
请查看相关英文文档
『一』 There are several consensus algorithms in blockchain
Ripple Consensus
enables a group of nodes to reach consensus based on a special node list. The initial special node list is like a club. To admit a new member, 51% of the club members must vote. The consensus follows that the core members have 51% of the power, and outsiders have no influence. Since the club started as "centralized", it will remain "centralized" and if it starts to become corrupt, there is nothing the shareholders can do.
5. PBFT: Practical Byzantine Fault Tolerance (Practical Byzantine Fault Tolerance Algorithm)
PBFT is a state machine replica replication algorithm, that is, the service is modeled as a state machine, and the state machine is on different nodes of the distributed system Make a copy. Each copy of the state machine saves the state of the service and also implements the service's operations. The set of all replicas is represented by a capital letter R, and an integer from 0 to |R|-1 is used to represent each replica. For the convenience of description, assume |R|=3f+1, where f is the maximum number of replicas that may fail. Although more than 3f+1 replicas can exist, the additional replicas do not improve reliability other than reducing performance.
The main features of the PBFT algorithm are as follows: the client sends a request to the master node to call a service operation; the master node sends the request to other replicas through broadcast; all replicas execute the request and send the result back to the client; the client needs to wait f +1 different replica nodes send back the same result as the final result of the entire operation.
『二』Hash algorithm in blockchain
Hash algorithm is the most important underlying technology in blockchain. It is a method used to identify transaction data and is unique. A cryptographic hash algorithm is a "fingerprint" of the data.
The cryptographic hash algorithm has 5 major characteristics:
1. It can quickly create hash values for any type of data.
2. Certainty. Hash algorithms always produce the same hash value for the same input data.
3. Pseudo randomness. When the input data is changed, the hash value returned by the hash algorithm changes unpredictably. It is impossible to predict the hash value based on the input data.
4. One-way function. It is not possible to recover the original input data based on the hash value. It is impossible to learn anything about the input data based on the hash value alone.
5. Anti-collision. The chances of different blocks of data producing the same hash value are slim.
『三』What is a blockchain encryption algorithm
Blockchain encryption algorithm (EncryptionAlgorithm)
Asymmetric encryption algorithm is a function that uses an encryption key. Convert the original plaintext file or data into a string of incomprehensibleRead the ciphertext code. The encryption process is irreversible. Only by holding the corresponding decryption key can the encrypted information be decrypted into readable plain text. Encryption allows private data to be transmitted through public networks with low risk and protects data from being stolen and read by third parties.
The core advantage of blockchain technology is decentralization. It can realize decentralized credit in a distributed system where nodes do not need to trust each other by using data encryption, timestamps, distributed consensus and economic incentives. Point-to-point transactions, coordination and collaboration, thereby providing solutions to the problems of high cost, low efficiency and insecure data storage common in centralized institutions.
The application fields of blockchain include digital currency, certificates, finance, anti-counterfeiting and traceability, privacy protection, supply chain, entertainment, etc. With the popularity of blockchain and Bitcoin, many related top domain names have been registered. , which has had a relatively large impact on the domain name industry.
『四』What is the blockchain cryptographic algorithm?
As an emerging technology, blockchain has received more and more widespread attention. It is a new version of traditional technology in the Internet era. Applications, including distributed data storage technology, consensus mechanism and cryptography, etc. With the creation of various blockchain research alliances, related research has received more and more funding and personnel support. Hash algorithm, zero-knowledge proof, ring signature and other cryptographic algorithms used in the blockchain:
Hash algorithm
Hash algorithm is the basic technology of the blockchain. The essence of the Hash function is to A set of data of arbitrary length (finite) is mapped into a set of data streams of defined length. If this function satisfies both:
(1) The calculation of the Hash value of any input set of data is very simple;
(2) Think It is computationally difficult to find 2 different data with the same hash value.
Hash functions that satisfy the above two properties are also called cryptographic Hash functions. Unless there is any contradiction, the Hash function usually refers to the cryptographic Hash function. For the Hash function, finding such a value is called a collision. Currently popular Hash functions include MD5, SHA1, SHA2, and SHA3.
Bitcoin uses SHA256, and most blockchain systems use the SHA256 algorithm. So here we will introduce SHA256 first.
1. SHA256 algorithm steps
STEP1: Add padding bits. The message is padded so that the message length is congruent with 448 mod 512 (length = 448 mod 512). The number of padding bits ranges from 1 to 512. The highest bit of the padding bit string is 1 and the remaining bits are 0.
STEP2: Additional length value. Append the bit length of the initial message (before padding) expressed in 64-bit to the result of step 1last (low byte first).
STEP3: Initialize the cache. Use a 256-bit cache to store the intermediate and final results of the hash function.
STEP4: Process 512-bit (16 words) message packet sequence. The algorithm uses six basic logic functions and consists of 64 steps of iterative operations. Each step takes a 256-bit cache value as input and then updates the cache content. Each step uses a 32-bit constant value Kt and a 32-bit Wt. Where Wt is the message after grouping, t=1,2,...,16.
STEP5: After all 512-bit packets are processed, the output generated by the last packet of the SHA256 algorithm is a 256-bit message.
2. Ring signature
In 2001, three cryptographers, Rivest, Shamir and Tauman, proposed the ring signature for the first time. It is a simplified group signature, with only ring members and no managers, and does not require cooperation among ring members. In the ring signature scheme, the signer first selects a temporary set of signers, which includes the signer. The signer can then use his own private key and the public keys of others in the signature set to generate signatures independently without the help of others. Members of a set of signers may not be aware that they are included.
The ring signature scheme consists of the following parts:
(1) Key generation. Generate a key pair (public key PKi, private key SKi) for each member in the ring.
(2) Signature. The signer uses his own private key and the public keys of any n ring members (including himself) to generate signature a for message m.
(3) Signature verification. The verifier verifies whether the signature is signed by a member of the ring based on the ring signature and message m. If it is valid, it will be accepted, otherwise it will be discarded.
The properties that ring signatures satisfy:
(1) Unconditional anonymity: The attacker cannot determine which member of the ring generated the signature, even after obtaining the ring member’s private In the case of key, the probability does not exceed 1/n.
(2) Correctness: The signature must be verified by all others.
(3) Unforgeability: Other members in the ring cannot forge the signature of the real signer. Even if an external attacker obtains a valid ring signature, he cannot forge a signature for message m.
3. Comparison between ring signature and group signature
(1) Anonymity. It is a system in which individuals sign on behalf of a group. The verifier can verify that the signature is signed by a member of the group, but cannot know which member, so as to achieve the anonymity of the signer.
(2) Traceability. In the group signature, the group administrator’sPresence guarantees the traceability of the signature. Group administrators can revoke signatures to reveal the true signer. The ring signature itself cannot reveal the signer unless the signer himself wants to reveal or add additional information to the signature. A verifiable ring signature scheme is proposed. In the scheme, the real signer hopes that the verifier knows his identity. At this time, the real signer can confirm his identity by revealing the secret information he holds.
(3) Management system. Group signatures are managed by the group administrator, while ring signatures do not need to be managed. The signer only has to select a possible set of signers, obtain its public key, and then publish the set. All members are equal.
The Xueshuo Innovation Blockchain Technology Workstation under Lianqiao Education Online is the only approved "Smart Learning Factory 2020- Xueshuo Innovation Workstation" launched by the School Planning and Construction Development Center of the Ministry of Education of China. "Blockchain Technology Professional" pilot workstation. The professional base is based on providing students with diversified growth paths, promoting the reform of the training model integrating professional degree research, production, and research, and building an applied and compound talent training system.
『Wu』What are the characteristics of the hash algorithm in the blockchain
The hash algorithm can be viewed as a small computer program, regardless of the input data Regardless of size and type, it converts input data into fixed-length output. The hash algorithm can only accept the input of a single piece of data at any time and rely on the input data to create a hash value.
There are different hashing algorithms depending on the length of the final hash value.
The cryptographic hash algorithm used in the blockchain has the following characteristics:
1. Able to quickly create hash values for any type of data
2. Deterministic
3. Pseudo-random
4. One-way function
5. Anti-collision
『Lu』 Blockchain --- Consensus Algorithm
The PoW algorithm is a A mechanism to prevent the abuse of distributed service resources and denial of service attacks. It requires nodes to perform complex operations that consume a moderate amount of time and resources, and the operation results can be quickly verified by other nodes, using time and energy as a guarantee to ensure that services and resources are used according to real needs.
The most basic technical principle in the PoW algorithm is the use of hashing algorithms. Assume that the hash value Hash(r) is found. If the original data is r (raw), the operation result is R (Result).
R = Hash(r)
The characteristic of the hash function Hash() is that for any input value r, the result R is obtained, and r cannot be deduced from R. When the input original data r changes by 1 bit, the resulting R value changes completely. In the Bitcoin PoW algorithm, the algorithm difficulty d and the random value n are introduced to get the followingThe following formula:
Rd = Hash(r+n)
This formula requires that when a random value n is filled in, the first d bytes of the calculation result Rd must be 0. Due to the unknown nature of the hash function results, each miner has to do a lot of calculations to get the correct result. After the calculation result is broadcast to the entire network, other nodes only need to perform a hash operation to verify it. The PoW algorithm uses this method to consume resources for calculation, and verification only needs to be done once.
The PoS algorithm requires node verifiers to pledge a certain amount of funds to be eligible for mining and packaging, and the regional chain system uses a random method when selecting packaging nodes. When the node pledges The more funds there are, the greater the probability of being selected to package the block.
In POS mode, each coin generates 1 coin age every day. For example, if you hold 100 coins for a total of 30 days, then your coin age will be 3000 at this time. At this time, if you verify a POS block, your currency age will be cleared to 0, and the corresponding digital currency interest will be obtained from the block.
The process of a node producing blocks through the PoS algorithm is as follows: To become a block producing node, an ordinary node must first pledge its assets. When it is its turn to produce a block, it packages the block and then broadcasts it to the entire network. , other verification nodes will verify the legitimacy of the block.
The DPoS algorithm is similar to the PoS algorithm and also uses shares and equity pledges.
But the difference is that the DPoS algorithm uses a delegated pledge method, which is similar to the method of universal election of representatives to select N super nodes to record and produce blocks.
Voters cast their votes for a certain node. If a certain node is elected as an accounting node, then the accounting node can often use any method to reward its voters after obtaining the block reward.
These N accounting nodes will take turns to produce blocks, and the nodes will supervise each other. If they do evil, the pledge deposit will be deducted.
By trusting a small number of honest nodes, unnecessary steps in the block signing process can be removed, increasing the speed of transactions.
Byzantine problem:
Byzantium was the capital of the ancient Eastern Roman Empire. For defense, an army led by a single general was stationed in each fiefdom. The message could only be delivered by messenger. In a war, all generals must reach a consensus and decide whether to go to war together.
However, there may be traitors within the army, and these people will influence the generals to reach a consensus. The Byzantine Generals Problem refers to the problem of how the remaining generals can reach a unanimous decision when one of the generals is known to be a traitor.
BFT:
BFT is Byzantine fault tolerance. Byzantine fault tolerance technology is a type of fault tolerance technology in the field of distributed computing. The Byzantine hypothesis is a modeling of the real world, where computers and networks may behave unpredictably due to hardware errors, network congestion or outages, and malicious attacks. Byzantine fault tolerance techniques are designed to handle these abnormal behaviors and meet the specification requirements of the problem to be solved.
Byzantine fault-tolerant system:
The failed node is called a Byzantine node, and the normal node is a non-Byzantine node.
Assuming that the distributed system has n nodes, and assuming that the entire system has no more than m Byzantine nodes (n ≥ 3m + 1), the Byzantine fault-tolerant system needs to meet the following two conditions:
In addition, the Byzantine fault-tolerant system needs to achieve the following two indicators:
PBFT is the practical Byzantine fault-tolerant algorithm, which solves the problem of inefficiency of the original Byzantine fault-tolerant algorithm. The time complexity of the algorithm is O(n^2 ), so that Byzantine fault tolerance problems can be solved in actual system applications
PBFT is a state machine copy replication algorithm. All copies operate in the process of a view (view) rotation. The master The node is determined by the view number and the set of node numbers, that is: main node p = v mod |R|. v: view number, |R| number of nodes, p: primary node number.
The consensus process of the PBFT algorithm is as follows: the client (Client) initiates a message request (request) and broadcasts it to each replica node (Replica), and one of the master nodes (Leader) initiates a proposal message pre -prepare and broadcast. Other nodes obtain the original message and send prepare messages after the verification is completed. Each node receives 2f+1 prepare messages, that is, it is considered ready and sends a commit message. When the node receives 2f+1 commit messages and the client receives f+1 identical reply messages, it means that the request initiated by the client has reached a network-wide consensus.
The specific process is as follows:
Client c sends a
When the master node receives the client’s request, it needs to perform the following verification:
a. Check whether the client request message signature is correct.
Illegal requests are discarded. For a correct request, a number n is assigned. The number n is mainly used to sort the client's requests. Then broadcast a <
When replica node i receives the PRE-PREPARE message from the master node, the following verification is required:
a. Whether the signature of the master node's PRE-PREPARE message is correct.
b. Whether the current replica node has received a PRE-PREPARE message under the same v and also numbered n, but with different signatures.
c. Whether the abstracts of d and m are consistent.
d. Whether n is within the interval [h, H].
Illegal requests are discarded. Correct request, replica node i sends a
When the master node and replica node receive the PREPARE message, they need to conduct the following verifications:
a. Whether the signature of the replica node's PREPARE message is correct.
b. Whether the current replica node has received n under the same view v.
c. Whether n is within the interval [h, H].
d. Whether d is the same as d in the currently received PRE-PPREPARE
Illegal request is discarded. If replica node i receives 2f+1 verified PREPARE messages, it sends a
When the master node and replica node receive the COMMIT message, they need to conduct the following verifications:
a. Whether the signature of the COMMIT message of the replica node is correct.
b. Whether the current replica node has received n under the same view v.
c. Whether the abstracts of d and m are consistent.
d. Whether n is within the interval [h, H].
Illegal requests are discarded. If replica node i receives 2f+1 verified COMMIT messages, it means that most nodes in the current network have reached a consensus, run the client's request operation o, and return
If the master node does evil, it may assign the same sequence number to different requests, or not allocate sequence numbers, or make adjacent sequence numbers discontinuous. The backup node should have the responsibility to actively check the validity of these sequence numbers.
If the master node goes offline or acts maliciously and does not broadcast the client's request, the client sets a timeout mechanism. If the timeout occurs, the request message is broadcast to all replica nodes. The replica node detects that the master node has done something evil or is offline, and initiates the View Change protocol.
View Change protocol:
The replica node broadcasts
When the master node p = v + 1 mod |R| receives 2f valid VIEW-CHANGE messages, it broadcasts
The replica node receives the NEW-VIEW message from the master node and verifies the validity. If it is valid, it enters the v+1 state and starts PRE-PREPAR in OE message processing flow.
In the above algorithm process, in order to ensure that the previous request can be restored during the View Change process, each replica node records some messages to the local log. After executing the request The replica node needs to clear the record messages of the previous request.
The simplest way is to execute the consensus synchronization of the current state again after the Reply message. This is relatively expensive, so it can be executed after executing multiple requests K (for example: 100). A status synchronization. This status synchronization message is the CheckPoint message.
Replica node i sends
This is an ideal situation. In fact, when the replica node i sends a CheckPoint message to other nodes, the other nodes have not completed K requests, so they will not respond to i's request immediately. It will also follow its own rhythm, moving forward, but the CheckPoint issued at this time does not form stable.
In order to prevent i from processing requests too quickly, set a high and low water level interval [h, H] mentioned above to solve this problem. The low water level h is equal to the number of the previous stable checkpoint, and the high water level H = h + L, where L is the value we specify, which is equal to an integer multiple of the number of requests processed in the checkpoint cycle K, and can be set to L = 2K. When the request processed by replica node i exceeds the high water mark H, it will stop and wait for the stable checkpoint to change before continuing.
In blockchain scenarios, it is generally suitable for private chain and alliance chain scenarios that require strong consistency. For example, in the IBM-led blockchain Hyperledger project, PBFT is an optional consensus protocol. In Hyperledger's Fabric project, the consensus module is designed as a pluggable module and supports consensus algorithms such as PBFT and Raft.
Raft is based on a leader-driven consensus model, in which an outstanding leader (Leader) will be elected, and the Leader will be fully responsible for managing the cluster. Responsible for managing the communication between all nodes in the Raft clusterCopy the log.
In the figure below, the Leader (S1) of the cluster will be selected during the startup process and serve all commands/requests from clients. All nodes in a Raft cluster maintain a distributed log (replicated log) to store and submit commands (log entries) issued by clients. The Leader accepts log entries from clients and replicates them among all followers (S2, S3, S4, S5) in the Raft cluster.
In a Raft cluster, a minimum number of nodes is required to provide the expected level of consensus guarantee, also known as a quorum. The minimum number of votes required to perform an operation in a Raft cluster is (N / 2 +1), where N is the total number of members in the group, that is, at least more than half of the votes, which is why cluster nodes usually have an odd number of nodes. So, in the example above, we need at least 3 nodes to have consensus guarantees.
If the legal quorum node is unavailable for any reason, that is, the votes do not exceed half, the negotiation will not reach an agreement and new logs cannot be submitted.
Data storage: Tidb/TiKV
Log: Alibaba's DLedger
Service discovery: Consul& etcd
< p> Cluster scheduling: HashiCorp NomadCan only accommodate faulty nodes (CFT), not evil nodes
Sequential voting, only serial apply, so high concurrency Poor performance in scenarios
Raft solves the distributed consensus problem by solving the three main sub-problems surrounding Leader election and managing the security functions of distributed logs and algorithms.
When we start a new Raft cluster or a leader is unavailable, a new leader will be elected through negotiation among all member nodes in the cluster. Therefore, in a given instance, a node of a Raft cluster can be in any of the following states: Follower, Candidate, or Leader.
When the system first starts, all nodes are followers. If they do not receive the heartbeat signal from the leader within a period of time, the follower will be converted into a candidate;
If a node A Candidate node receives votes from the majority of nodes, then this Candidate can be converted to Leader, and the remaining Candidate nodes will return to the Follower state;
Once a Leader finds that there is a Leader node in the system with a higher term (Term) than itself, it will be converted to Follower.
Raft uses a heartbeat-based RPC mechanism to detect when a new election starts. During normal times, the Leader will regularly send heartbeat messages to all available Followers (in practice, the log and heartbeat may be sent together). Therefore, the other node starts in the Follower state and remains in the Follower state as long as it receives periodic heartbeats from the current Leader.
When the Follower reaches its timeout, it will start the election process in the following way:
Based on the responses that the Candidate receives from other nodes in the cluster, the three steps for the election can be derived result.
The implementation of consensus algorithms is generally based on replicated state machines. What is a replicated state machine:
In simple terms: the same initial recognition state + the same input = Same end state. Different nodes should use the same and deterministic function to process input, rather than introducing uncertain values, such as local time, etc. It is a good idea to use replicated log. Log has the characteristics of persistence and order preservation, and is the cornerstone of most distributed systems.
With the Leader, all concurrent requests from the client can form an orderly log (status) sequence on the Leader's side to represent the order in which these requests are processed. The Leader then sends its log sequence to the Followers to maintain the global consistency of the entire system. Note that this is not strong consistency, but eventual consistency.
The log consists of log entries with a sequential number (log index). Each log entry consists of the term when it was created, and the data contained in the log, which can be of any type, from simple types to blocks of the blockchain. Each log entry can be represented by a [term, index, data] sequence pair, where term represents the term, index represents the index number, and data represents the log data.
The Leader attempts to execute replication commands on most nodes in the cluster.make. If the replication is successful, the command is submitted to the cluster and the response is sent back to the client. Similar to two-phase commit (2PC), but the difference from 2PC is that the leader only needs the consent of more than half of the nodes (in a working state).
Both leader and follower may crash, so the log maintained by the follower may have the following situation compared with the leader
When the leader and follower are inconsistent, the leader forces the follower to copy its own log, the Leader will try from back to front. Each time AppendEntries fails, it will try the previous log entry (decrementing the nextIndex value) until it successfully finds the consistent position point of each Follower's log (based on the two guarantees mentioned above), and then moves backward one by one. Overrides the Followers entry after this position. So missing or extra entries may persist for multiple terms.
Requires the candidate's log to be at least as up-to-date as other nodes. If not, the follower node will not vote for the candidate.
Means that each submitted entry must exist in at least one of these servers. If a candidate's log is at least as up-to-date as the other logs in the majority, it will save all committed entries, avoiding a log rollback event.
That is, at most one leader can be elected in any term. This is very important, there can only be one leader in a replica set at any time. There is more than one leader in the system at the same time, which is called brain split. This is a very serious problem and will cause data coverage loss. In raft, two points guarantee this property:
Therefore, there must be only one leader in a certain term.
When the status of nodes in the cluster changes (the cluster configuration changes), the system is vulnerable to system failure. So, to prevent this, Raft uses something called a two-phase approach to changing cluster membership. Therefore, in this approach, the cluster first changes to an intermediate state (called federated consensus) before implementing a new membership configuration. Federated consensus enables the system to be used to respond to client requests even when transitioning between configurations, and its main purpose is to improve the availability of distributed systems.
『撒』 The entire system of the blockchain uses a large number of cryptographic algorithms, and the more representative one is the hash algorithm used for PoW.
The entire system of the blockchain uses a large number of cryptographic algorithms, and the more representative one is the hash algorithm used for PoW. Zheng Zheng didn't know how to solve the chaos, soThe editor collects and organizes for everyone that cryptographic algorithms are widely used in the entire blockchain system, and the more representative one is the hash algorithm used for PoW. If you are interested, come and take a look at the solution.
The entire system of the blockchain uses a large number of cryptographic algorithms, and the more representative one is the hash algorithm used for PoW.
A. Correct
B. Wrong
Correct answer: A
The encryption algorithm in blockchain technology plays a crucial role. In addition to hashing algorithms for PoW, there are also symmetric and asymmetric encryption algorithms for encrypted data transmission, digital signature algorithms, etc. These algorithms ensure the security, immutability and anonymity of the blockchain.
『8』What is the blockchain hash algorithm?
The hash algorithm is also called "hash" and is one of the four core technologies of the blockchain. one. It is an algorithm that can calculate a fixed-length string (also called message digest) corresponding to a digital message. Since a piece of data has only one hash value, the hash algorithm can be used to check the integrity of the data. The use of hashing algorithms is very common in the application of fast search and encryption algorithms.
In the Internet age, although the distance between people is closer, the trust problem has become more serious. The technical architecture of existing third-party intermediary organizations is private and centralized. This model can never fundamentally solve the problems of mutual trust and value transfer. Therefore, blockchain technology will use a decentralized database architecture to complete data interaction trust endorsement and achieve a major step forward in global mutual trust. In this process, hashing algorithms play an important role.
The hash algorithm is a one-way cryptographic mechanism in the blockchain that ensures that transaction information is not tampered with. Blockchain uses a hashing algorithm to encrypt transactions in a transaction block and compress the information into a hash string consisting of a series of numbers and letters. The blockchain’s hash value uniquely and accurately identifies a block. When verifying the authenticity of a block, you only need to simply calculate the hash value of the block. If there is no change, it means that the information on the block has not been tampered with.
The Xueshuo Innovation Blockchain Technology Workstation under Lianqiao Education Online is the only "Smart Learning Factory 2020- Xueshuo Innovation Workstation" launched by the School Planning and Construction Development Center of the Ministry of Education of China. Approved "Blockchain Technology Professional" pilot workstation. The professional base is based on providing students with diversified growth paths, promoting the reform of the training model integrating professional degree research, production, and research, and building an applied and compound talent training system.
『九』 Six core algorithms of blockchain technology
Six core algorithms of blockchain technology
Blockchain core algorithm one: Byzantine Agreement
The story of Byzantium goes something like this: The Byzantine Empire has huge wealth, and its 10 neighboring countries have been around for a long time. However, Byzantium’s high walls are towering and impregnable, and no single neighbor can successfully invade. any single neighborAnyone who invades will fail, and it is also possible that it will be invaded by the other 9 neighbors. The Byzantine Empire's defensive capabilities were so strong that at least half of its ten neighbors had to attack at the same time to be able to break through. However, if one or several of the neighbors agree to attack together, but betrayal occurs during the actual process, then the invaders may all be annihilated. So each party acted cautiously and did not dare to trust its neighbors easily. 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 be used to verify the identity. If any messages are inconsistent, you can know which generals the messages are inconsistent with. Even if there is inconsistent information, as long as more than half agree to attack, the minority obeys the majority, and a consensus is reached.
Thus, in a distributed system, although there are bad guys, bad guys can do anything (not restricted by the protocol), such as not responding, sending error messages, sending different decisions to different nodes, and combining different wrong nodes. Get up and do bad things, etc. However, as long as most 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 Byzantine Agreement, if one of the 10 generals Several messages initiated at the same time will inevitably cause chaos in the system, causing each to have its own attack time plan, making it difficult to act in a consistent manner. Anyone can initiate offensive information, but who will send it? In fact, this only requires adding a cost, that is: only one node can spread the information within a period of time. When a node sends a unified attack message, each node must sign and stamp the message from the initiator to confirm their identity.
It seems today that asymmetric encryption technology can completely solve this signature problem. The asymmetric encryption algorithm uses two different keys for encryption and decryption. These two keys are the "public key" and "private key" that we often hear. Public keys and private keys generally appear in pairs. If a message is encrypted with a public key, the private key corresponding to the public key is required to decrypt it; similarly, if a message is encrypted with a private key, the public key corresponding to the private key is required to decrypt it.
Blockchain Core Algorithm Three: Fault Tolerance Issue
We assume that in this network, messages may be lost, damaged, delayed, sent repeatedly, and the order received is inconsistent with the order sent. In addition, the behavior of nodes can be arbitrary: they can join and exit the network at any time, they can discard messages, forge messages, stop working, etc. Various human or non-human failures may also occur. Our algorithm provides excellent fault tolerance for a consensus system composed of consensus nodes. This fault tolerance includes both security and availability, and is applicable to any network environment.
Blockchain core algorithm 4: Paxos algorithm (consensus algorithm)
The problem solved by the Paxos algorithm is how a distributed system can reach agreement on a certain value (resolution). A typical scenario is that in a distributed dataIn a library system, if the initial state of each node is consistent and each node performs the same sequence of operations, then they can finally obtain a consistent state. In order 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 issue in distributed computing. There are two models for node communication: shared memory and message passing. The Paxos algorithm is a consensus algorithm based on the message passing model.
Blockchain Core Algorithm Five: Consensus Mechanism
The blockchain consensus algorithm is mainly proof of work and proof of equity. Taking Bitcoin as an example, in fact, from a technical point of view, PoW can be regarded as reused Hashcash. Generating proof of work is a random process in terms of probability. To mine a new confidential currency, when generating a block, all participants must agree, and the miner must obtain PoW proof of work for all data in the block. At the same time, miners must constantly observe and adjust the difficulty of this work, 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 combines these dispersed storage resources into a virtual Storage devices, data are dispersedly stored in every corner of the network. Therefore, distributed storage technology does not store complete data on each computer, but splits the data and stores it in different computers. It's like storing 100 eggs, not in the same basket, but in different places. The total sum is 100.