As a huawei cloud information giant, Reading Knowledge Cloud is good at presenting complex information in a diversified way. There is always a picture (cloud map), profound and simple blog (cloud class) or short video (cloud vision hall) that can make you quickly start huawei cloud. Click here for more highlights.
Abstract: Blockchain is a decentralized distributed ledger database. Based on the characteristics of decentralization and distribution, the blockchain system will face the problem of consistency and trust. How to make the untrusted parties reach consensus? At this time, we need to rely on reliable consensus algorithm.
This article is shared from huawei cloud community “[Cloud small class] application platform lesson 18 one of the key technologies of blockchain: consensus algorithm”, author: application kaleidoscope.
So what exactly is a consensus algorithm?
In basketball, for example, everyone has to agree on the rules of the game in order for the game to proceed normally. In simple terms, consensus algorithm refers to a set of rules that make all participants agree on a certain result through algorithmic means in a blockchain network.
Why does blockchain need consensus algorithms
If there were no consensus algorithm, in a decentralized blockchain network, each participant would have a ledger, and anyone could tamper with the contents of the ledger and claim that their own ledger is legitimate, the system would be in a mess. As the core and foundation of blockchain technology, consensus algorithm is just like the law of a country, enabling blockchain to realize the decentralization of transactions, while ensuring the consistency and correctness of each transaction on all ledger nodes, and being recognized by all participants.
So how does bitcoin, the first application of blockchain technology, solve this problem? Satoshi Nakamoto mentioned in bitcoin’s white paper that PoW (Proof of Work) is regarded as the consensus algorithm of bitcoin. PoW is simply understood as the right to snatch decision-making rights through Work. The more Work you pay, the more chances you have to obtain accounting rights (such as bitcoin).
Besides proof-of-work, what are the common consensus algorithms in blockchain systems?
Example of consensus algorithm
Due to the decentralization, openness, scalability and other characteristics of blockchain system, different consensus algorithms are needed to realize different application scenarios, so there are many types of consensus algorithms, such as Proof of Work (PoW), Proof ofStake (PoS), DPoS (Delegated Proof of Stake), Practical Byzantine Fault Tolerance algorithm PBFT (Delegated Proof of Stake), PoA (Proof of Authority), Delegated Proof of Stake Use Time to prove PoET (Proof of Elapsed Time), PoC (Proof of Capacity), PoSpace (Proof of Space), etc.
Next, we briefly introduce the three common consensus algorithms in blockchain applications: Proof of Work (PoW), Proof of Stake (PoS), and Delegated Proof of Stake (DPoS). As shown in the figure:
Table 1-1 shows the comparison of the three consensus algorithms:
Table 1-1 Consensus algorithms
In general, each consensus algorithm has its own advantages, so it is necessary to select the appropriate algorithm according to the actual application scenarios.
Workload proof PoW mainly depends on computer performance to decide bookkeeping, the higher the performance, the more chance to obtain bookkeeping rights; But this can lead to a huge waste of resources. At this time, PoS of proof of equity appeared, which mainly solved the problem that a large number of resources were wasted in PoW mechanism. That is, the longer the participant holds the coin, the simpler the problem will be, and the higher the probability of finding the coin will be. But it is easy to create monopolies. DPoS is designed based on PoS, which is similar to consensus algorithm of voting. One of the biggest advantages of DPOS over PoW and PoS is that the consensus cycle is much shorter.
Application of consensus algorithm in Huawei Cloud
Huawei cloud BlockchainService (BCS) supports Hyperledger Fabric enhanced edition and huawei chain service. It mainly applies fast Byzantine fault-tolerant consensus algorithm (FBFT) and Raft(CFT) consensus algorithm. Please see the following figure for an introduction of the two consensus algorithms:
HyperledgerFabric enhancements: support for fast Byzantine fault tolerant consensus algorithm (FBFT) and Raft(CFT) consensus algorithm.
Hyperledger Fabric as the kernel, based on huawei cloud full stack trust capability, including elastic server, enterprise container, security and artificial intelligence services, under the premise of maintaining seamless community connection, the reliability, performance, and privacy protection has been enhanced and improved to meet the requirements of enterprise and financial services.
2, Huawei chain services: support Raft(CFT) consensus algorithm.
With the BCS independently developed blockchain kernel as the base, combined with trusted hardware, it has the characteristics of high security, high performance, high scalability, strong privacy protection, etc., to meet the trust and collaboration requirements of enterprise and financial levels.
Next up
After listening to the introduction of blockchain consensus algorithm, do you feel very magical? Next time, xiaobian will continue to study and discuss blockchain technology: smart contracts, please look forward to, remember to pay attention to oh ~~
[Follow-up] More blockchain knowledge for you to unlock oh ~~
Click to follow, the first time to learn about Huawei cloud fresh technology ~