Introduction to the consensus mechanism of China Mobile Chain

01

Why consensus is needed

Consensus is a common view on something. It is the soul of the blockchain and plays a vital role in ensuring the integrity and security of the blockchain. In traditional centralized systems, a single entity or a group of entities has the authority to verify and record transactions. However, a core concept in blockchain is decentralization. In blockchain, there is no central database like traditional database systems. Each node is peer-to-peer. For example, most blockchains use peer-to-peer networks ( Peer-to-peer network, P2P network) to organize nodes participating in data verification and production. Each node in the P2P network interacts with each other in a flat topology. It is a difficult problem to ensure the uniformity and security of transactions. This requires a set of algorithms and mechanisms to ensure that all peer nodes can effectively collaborate. This set of algorithms and methods It’s called a consensus mechanism. The existence of the consensus mechanism can effectively ensure that each node jointly maintains the ledger according to established principles, verifies and confirms transactions, and reaches unanimous decisions. The consensus mechanism is essentially a mathematical algorithm that establishes trust and obtains rights and interests between different nodes in the blockchain system.

With the continuous development of blockchain technology, many versions of consensus mechanisms have also been developed to meet the needs of different blockchain systems. Today’s mainstream consensus mechanisms are as follows:

consensus mechanism introduce Advantages and Disadvantages
Proof of Work (PoW) It is the earliest consensus mechanism adopted by Bitcoin and some other blockchain projects. Nodes compete for the right to produce blocks by solving complex mathematical puzzles. The first node with the correct answer can get the block reward. This mechanism requires a lot of computing power and is more secure, but consumes more energy.

Advantages: High security, verified by Bitcoin for many years. Complex mathematical problems need to be calculated to ensure that nodes create new blocks by solving the problems, thereby preventing attacks from malicious nodes.

Disadvantages: Huge computer resource consumption requires a large amount of computing power, which limits the scalability of the network. Accounting rights are easily concentrated in the hands of miners with large amounts of computing power.

Proof of Stake (PoS) The generation and verification rights of nodes depend on the number of tokens they hold. Nodes with more tokens have a greater chance of producing blocks and verifying transactions without having to perform a lot of calculations, saving energy. Variants of PoS are DPoS (Delegated Proof of Stake) and multiple versions of PoS.

Advantages: Computing resource consumption is low, no large amount of calculation is required, and the right to produce blocks is obtained by mortgaging tokens. Can improve network scalability.

Disadvantages: It may lead to a "rich get richer" situation, because nodes with more tokens have greater influence. There may be a "token stacking" problem, where one entity owns too many tokens and controls the entire network.

Byzantine Fault Tolerance (BFT) In a distributed system, there are problems such as communication between nodes may fail, messages may be delayed, nodes may crash, etc. These problems may lead to the failure of the consensus protocol. The BFT consensus algorithm is designed to deal with these problems and ensure that the system can still reach a consensus while tolerating up to a certain number of node failures.

Advantages: Suitable for alliance chains and private chains, with high security and efficiency. Allows consistency to be maintained in the event of node failure or attack.

Disadvantages: It is generally difficult to implement and requires complex coordination and communication between nodes. There may be performance limitations.

Delegated Proof of Stake (DPoS) DPoS is an extension of PoS. Representative nodes are selected to be responsible for producing blocks and verifying transactions, improving network performance and scalability.

Advantages: By electing representatives to execute block generation, the efficiency and scalability of the network are improved. Transaction confirmation is faster.

Disadvantages: May lead to centralization because only a few representatives are producing blocks. Depends on the honesty and activity of production nodes.

Proof of Authority (POA) It is designed to solve some of the problems faced by traditional blockchain consensus mechanisms (such as Proof of Work and Proof of Stake). Rather than gaining authority by solving computational puzzles or staking tokens, the network’s nodes gain authority based on the node’s identity and trust, with transactions verified and confirmed by known authoritative entities or pre-selected validators. This makes POA have certain centralization characteristics, but also gives the network higher performance and scalability.

Advantages: High throughput and low latency, suitable for fast transaction confirmation. Computing resource consumption is low and does not require extensive calculations. Security is predictable and tied to validator reputation.

Disadvantages: centralization risk, centralized selection of validators. Relies on the trust of validators and is vulnerable to attacks.

Generally speaking, each consensus mechanism has its own applicability in different projects and application scenarios. Choosing an appropriate consensus mechanism requires considering factors such as project needs, performance requirements, security requirements, and community governance. With the continuous development of technology, new consensus mechanisms may appear in the future or existing mechanisms may be improved to meet changing needs.

02

Consensus of China Mobile Chain

In China Mobile Chain, a consensus mechanism combining Delegated Proof of Stake (DPoS) and aBFT (Asynchronous Byzantine Fault Tolerance) is used. Delegated Proof of Stake (DPoS) is used to select active producers who will be authorized to produce blocks in the network. Asynchronous Byzantine Fault Tolerance involves the transaction confirmation process and the actual process until it becomes final (irreversible).

Based on the core idea of ​​DPoS consensus, China Mobile Chain generates multiple production nodes through elections, and the elected production nodes take turns to generate blocks in order. The producer produces a block every 0.5 seconds, and each producer can produce 12 blocks continuously, which means it has a continuous block production time of 6 seconds. At any time, only one producer is authorized to produce blocks. If the block is not successfully generated within a certain period of time, the block will be skipped. In this way, even if there is a problem with a certain production node, the blockchain network can still operate normally. The overall consensus process is roughly as follows:

picture

  • Voting weight: For each account, divide the number of tokens it holds by the total number of tokens to get a ratio. This ratio is the voting weight of the account, which reflects the account’s proportion of tokens in the entire network. .

  • Select production nodes: As production nodes, block producers need to be selected through a voting system. Production nodes are responsible for maintaining the security and stability of the blockchain. Normally, there is a fixed number of production nodes in the China Mobile Chain network to ensure the stability of the chain. At the same time, the rewards and transaction fees generated by the blocks in EOS are cancelled, and are managed by a unified resource administrator to ensure the stability of node resources.

  • Production nodes take turns producing blocks: Once representative nodes are elected as production nodes, they have the right to take turns producing blocks. The production nodes execute block generation tasks in sequence according to the pre-agreed time interval (default is 0.5 seconds). This arrangement ensures block continuity and allows transactions to be confirmed and processed quickly.

  • Block generation and verification: When production nodes take their turn to perform block generation tasks, they package and confirm a batch of pending transactions. These transactions are then written into new blocks and appended to the end of the blockchain. The process of block generation usually involves signing and verifying transactions to ensure their validity and security.

  • Block Validation: When more than 2/3+1 validators confirm a block on their local blockchain, the block is considered to be agreed by the majority of validators. Once a block is confirmed by a majority of validators, it is considered an "irreversible block", that is, it cannot be changed.

It is important to note that transaction confirmation time also depends on network congestion and transaction complexity. High trading volumes or complex transactions may cause delays in confirmation times. Therefore, in actual operation, it is recommended to determine the waiting confirmation depth based on network conditions and the importance of the transaction to ensure the security and irreversibility of the transaction.

03

Consensus security

Consensus security is a crucial concept in blockchain systems, which refers to the process of ensuring that all nodes in the network agree on the state of the blockchain. In the blockchain, the consensus mechanism determines which nodes have the power to add new blocks to the blockchain, and determines the degree of recognition of transactions and status by all nodes in the network. Consensus security has an important impact on the stability, security and credibility of the blockchain system. China Mobile Chain mainly achieves consensus security through the following points:

  • Decentralization: A large number of block producers are selected through voting in China Mobile Chain. This decentralized approach ensures that power is distributed among multiple entities rather than concentrated in the hands of a few. The more decentralized the network is, the harder it is for malicious actors to collude and compromise the system.

  • Block production mechanism: Production nodes take turns producing blocks, which not only provides higher performance and throughput, but also ensures the continuity of the blockchain network. Each representative node has a certain period of time to produce blocks. Even if a node has a temporary problem or is offline, other nodes can still continue to produce blocks, avoiding the stagnation of the entire network. At the same time, production nodes need to abide by consensus rules and generate blocks according to the agreed time, otherwise they may lose the qualification to produce blocks and face penalties. Such a mechanism helps prevent the behavior of malicious nodes and protect the security of the network.

  • Penalty mechanism: If a representative node violates consensus rules or behaves maliciously, it may be penalized. For example, if a representative node engages in double-spend attacks, delays in producing blocks, or refuses to confirm legitimate transactions, other nodes can initiate a vote to remove it. The penalty mechanism ensures that production nodes must abide by consensus rules and maintain network security.

  • Irreversible Block Confirmation: In ZTE, once a block is confirmed by a specific number of subsequent blocks, it becomes irreversible. This feature ensures that transactions recorded in confirmation blocks are immutable, guaranteeing the permanent credibility of transactions.

  • Regular upgrade cycle: China Mobile Chain will be upgraded and improved regularly. These upgrades help address any potential security vulnerabilities and ensure the network is up to date with the latest security best practices.

It is important to note that no consensus mechanism is completely immune to security risks, and continued vigilance and improvement are critical to maintaining a secure blockchain ecosystem.

04

Summarize

China Mobile Chain is a China Mobile blockchain service platform built on the premise of meeting my country's information regulatory needs and being compliant and controllable. Among them, the consensus mechanism is the core mechanism to ensure the security and stability of the blockchain. Different from traditional centralized systems, blockchain consensus refers to the process in which all nodes in the network reach agreement on the validity and order of transactions. Consensus can ensure the unity of node transaction status. Lack of consensus makes the blockchain lose its reliability and tamper-proof properties. China Mobile Chain uses the DPoS (Delegated Proof of Stake) consensus algorithm to select active producers, combined with the aBFT (Asynchronous Byzantine Fault Tolerance) consensus algorithm for fast transaction confirmation, ensuring network continuity and faster transaction speed, and ensuring block The chain system is safe and efficient.

References

[1]BSN open alliance chain:

https://opb.bsnbase.com/main/index

[2] Official EOSIO consensus introduction:

https://developers.eos.io/welcome/latest/protocol-guides/consensus_protocol#3-eosio-consensus-dpos--abft

[3] Official EOSIO white paper:

https://github.com/EOSIO/Documentation/blob/master/TechnicalWhitePaper.md

[4]Official EOSIO core concepts:

https://developers.eos.io/welcome/latest/introduction-to-eosio/core_concepts

Guess you like

Origin blog.csdn.net/BSN_yanxishe/article/details/134437979
Recommended