A hybrid blockchain consensus method based on DAG

By combining POW, DPOS and PBFT protocols in the blockchain consensus protocol, the main chain block determination algorithm is designed to solve the trade-off between blockchain performance and security and achieve high throughput and decentralized zones. The blockchain system ensures the irreversibility and security of transactions.

CN117812085BActive Publication Date: 2024-08-27EAST CHINA NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310528285.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-11
Publication Date
2024-08-27
Estimated Expiration
2043-05-11

AI Technical Summary

Technical Problem

The existing blockchain consensus protocol is difficult to balance between performance and security. The POW protocol consumes resources and is vulnerable to computing power attacks. The decentralized nature of the POS protocol is weakened. The security and stability of the DAG protocol are insufficient.

Method used

Adopt a hybrid blockchain consensus method based on DAG, combine POW, DPOS and PBFT protocols, package transactions into blocks through the POW mechanism, use DPOS and PBFT mechanisms for transaction confirmation, and design the main chain block determination algorithm to ensure that blocks The security and decentralization characteristics of the chain.

Benefits of technology

It achieves a high-throughput blockchain system, avoids waste of resources, ensures the irreversibility and decentralization of transactions, eliminates the emergence of super nodes, and improves the security and stability of the blockchain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117812085B
    Figure CN117812085B
Patent Text Reader

Abstract

The present invention discloses a hybrid blockchain consensus method based on DAG, which belongs to the technical field of blockchain consensus protocol, and includes the following steps: (1) using the POW mechanism to package transactions and block them, and using a new blockchain consensus protocol architecture that integrates the DPOS mechanism and the PBFT mechanism to confirm transactions; (2) in the core transaction confirmation stage, designing a main chain block determination algorithm. The present invention adopts a hybrid blockchain consensus method based on DAG of the above mechanism, and adopts a method combining DPOS and PBFT to avoid resource waste; once the transaction is confirmed, it is irreversible, ensuring the security of the blockchain; the decentralized characteristics of the DPOS mechanism have been strengthened compared to the traditional POS, fundamentally eliminating the emergence of super nodes, and having high decentralization characteristics and security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of blockchain consensus protocols, and in particular to a hybrid blockchain consensus method based on DAG. Background Art

[0002] The consensus mechanism is a very core part of the blockchain technology system. Consensus means that all participating nodes in the network reach a consistent understanding of a certain information. The consensus mechanism is a set of consensus methods designed to reach consensus. Common consensus mechanisms include POW, POS, DPOS, PBFT, etc.

[0003] 1. Single-chain POW consensus protocol: The POW consensus mechanism is a proof-of-work mechanism, which requires a certain amount of work to prove that it has completed the conditions required for consensus.

[0004] 2. DAG-based POW consensus protocol: The Conflux consensus protocol is a high-performance blockchain solution based on DAG. The underlying DAG structure enables it to have high concurrent processing capabilities and significantly improves throughput. At the same time, its shortcomings are also obvious. Although Conflux has adopted a variety of means to improve system security, since it is still a POW consensus mechanism, it is also based on computing power and consumes resources. Secondly, its block generation speed is much higher than that of the Nakamoto consensus encrypted digital currency, so its requirement for computing power is also much lower than that of the Nakamoto consensus encrypted digital currency. Therefore, its security cannot be guaranteed and it is easily attacked by computing power. Its security and stability are not optimistic.

[0005] 3. POS consensus protocol: POS consensus protocol is a proof-of-stake mechanism. It does not require proof of workload, but uses "coin age" to prove that it has completed the conditions required for consensus. The current concept of "coin age" is a kind of accumulation of rights and interests that is a combination of factors such as the tokens owned by the certifier and the time of holding the tokens. The greater the "coin age", the higher the rights and interests, the greater the possibility of producing blocks, and the easier it is to reach consensus. Although the POS consensus protocol avoids the massive consumption of resources, its core attribute of decentralization is weakened, and it may gradually become a centralized product. The DPOS consensus protocol is similar to POS, but the difference is that it adds an election process, which is more decentralized than the POS consensus protocol.

[0006] Therefore, a new blockchain consensus method needs to be proposed to solve the above problems. Summary of the invention

[0007] The purpose of the present invention is to provide a hybrid blockchain consensus method based on DAG, which adopts a method combining DPOS and PBFT to avoid waste of resources; once a transaction is confirmed, it is irreversible, ensuring the security of the blockchain; compared with traditional POS, the decentralized feature of the DPOS mechanism has been strengthened, fundamentally eliminating the emergence of super nodes, and has high decentralization and security.

[0008] To achieve the above object, the present invention provides a hybrid blockchain consensus method based on DAG, comprising the following steps:

[0009] (1) A new blockchain consensus protocol architecture that uses the POW mechanism to package transactions and confirm transactions by integrating the DPOS mechanism with the PBFT mechanism;

[0010] (2) In the core transaction confirmation phase, design the main chain block determination algorithm.

[0011] Preferably, the working body for transaction confirmation in step (1) is the transaction execution committee.

[0012] Preferably, the main chain block determination algorithm is divided into four models, namely, the determination of the genesis block, the determination of the block structure height to be determined is less than three generations, the determination of N (N≥1) chains with the same weights, and the determination of N (N≥1) chains with different weights.

[0013] Preferably, the genesis block is actively generated by the system.

[0014] Preferably, the determination of the genesis block and the structural height of the block to be determined are less than three generations, and no main chain block is generated. The generation of the main chain block must meet the condition that the structural height of the block to be confirmed is not less than three generations.

[0015] Preferably, when the weights of the N (N≥1) chains are the same, determining the main chain block includes the following steps:

[0016] S21. There are a, b, x, ... n blocks, s(a) is the cumulative weight value of block a, and among the n blocks, there are any two or more blocks s(p) = s(q) ... = s(h) and s(p)> s(k), k is any block other than p, q ... h;

[0017] S22. Define m1=Min(T(p),T(q),...T(h)) as the block with the smallest block generation timestamp among blocks p, q...h. In this case, the main chain block B=m1.

[0018] S23. When T(p)=T(q)...T(h), define m2=Min(Hash(p), Hash(q), ...Hash(h)), where m2 is the block with the smallest hash value. At this time, the main chain block B=m2.

[0019] Preferably, when the weights of the N (N≥1) chains are different, the determination of the main chain block includes the following steps:

[0020] S31. According to the predecessor block pointed to by the block, trace back until the main chain block R appears, and determine the current block structure model;

[0021] S32, starting from the leaf node, find the cumulative weight value S(x) of each node outside the leaf node;

[0022] S33, V1, V2, V3, ..., V n Represents the nodes of each generation with the largest weight, where V1 is the child node of R, V2 is the child node of V1, and so on. V1, V2, V3, ..., V n Store them in order into the sequence list L, where L[0]=V1, and then execute the algorithm.

[0023] Preferably, the algorithm in S33 is:

[0024] while len(L)>=3:

[0025] assign L[0]=main chain block

[0026] L.pop() / / Delete the last element in L

[0027] return L.

[0028] Therefore, the hybrid blockchain consensus method based on DAG of the present invention has the following beneficial effects:

[0029] (1) The present invention proposes a new blockchain consensus protocol based on DAG, which integrates the three consensus protocols of POW, DPOS, and PBFT. This consensus protocol has a high throughput, solves the performance bottleneck problem of the blockchain system, and at the same time, the decentralized characteristics are also guaranteed.

[0030] (2) Transactions are packaged and blocked by POW, and transaction confirmation and execution are achieved through the combination of DPOS and PBFT consensus protocols. The present invention separates the packaging and execution of transactions, so the POW mechanism does not affect the DPOS and PBFT mechanisms.

[0031] (3) The difficulty of the POW mechanism designed by the present invention is much lower than that of the Nakamoto consensus encrypted digital currency, so the resource consumption is also much lower than that of the Nakamoto consensus encrypted digital currency, but the indispensable reason is that setting a certain threshold can avoid some common attacks on the blockchain, such as flooding attacks. The core of the present invention is the transaction confirmation stage, which adopts the method of combining DPOS with PBFT to avoid resource waste; once the transaction is confirmed, it is irreversible, ensuring the security of the blockchain; the decentralized characteristics of the DPOS mechanism have been strengthened compared to the traditional POS, fundamentally eliminating the emergence of super nodes, and having high decentralization and security.

[0032] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is a consensus framework diagram of the transaction confirmation phase of an embodiment of a hybrid blockchain consensus method based on DAG of the present invention;

[0034] Figure 2 This is a model diagram of a block structure with a height of less than three generations to be confirmed in an embodiment of a hybrid blockchain consensus method based on DAG of the present invention;

[0035] Figure 3 This is a model diagram of an embodiment of a hybrid blockchain consensus method based on DAG in the present invention when the weights of N (N≥1) chains are the same;

[0036] Figure 4 This is a model diagram of an embodiment of a hybrid blockchain consensus method based on DAG in the present invention when the weights of N (N≥1) chains are different;

[0037] Figure 5 A diagram of the generation process of an "unqualified" block in an embodiment of a hybrid blockchain consensus method based on DAG of the present invention;

[0038] Figure 6 A comparison chart of the throughput of an embodiment of a hybrid blockchain consensus method based on DAG of the present invention;

[0039] Figure 7 Model diagram for cumulative weights. DETAILED DESCRIPTION

[0040] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.

[0041] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.

[0042] Before describing the present invention, a basic concept is introduced: cumulative weight, such as Figure 7 As shown:

[0043] exist Figure 7 In the example, the weight of each block is 1, and the cumulative weight of all leaf nodes is S(Y)=S(Q)=S(L)=S(T)=S(V)=1. For node X, it is the parent node of leaf node Y, and the cumulative weight of node X is S(X)=S(Y)+1=2. Similarly, the cumulative weight of node C is S(C)=S(F)+1=9. The same can be said for other nodes: S(O)=S(S)+1=3, S(P)=S (T)+1=2, S(K)=S(O)+S(P)+1=3+2+1=6, S(H)=2, S(E)=4, S(D)=S(G)+S(H)+1=S(K)+1+ S(H)+1=6+1+2+1=10, S(B)=S(D)+S(E)+1=10+4+1=15, S(A)=S(B)+S(C)+1=15+9+1=25.

[0044] Example

[0045] The present invention proposes a hybrid blockchain consensus method based on DAG, which includes the following two aspects:

[0046] (1) Propose a new blockchain consensus protocol architecture that uses a relatively low-difficulty POW mechanism to package transactions and a mechanism that integrates the DPOS mechanism and the PBFT mechanism to confirm transactions;

[0047] (2) In the core transaction confirmation stage, a main chain block determination algorithm is designed. This algorithm maintains and ensures the security and stability of the blockchain system.

[0048] The Transaction Execution Committee is the working body for the transaction confirmation stage. The PBFT consensus and the main chain block determination algorithm are completed by this body. Once the transaction confirmed by the Transaction Execution Committee is released, it cannot be changed. The consensus architecture diagram of the transaction confirmation stage is as follows: Figure 1 As shown in the consensus architecture diagram of the transaction confirmation phase, it can be seen that after the master node and the slave node successfully reach PBFT consensus, the transaction execution committee further executes the main chain block determination algorithm, confirms the final block structure, sorts the transactions, and then executes them and publishes them to the entire network.

[0049] The main chain block determination algorithm is divided into four model situations: one is the determination of the genesis block, two is the height of the block structure to be determined is less than three generations, three is the weights of N (N≥1) chains are the same, and four is the weights of N (N≥1) chains are different.

[0050] The genesis block is actively generated by the system.

[0051] The situation where the block height is less than three generations is as follows Figure 2 As shown, block a is the main chain block determined by the last consensus, and blocks b, c, d, and e are ordinary blocks determined after the success of this PBFT consensus. At this time, the main chain block structure height to be confirmed has two generations, and no main chain block is generated. The generation of the main chain block must meet the condition that the height of the block structure to be confirmed is not less than three generations.

[0052] like Figure 3 As shown, when N (N≥1) chains have the same weight, the algorithm rules for determining the main chain block include the following steps:

[0053] S21. There are a, b, x, ... n blocks, s(a) is the cumulative weight value of block a, and among the n blocks, there are any two or more blocks s(p) = s(q) ... = s(h) and s(p)> s(k), k is any block other than p, q ... h;

[0054] S22. Define m1=Min(T(p),T(q),...T(h)) as the block with the smallest block generation timestamp among blocks p, q...h. In this case, the main chain block B=m1.

[0055] S23. When T(p)=T(q)...T(h), define m2=Min(Hash(p), Hash(q), ...Hash(h)), where m2 is the block with the smallest hash value. At this time, the main chain block B=m2.

[0056] like Figure 4 As shown, when the weights of N (N≥1) chains are different, the algorithm rules for determining the main chain block include the following steps:

[0057] S31. According to the predecessor block pointed to by the block, the source is continuously traced until the main chain block R appears, and the current block structure model is determined;

[0058] S32, starting from the leaf node, find the weight value S(x) of each node outside the leaf node;

[0059] S33, V1, V2, V3, ..., V n Represents the nodes of each generation with the largest weight, where V1 is the child node of R, V2 is the child node of V1, and so on. V1, V2, V3, ..., Vn Store them in order into the sequence list L, where L[0] = V1, and then execute the following algorithm:

[0060] while len(L)>=3:

[0061] assign L[0]=main chain block

[0062] L.pop() / / Delete the last element in L

[0063] return L

[0064] The above three situations are the situations that legal blocks may encounter when they are performing the main chain block determination algorithm. In addition, after the PBFT consensus is completed, a "unqualified" block may be generated. These blocks do not participate in the main chain block determination algorithm. The following introduces the identification of "unqualified" blocks:

[0065] like Figure 5 As shown in the figure, the working process of generating "unqualified" blocks is as follows: the main chain blocks issued by the Transaction Execution Committee are a, b, c, and d. After the new transaction collection and packaging and PBFT synchronization process, the f1-f10 blocks are the block structure diagram after the second PBFT synchronization of the Transaction Execution Committee. If the published block structure contains f1-f10 color blocks, then according to the main chain block determination algorithm rules, the new main chain blocks are a, b, e, and f1. The main chain blocks are changed, and the stability of the blockchain system is greatly damaged. Since we stipulate that the main chain blocks issued by the Transaction Execution Committee cannot be changed, it is necessary to define f1-f10 blocks as unqualified blocks. In order to avoid the blocks issued by the Transaction Execution Committee being unqualified blocks in the future, it is stipulated that f1-f10 blocks will not be issued by the Transaction Execution Committee. Although this sacrifices a little throughput, it enhances the security and stability of the blockchain system and is an indispensable rule.

[0066] The present invention separates transaction packaging from execution, and designs the synchronization time interval of the transaction execution committee to be 10 seconds. The experiment has a total of five servers A, B, C, D, and E, of which A, B, C, and D servers are located in Singapore, and E server is located in Tokyo. Server A deploys 2-6 Slave nodes in the transaction execution committee, server B deploys 7-11 Slave nodes, server C deploys 12-16 Slave nodes, and server D deploys 17-21 Slave nodes. Server E is the Master node. When the number of transactions is 10,000, the experimental data is shown in the following table. The start time in the table indicates the time when the master node requests synchronization, and the end time is the time after the PBFT algorithm and the main chain block determination algorithm are executed, that is, the time it takes to reach a consensus. The interval time is the time between two master requests. This time is mainly the time consumed by the transaction execution committee nodes to collect blocks published by block producers. The Tps calculation formula is:

[0067] Tps = transaction volume / (consumed time + interval time)

[0068]

[0069]

[0070] The present invention also conducted verification experiments under three conditions of transaction volume of 1000, 2000, and 5000, and compared the experimental results with the throughput of Ethereum and Binance Smart Chain. Figure 6 shown.

[0071] like Figure 6 As shown, the blockchain framework designed with DAG structure in the present invention has obvious throughput advantages. The larger the transaction volume, the higher the throughput.

[0072] Therefore, the hybrid blockchain consensus method based on DAG of the present invention adopts a method combining DPOS and PBFT to avoid waste of resources; once the transaction is confirmed, it is irreversible, which ensures the security of the blockchain; compared with the traditional POS, the decentralized characteristic of the DPOS mechanism is strengthened, fundamentally eliminating the emergence of super nodes, and has high decentralization and security.

[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.

Claims

1. A hybrid blockchain consensus method based on DAG, characterized in that: The following steps are involved: (1) A new blockchain consensus protocol architecture that uses the POW mechanism to package transactions and confirm transactions by integrating the DPOS mechanism with the PBFT mechanism; (2) In the core transaction confirmation phase, design the main chain block determination algorithm; The working body for transaction confirmation in step (1) is the transaction execution committee; The transaction confirmation is carried out by integrating the DPOS mechanism with the PBFT mechanism, specifically including: the PBFT consensus and the main chain block determination algorithm are completed by the transaction execution committee. Once the transaction confirmed by the transaction execution committee is released, it cannot be changed. In the transaction confirmation stage, after the master node and the slave node successfully reach the PBFT consensus, the transaction execution committee further executes the main chain block determination algorithm, confirms the final block structure, sorts the transactions, and then executes them to the entire network; The main chain block determination algorithm is divided into four models: one is the determination of the genesis block, the second is the height of the block structure to be determined is less than three generations, the third is the weight of N (N≥1) chains is the same, and the fourth is the weight of N (N≥1) chains is different; The genesis block is actively generated by the system; Except for the genesis block, if the height of the block structure to be confirmed is less than three generations, the main chain block will not be generated. The generation of the main chain block must meet the condition that the height of the block structure to be confirmed is not less than three generations; When the weights of the N (N≥1) chains are the same, the determination of the main chain block includes the following steps: S21. There are a, b, x, ... n blocks, s(a) is the cumulative weight value of block a, and among the n blocks, there are any two or more blocks s(p) = s(q) ... = s(h) and s(p) > s(k), k is any block other than p, q ... h; S22. Define m1=Min(T(p),T(q),...T(h)) as the block with the smallest block generation timestamp among blocks p, q...h. In this case, the main chain block B=m1. S23. When T(p) = T(q)...T(h), define m2 = Min(Hash(p), Hash(q),...Hash(h)), m2 is the block with the smallest hash value, and the main chain block B = m2; When the weights of the N (N≥1) chains are different, the determination of the main chain block includes the following steps: S31. According to the predecessor block pointed to by the block, trace back until the main chain block R appears, and determine the current block structure model; S32, starting from the leaf node, find the cumulative weight value S(x) of each node outside the leaf node; S33, V1, V2, V3, ..., V n Represents the nodes of each generation with the largest weight, where V1 is the child node of R, V2 is the child node of V1, and so on. V1, V2, V3, ..., V n Store them in order into the sequence list L, where L[0] = V1, and then execute the algorithm; The algorithm in S33 is: while len(L)>=3: assign L[0]=main chain block L.pop() / / Delete the last element in L return L; After the PBFT consensus is completed, a type of "unqualified" block will be generated. These "unqualified" blocks do not participate in the main chain block determination algorithm; The working process of generating "unqualified" blocks is as follows: the main chain blocks released by the Transaction Execution Committee are a, b, c, and d. After the new transaction collection and packaging and PBFT synchronization process, the f1-f10 blocks are the block structure after the second PBFT synchronization of the Transaction Execution Committee. If the released block structure contains f1-f10 color blocks, according to the main chain block determination algorithm rules, the new main chain blocks are a, b, e, and f1. The main chain blocks are changed, and the f1-f10 blocks are defined as "unqualified" blocks. At the same time, it is stipulated that the f1-f10 blocks will not be released by the Transaction Execution Committee.