Throughput improving method based on DAG structure block chain
By introducing trusted consensus groups and distributed message queues into the DAG structure blockchain, the problems of increased transaction duplication rate and sequential conflict are solved, and higher blockchain network throughput is achieved.
Patent Information
- Application Number
- CN202411828970.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-03-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
During the process of DAG structure blockchain, there are problems such as increased transaction duplication rate and conflict between transaction sequence during the throughput increase, resulting in a decline in network throughput.
Introduce trusted consensus groups and distributed message queues, select trusted consensus groups through DPoS algorithm, verify transaction legitimacy, and manage transaction queues. The nodes select transactions from the message queues according to the PoW algorithm for packaging.
The repeated conflict rate of transactions is optimized, and the sequential conflict problem of transactions is solved, thereby improving the throughput of the blockchain network.
Smart Images

Figure CN119676247A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a method for improving the throughput of a DAG-structured blockchain. Background Art
[0002] Blockchain technology has characteristics such as anonymity and immutability, so it is widely used in multiple scenarios in different industries.
[0003] The blockchain follows the longest chain principle. The validity and security of the blockchain are determined by the longest chain, which means that if there are multiple competing branch chains, the network will select the branch with the longest chain as the valid chain and discard the remaining branches. Proof of Work (PoW) is a consensus algorithm commonly used in blockchain networks to confirm and verify blocks. In this algorithm, nodes need to continuously try to find a value that conforms to the rules so that the hash value of the new block meets a specific difficulty value. Only blocks that meet the difficulty value are considered legal. Since the parent node, that is, the hash value of the previous node, is required when calculating the hash value, the chain structure of the blockchain is guaranteed, but at the same time, this also limits the growth rate of the block. In order to solve the problem that the block throughput cannot meet the actual needs, the blockchain using Directed Acyclic Graph (DAG) as the block structure came into being. The design concept of this type of blockchain is to transform the block structure from chain to graph, and expand from a single chain to multiple chains, so as to achieve parallel block calculation and improve the throughput of the blockchain network. The specific method is to set up k parallel chains in the blockchain network, and the final block hash is used to determine the number of parallel chains. The bit determines which chain the block is on. In addition, this type of blockchain has modified the rules for calculating block hash values based on the original PoW algorithm: when a node starts to calculate block hash, it needs to first use the tail block of each parallel chain in the blockchain network as a leaf node to form a Merkle Tree, and then replace the hash value of the parent node in the PoW algorithm with the hash value of the root node of the Merkle Tree, so that the calculation of block hash is freed from the restriction of the parent node, so that the blocks mined by honest nodes can be legally put on the chain, greatly improving the throughput of blocks. At the same time, blockchains based on the DAG structure also follow the longest chain principle, which is to select blocks one by one in the order of parallel chains to form the logical longest chain.
[0004] There are certain defects in the current research on blockchain based on DAG structure. After replacing the chain structure with a graph structure, the throughput of the block is improved, so that the number of transactions packaged and released in the same time period is also significantly increased. However, it should be clear that in the blockchain consensus, the same transaction will not appear twice, that is, the transaction is unique. In the longest chain, if two blocks contain the same transaction, the block in the later position on the chain and its packaged transaction will be considered illegal and invalid. Due to the difficulty of the block, the chain blockchain has sufficient time for the node to check whether the transaction being packaged has been put on the chain, so as to avoid transaction conflicts. However, under the graph structure, the block speed is increased, and the user still follows the transaction fee priority packaging strategy, which will lead to a congestion effect. The probability of nodes choosing to package the same transaction in the same time period increases, that is, the number of blocks containing the same transaction on the chain increases, resulting in a corresponding increase in the number of invalid blocks, which will eventually have a negative impact on the throughput of the blockchain network. In addition, due to the special longest chain consensus principle of DAG blockchain, a new situation will arise, that is, the first published transaction is packaged on a parallel chain, and the later published transaction is packaged on the chain before the parallel chain. Then, when constructing the longest chain in logical order, the later published transaction will be verified before the earlier published transaction. If the later transaction needs to use the balance of the previous transaction, then in this case, the verification of the later transaction will fail, resulting in a conflict in the time sequence of transaction packaging, which will affect the transaction throughput.
[0005] Therefore, for the DAG-structured blockchain, there are two problems: (1) The increase in block throughput will lead to an increase in transaction duplication rate. Because nodes all want to gain more benefits, they are more likely to select the same transactions with high transaction fees for packaging. When the consensus is that only one block containing the same transaction is legal, it will cause a decrease in the throughput of the blockchain network.
[0006] (2) There will be order conflicts in packaged transactions. Due to the existence of multiple parallel chains in the graphical blockchain, there may be order problems in the verification of packaged transactions, making transactions that should have been legally verified become illegal due to the misorder on the chain, thus leading to transaction conflicts and a decrease in transaction throughput. Summary of the invention
[0007] The present invention provides a method for improving the throughput of a DAG-structured blockchain. Without modifying the PoW algorithm and the longest chain consensus algorithm of the blockchain network itself, the method optimizes the transaction duplication conflict rate and solves the transaction order conflict problem, thereby improving the throughput.
[0008] A method for improving throughput based on a DAG structured blockchain comprises the following steps: (1) Elect a trusted consensus group; (2) After a new transaction is generated, it is sent to the trusted consensus group for verification. The trusted consensus group verifies the legitimacy of the transaction based on the actual assets and expected assets of both parties to the transaction, and sends the transaction information to the normal message queue or the blocked message queue based on whether a transaction conflict will occur; (3) The node selects transactions from the message queue according to its own strategy, packages them, and sends back confirmation messages. At this time, the trusted consensus group updates the database in real time according to the confirmation messages. After that, the node uses the PoW algorithm under the DAG structure to package blocks and publish legal blocks. (4) When a block is successfully published, the trusted consensus group verifies the transactions in the legal block and updates the message queue, removes the transactions from the normal message queue, and moves the related blocked transactions from the blocked message queue to the normal message queue based on the hash of the two parties to the transaction.
[0009] In step (1), the DPoS algorithm is used to elect a trusted consensus group. The specific process is as follows: Users in the network use their rights and interests to vote to elect representative nodes they believe are trustworthy. These representative nodes serve as a trusted consensus group, responsible for verifying transaction conflicts and maintaining the transaction pools of each node.
[0010] The weight of a user's vote is determined by the size of the assets held by the user.
[0011] Representative nodes are elected at a predetermined period to ensure that the network is not controlled by a small number of representative nodes for a long time.
[0012] Step (2) specifically includes: In addition to actual assets, each user also has expected assets. When a transaction is published, the trusted consensus group checks the actual assets of the transaction account. If the actual assets meet the transaction, the transaction is deemed legal and published to the normal message queue for node packaging. The expected assets are modified according to the transaction content. If the actual assets cannot satisfy the transaction, but the expected assets do, it is considered that the previous transaction of the transaction is being packaged, so the transaction is also considered legal, and it is marked as a blocked transaction and placed in the blocked message queue for the node to package, but the block cannot be published. At the same time, the expected assets are also modified according to the transaction content.
[0013] In step (3), the trusted consensus group is responsible for maintaining a database based on key-value pair storage, where the key is the transaction hash and the value is the number of people currently packaging; When a node selects a transaction from the message queue for packaging, it will send back a confirmation message. The trusted consensus group will update the database based on this information. The remaining nodes will choose to check the database before selecting transactions and adjust the transaction selection strategy based on the number of people. At the same time, the trusted consensus group will set an adaptive maximum number of packagers for each transaction based on different transaction fees, forcing the probability of conflict to be reduced and fairness to be improved.
[0014] For transactions with potential order conflicts, packaging is allowed, but they must wait until the trusted consensus group sends the transaction to the normal message queue that allows publishing.
[0015] In step (4), when a block is successfully released, the trusted consensus group verifies the legitimacy of the block and transactions. First, the PoW algorithm is verified to ensure the legitimacy of the block itself, and then the transaction information is checked, comparing the transactions in the message queue based on the transaction offset.
[0016] Compared with the prior art, the present invention has the following beneficial effects: The present invention, without modifying the block hash calculation algorithm, introduces a trusted consensus group to manage transactions in the entire network from the source, and selects a distributed message queue as the underlying structure of the transaction pool, thereby solving the transaction order conflict problem that may occur in the DAG structure blockchain network; by disclosing the number of transaction competitors in real time, it optimizes the transaction duplication problem that will occur in large quantities under high block throughput, thereby designing a blockchain system with higher transaction throughput. The present invention has advantages that existing authentication methods do not have, such as complete structure, rigorous method design, low probability of transaction conflict, and high transaction throughput, and can be promoted in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a flow chart of a method for improving throughput based on a DAG structured blockchain according to an embodiment of the present invention.
[0018] Figure 2 Schematic diagram of the trusted consensus group election process in an embodiment of the present invention.
[0019] Figure 3 The figure is a schematic diagram of the process of transaction packaging in an embodiment of the present invention. DETAILED DESCRIPTION
[0020] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be pointed out that the embodiments described below are intended to facilitate the understanding of the present invention and do not have any limiting effect on the present invention.
[0021] The core idea of the present invention is to introduce a trusted consensus group (TCG) and a distributed message queue (Distributed Message Queue) to optimize the entire transaction publishing process. The trusted consensus group will distinguish transactions that may have order conflicts through prior verification, and send transaction information to different message queues according to whether conflicts will occur. Nodes can select transactions from the message queue for packaging according to the original PoW algorithm. Therefore, for nodes, the efficiency of their own packaging blocks will not be affected. For transactions with potential order conflict risks, packaging is allowed, but it must wait until the trusted consensus group sends the transaction to the message queue that allows publishing before it can be published, thereby maximizing the efficiency of the network. In addition, the trusted consensus group is responsible for maintaining a database based on key-value pair storage, with the key being the transaction hash and the value being the number of people currently being packaged. When a node selects a transaction from the message queue for packaging, it will send back a confirmation message. The trusted consensus group updates the database based on this information. The remaining nodes can choose to view the database before selecting the transaction and adjust the transaction selection strategy according to the number of people, thereby reducing the probability of transaction duplication. The trusted consensus group will also set an adaptive maximum number of people for each transaction based on the transaction fees, forcing the probability of conflict to be reduced while improving fairness. In addition, since the database is stored in key-value pairs, the time complexity of updating and searching data is O(1).
[0022] The formation of the trusted consensus group uses the DPoS (Delegated Proof of Stake) method. The specific process can be described as users in the network entrusting their rights and interests to representative nodes they believe are trustworthy through voting. These representative nodes are responsible for verifying transaction conflicts and maintaining the transaction pool. All users in the system can vote, and the weight of the vote is usually determined by the size of the assets held by the user. For fairness, representative nodes are usually elected according to a predetermined period to ensure that the network will not be controlled by a small number of representative nodes for a long time.
[0023] The present invention uses the architecture of distributed message queue to store transactions, the purpose is to centralize the transaction pools of each node, and the trusted consensus group is responsible for managing a central transaction pool, thereby ensuring that the transactions available for node selection in the message queue have been verified by the trusted consensus group, thereby avoiding order conflicts. The trusted consensus group maintains the account book of the entire network. Each user has expected assets in addition to actual assets. When a transaction is released, the consensus group will check the actual assets of the transaction account. If it is legal, the transaction will be published in the message queue for node packaging, and the expected assets will be modified according to the transaction content. If the actual assets cannot meet the transaction, but the expected assets can meet it, it is considered that the preceding transaction of the transaction is being packaged, so the transaction is also considered legal, and it is marked as a blocking transaction and put into the message queue of the blocking transaction for node packaging, but the block cannot be released, and the expected assets are also modified according to the transaction content. When a transaction is successfully packaged and released by the node, the consensus group will find the blocking transaction according to the account hash of the two parties to the transaction, and if it exists, the blocking transaction will be published to the normal message queue. Thus, legal transactions can be packaged and can be released as soon as possible without order conflicts. The present invention adopts the producer / consumer and publish / subscribe model to propagate messages. In this model, the trusted consensus group acts as a producer and is responsible for sending transaction information to the message queue. The node acts as a consumer and actively pulls transaction information from the subscribed message queue for packaging, and returns a confirmation message at the same time. The trusted consensus group can update the number of people who are packaging the transaction based on this confirmation message. In the architecture of the distributed message queue, for efficiency reasons, the producer cannot directly update the message in the message queue. Therefore, a key-value pair database is connected to maintain the "number of people currently packaging the transaction" in constant time.
[0024] The present invention draws on the crowding effect problem in game theory to optimize the transaction duplication conflict rate, but the difference is that the crowding effect is generally solved through an incentive mechanism, while in the context of the DAG structure blockchain, the crowding effect is caused by the incentive mechanism of the transaction itself, and the additional incentive will make the system more complex and lead to some unfair problems. Since each honest node will try to maximize its own benefits, the public packaging number can fairly let the node understand the strategy of other nodes, make rational choices based on its own computing power, thereby reducing the duplication rate of transactions. The consensus group can also set an upper limit on the number of people for each transaction based on the transaction fee, fundamentally reducing the number of competitors.
[0025] Specifically, Figure 1 As shown, a method for improving throughput based on a DAG structure blockchain includes the following steps: Step 101: The blockchain network elects a trusted consensus group based on the DPoS algorithm.
[0026] The trusted consensus group is an important role in this system responsible for maintaining the ledger information and transaction queue. After the network is established, elections are conducted according to the DPoS algorithm.
[0027] Step 102: The trusted consensus group verifies the received transactions and manages the message queue.
[0028] When a transaction is generated, the trusted consensus group will verify the transaction based on the actual assets and expected assets of the user in the ledger information. If there is no conflict, the transaction information will be placed in the waiting message queue after setting the congestion limit. If it will cause a conflict, it will be placed in the blocked message queue. After that, the node can select transactions from the subscribed message queue for packaging.
[0029] Step 103: The node performs block hash calculation according to the PoW algorithm.
[0030] When the trusted consensus group puts the transaction information into the message queue, the node can obtain the transaction information and the number of people who packaged the transaction from the message queue, thereby building a transaction Merkle tree belonging to the node. At this time, the trusted consensus group will update the database based on the returned confirmation message. After that, the node uses the PoW algorithm under the DAG structure to package the blocks and publish legal blocks.
[0031] Step 104: The trusted consensus group verifies transactions in the legal blocks and maintains the ledger and message queue in real time.
[0032] After a block is successfully released, the trusted consensus group will verify the legitimacy of the block and the transaction. That is, for a block, its hash must have at least Continuous 0, where k refers to the total number of chains and p refers to the block difficulty. For transactions, they must not be blocking transactions. This can be done by comparing the transaction offset with the corresponding transaction in the message queue. If the transaction information is different or the timestamp in the message queue is later than the block timestamp, the block is invalid.
[0033] like Figure 2 As shown, in this embodiment of the present invention, the election process of the trusted consensus group mainly includes the following steps: (1) Nodes holding assets vote for candidate nodes.
[0034] (2) When the voting rate of candidate nodes exceeds 50%, the delegate node D is generated.
[0035] (3) The delegate node D[i] receives the transaction and verifies it.
[0036] (4) The term of the delegated node D[i] ends and it becomes a normal node again to participate in the next round of elections.
[0037] like Figure 3As shown in the figure, in the embodiment of the present invention, the specific process of transaction packaging is as follows: (1) The user initiates a transaction to the delegate node.
[0038] (2) The delegate node receives the transaction and verifies the transaction based on the ledger information. If a blockage occurs, it is placed in the message queue of the Topic blockage, waits for the previous transaction to be completed, and then verifies the transaction based on the dynamic formula. Set the maximum number of competitors, where It is the basic competition number limit. is the adjustment coefficient, which is used to control the amplification effect of high-value items on the upper limit of the number of people. It's a deal transaction fees, It is the average transaction fee of the transactions that have been made so far.
[0039] (3) If no congestion will occur after verification, the transaction will be timestamped and placed in the normal message queue of the Topic, and the maximum number of selectors will also be set.
[0040] (4) Nodes pull transaction information from the message queue and select transactions for packaging according to their own strategies. For each selected transaction, the consensus group will receive a confirmation message. The consensus group will update the database through this message and record the node hash for confirmation messages that exceed the maximum number of people for block verification.
[0041] (5) After the block is released, the consensus group will first verify the PoW algorithm to ensure the legitimacy of the block itself, then check the transaction information, compare the transaction in the message queue according to the transaction offset, delete the corresponding transaction from the message queue after successful verification and update the ledger information, then search for the transaction in the blocked queue according to the hash of the transaction initiator, and put the no longer conflicting transactions into the normal transaction queue, and then proceed to the second step.
[0042] In the transaction message queue, the transaction data structure is shown in Table 1 below: Table 1
[0043] The embodiments described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for improving throughput based on a DAG-structured blockchain, characterized in that: The following steps are involved: (1) Elect a trusted consensus group; (2) After a new transaction is generated, it is sent to the trusted consensus group for verification. The trusted consensus group verifies the legitimacy of the transaction based on the actual assets and expected assets of both parties to the transaction, and sends the transaction information to the normal message queue or the blocked message queue based on whether a transaction conflict will occur; (3) The node selects transactions from the message queue according to its own strategy, packages them, and sends back confirmation messages. At this time, the trusted consensus group updates the database in real time according to the confirmation messages. After that, the node uses the PoW algorithm under the DAG structure to package blocks and publish legal blocks. (4) When a block is successfully published, the trusted consensus group verifies the transactions in the legal block and updates the message queue, removes the transactions from the normal message queue, and moves the related blocked transactions from the blocked message queue to the normal message queue based on the hash of the two parties to the transaction.
2. The throughput improvement method based on the DAG structure blockchain according to claim 1 is characterized in that: In step (1), the DPoS algorithm is used to elect a trusted consensus group. The specific process is as follows: Users in the network use their rights and interests to vote to elect representative nodes they believe are trustworthy. These representative nodes serve as a trusted consensus group, responsible for verifying transaction conflicts and maintaining the transaction pools of each node.
3. The throughput improvement method based on the DAG structure blockchain according to claim 2 is characterized in that: The weight of a user's vote is determined by the size of the assets held by the user.
4. The method for improving throughput based on DAG structure blockchain according to claim 2, characterized in that: Representative nodes are elected at a predetermined period to ensure that the network is not controlled by a small number of representative nodes for a long time.
5. The throughput improvement method based on the DAG structure blockchain according to claim 1 is characterized in that: Step (2) specifically includes: In addition to actual assets, each user also has expected assets. When a transaction is published, the trusted consensus group checks the actual assets of the transaction account. If the actual assets meet the transaction, the transaction is deemed legal and published to the normal message queue for node packaging. The expected assets are modified according to the transaction content. If the actual assets cannot satisfy the transaction, but the expected assets do, it is considered that the previous transaction of the transaction is being packaged, so the transaction is also considered legal, and it is marked as a blocked transaction and placed in the blocked message queue for the node to package, but the block cannot be published. At the same time, the expected assets are also modified according to the transaction content.
6. The method for improving throughput based on DAG structure blockchain according to claim 1, characterized in that: In step (3), the trusted consensus group is responsible for maintaining a database based on key-value pair storage, where the key is the transaction hash and the value is the number of people currently packaging; When a node selects a transaction from the message queue for packaging, it will send back a confirmation message. The trusted consensus group will update the database based on this information. The remaining nodes will choose to check the database before selecting transactions and adjust the transaction selection strategy based on the number of people. At the same time, the trusted consensus group will set an adaptive maximum number of packagers for each transaction based on different transaction fees, forcing the probability of conflict to be reduced and fairness to be improved.
7. The method for improving throughput based on DAG structure blockchain according to claim 6 is characterized in that: For transactions with potential order conflicts, packaging is allowed, but they must wait until the trusted consensus group sends the transaction to the normal message queue that allows publishing.
8. The method for improving throughput based on DAG structure blockchain according to claim 1, characterized in that: In step (4), when a block is successfully released, the trusted consensus group verifies the legitimacy of the block and transactions. First, the PoW algorithm is verified to ensure the legitimacy of the block itself, and then the transaction information is checked, comparing the transactions in the message queue based on the transaction offset.
Citation Information
Patent Citations
A block-chain hybrid consensus method based on DAG algorithm
CN109214795A
Block chain of directed acyclic graph structure and implementation method thereof
CN113516557A
Dynamic weight-based consensus method for blockchain enabling data sharing
CN115118732A
High-throughput distributed account book system based on DAG
CN116846674A
Methods and apparatus for efficiently implementing a distributed database within a network
WO2019014337A1