A blockchain asynchronous consensus algorithm based on DAG and sharding

By using a blockchain asynchronous consensus algorithm based on DAG and sharding, the problem of low consensus efficiency in asynchronous environments in existing technologies is solved, achieving efficient transaction processing and security assurance, and improving the scalability and security of the blockchain network.

CN116471024BActive Publication Date: 2026-11-24HENAN UNIVERSITY OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310438907.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-21
Publication Date
2026-11-24
Estimated Expiration
2043-04-21

AI Technical Summary

Technical Problem

Existing asynchronous consensus algorithms are based on the same linear chain structure, which limits the scope of development and makes it difficult to meet the high-efficiency consensus requirements of the asynchronous Internet environment.

Method used

The blockchain asynchronous consensus algorithm based on DAG and sharding is adopted to divide the blockchain network into multiple shards. Nodes determine the leader block based on the DAG structure, and batch event propagation is formed through consensus mechanisms inside and outside the shards, reducing communication and storage overhead.

Benefits of technology

It improves the scalability and network partition tolerance of the blockchain, enhances transaction processing efficiency, reduces communication and storage overhead, and solves the security degradation problem caused by sharding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116471024B_ABST
    Figure CN116471024B_ABST
Patent Text Reader

Abstract

An asynchronous consensus algorithm for blockchain based on DAG and sharding includes: dividing the blockchain network into multiple shards, each shard containing multiple nodes; nodes creating blocks and corresponding events based on received transaction information; nodes in a shard determining a leader block based on a DAG (Directed Acyclic Graph) structure, and forming intra-shard consensus based on the leader block; nodes merging multiple events into a batch based on the leader block, and the events in a batch propagating between shards to form inter-shard consensus. This invention provides an asynchronous consensus algorithm for blockchain based on DAG and sharding, which can significantly improve consensus efficiency and reduce communication overhead during the consensus process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain consensus algorithm technology, specifically an asynchronous consensus algorithm for blockchain based on DAG and sharding. Background Technology

[0002] As one of the most popular distributed ledger technologies, blockchain enables decentralized, transparent, and immutable transaction recording without the need for a trusted third party, thus changing the traditional ledger transaction model. Blockchain technology has attracted widespread attention from academia and governments worldwide, and an increasing number of enterprises and organizations are exploring its applications. Consensus algorithms are a core element of blockchain technology and a hot topic in distributed systems research in recent years. Consensus algorithms affect the transaction processing capacity, scalability, and security of blockchain, and are crucial to its development. Early consensus algorithm research often focused on solving consensus problems in synchronous environments. However, the strict assumption of synchronization is often difficult to meet in today's internet-dominated world; therefore, research on consensus algorithms in asynchronous environments is of great significance. Existing asynchronous consensus algorithms are still based on the same linear chain structure, limiting their development scope. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention provides an asynchronous consensus algorithm for blockchain based on DAG and sharding, which can significantly improve consensus efficiency and reduce communication overhead during the consensus process.

[0004] To achieve the above objectives, the specific solution adopted by this invention is: an asynchronous consensus algorithm for blockchain based on DAG and sharding, comprising: The blockchain network is divided into multiple shards, each containing multiple nodes; The node creates blocks and corresponding events based on the received transaction information; In a shard, nodes determine the leader block based on a DAG (Directed Acyclic Graph) structure, and intra-shard consensus is formed based on the leader block. Nodes merge multiple events into a batch based on the leader block, and the events in a batch are propagated between shards to form inter-shard consensus.

[0005] As a further optimization of the above-mentioned asynchronous consensus algorithm for blockchains based on DAG and sharding, the specific methods for nodes to create blocks include: After receiving transaction information, the node stores the transaction information in an orderly manner in the transaction list; When a node starts a new round, it creates a block based on the transaction information in the transaction list; After a block is created, the node broadcasts the block across the shards.

[0006] As a further optimization of the above-mentioned asynchronous consensus algorithm for blockchains based on DAG and sharding, the specific methods for nodes to create events corresponding to blocks include: When a node receives a block from another node, it verifies the block. When a node verifies the validity of a block, it returns a signature confirmation message to the node that created the block. When the number of signature confirmation messages corresponding to the block received by the node that creates the block reaches a preset first threshold, an event corresponding to the block is created and broadcast within the shard.

[0007] As a further optimization of the above-mentioned asynchronous consensus algorithm for blockchain based on DAG and sharding: when the number of events received by a node in the current round reaches a preset second threshold, the current round ends and a new round begins.

[0008] As a further optimization of the aforementioned asynchronous consensus algorithm for blockchains based on DAG and sharding, the methods for nodes to determine the leader block include: Nodes in a shard are based on a locally maintained DAG structure and determine the leader block from all the blocks they hold using a random coin method and then commit it.

[0009] As a further optimization of the above-mentioned asynchronous consensus algorithm for blockchains based on DAG and sharding, the specific methods for nodes in a shard to form intra-shard consensus based on the leader block include: After a node submits the leader block, it performs a path check on the leader block. The nodes sort the leader blocks based on the association paths of the leader blocks, resulting in a leader sequence that represents the order of the leader blocks; Based on the leader sequence, the ancestral blocks of each leader block are sorted according to deterministic rules to form intra-slice consensus.

[0010] As a further optimization of the above-mentioned asynchronous consensus algorithm for blockchain based on DAG and sharding: while merging multiple events into a batch based on the leader block, the nodes assign numbers to the events in the same batch. When a batch of events propagates between shards, the nodes that receive the events sort them based on the batch number.

[0011] As a further optimization of the above-mentioned asynchronous consensus algorithm for blockchain based on DAG and sharding: when a node receives events from other shards, if at least two batches of events have the same number, the node reorders them based on the hash value.

[0012] As a further optimization of the above-mentioned asynchronous consensus algorithm for blockchain based on DAG and sharding: when dividing into shards, a node in a shard must be a neighbor node of at least one node in another shard.

[0013] Beneficial effects: This invention is based on a combination of DAG and sharding, which greatly improves the scalability of the blockchain and the tolerance of network partitions while ensuring security. Within a shard, a structured DAG is used to achieve parallel broadcasting and transaction processing. Nodes only broadcast and store transaction blocks of their local shards, improving transaction processing efficiency and reducing storage overhead. In inter-shard communication, nodes send block events instead of blocks, which can significantly reduce inter-shard communication overhead. Furthermore, batch merging can reduce network bandwidth consumption and speed up confirmation. Through inter-shard communication, nodes in different shards can maintain a consistent global block event state, solving the security degradation problem caused by sharding. Attached Figure Description

[0014] Figure 1 This is a diagram illustrating the overall structure of the asynchronous consensus algorithm in blockchain. Figure 2 This refers to the block and event broadcast graph of the blockchain asynchronous consensus algorithm. Figure 3 This is a schematic diagram of the in-chip consensus submission rules for the asynchronous consensus algorithm in blockchain. Detailed Implementation

[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0016] Please see Figures 1 to 3 An asynchronous consensus algorithm for blockchain based on DAG and sharding includes the following steps.

[0017] In the process of building a blockchain network, the blockchain network is divided into multiple shards, and each shard contains multiple nodes. The number of shards and the number of nodes in each shard can be determined according to the scale of the blockchain network.

[0018] After shards are formed, nodes begin operating. Running nodes create blocks and corresponding events based on the received transaction information. The specific method for nodes to create blocks includes the following steps.

[0019] First, upon receiving transaction information, the node stores it in an ordered transaction list. During operation, the node continuously receives transaction information from clients and stores all received transactions in the transaction list according to their time. Subsequent processes then process the transactions in that order to avoid omissions.

[0020] Secondly, when a node begins a new round, it creates a block based on the transaction information in the transaction list. In each round, a node creates only one block, thus reducing the number of blocks, lowering the processing pressure on the blockchain network, and improving overall efficiency. Each block can contain multiple transaction details; the number of transactions a block can contain is determined by the block size.

[0021] Finally, in order to verify the block and determine its legality, after the block is created, the node broadcasts the block in the shard and hands it over to other nodes in the shard for verification.

[0022] The specific methods for creating events corresponding to blocks by nodes include the following steps.

[0023] First, when a node receives a block from another node, it verifies the block. The specific verification method can be a predefined verification check method, and all nodes verify the received blocks according to the same verification check method.

[0024] Secondly, when a node verifies the validity of a block, it returns a signature confirmation message to the node that created the block. Verifying the block's validity proves that the node has acknowledged the received block, and at this point, it can return a signature confirmation message to the node that created the block, allowing that node to confirm that the block has been verified by other nodes.

[0025] Finally, when the number of signature confirmation messages received by the node that created the block reaches a preset first threshold, an event corresponding to the block is created and broadcast within the shard. When the number of signature confirmation messages received by the node that created the block reaches the first threshold, it can be confirmed that the block has been verified by a majority of nodes within the shard, thus determining that the block is legitimate and valid. At this time, an event corresponding to the block can be created to prove the legitimacy of the block. After the event is created, the node broadcasts the event within the shard, so that all other nodes can determine that the block corresponding to the event is legitimate and valid. The first threshold can be set to 2f+1, where the specific value of f is determined by the number of nodes within the shard. In this embodiment, the event can be a hash value obtained by hashing the block. In other embodiments, a similar calculation method can also be used, which will not be elaborated here.

[0026] In this invention, within each shard, nodes only broadcast blocks containing specific transaction information and events used to characterize the validity of the blocks, thereby improving transaction processing efficiency and reducing storage overhead.

[0027] After blocks and events are created, nodes in a shard determine the leader block based on a DAG (Directed Acyclic Graph) structure, and intra-shard consensus is formed based on the leader block. Specifically, each node maintains a consistent round-based DAG structure locally, dividing the DAG's evolution into multiple stages. Each stage consists of two consecutive rounds, and the DAG structures maintained by different nodes may be the same or different at any given time. During intra-shard consensus, when a node receives enough blocks, it randomizes in the second round of the stage to obtain a consistent random coin, which is then used to select the leader block from the blocks in the first round of the stage. The random coin can be obtained through an active threshold signature scheme, which is existing technology in this field and will not be elaborated further. If this leader block receives sufficient support in the second round of the stage (i.e., has enough child blocks, f+1), the leader block is committed. Committing means that its ancestor blocks can be sorted. Through the path checking mechanism, we can ensure that nodes have a consistent leader block order, thereby guaranteeing that nodes have a consistent block order within the shard. Because an event can only be created when a block is recognized by a majority of nodes within the shard, and then broadcast to all nodes to confirm the validity of the received block, nodes do not need to employ complex voting and collection mechanisms during intra-shard consensus. They can directly rely on their own maintained DAG structure, effectively reducing method complexity and communication overhead. In this embodiment, nodes in the shard determine and commit the leader block of the current stage using a random coin method based on their locally maintained DAG structure. In other embodiments of the invention, other simple random methods can also be used to determine the leader block.

[0028] After intra-shard consensus is reached, nodes merge multiple events into a batch based on the leader block, and the events in a batch are propagated between shards to form inter-shard consensus. After intra-shard consensus is achieved, consensus needs to be reached between different shards to ensure consensus across the entire blockchain network. By merging multiple events into a batch and then propagating that batch between different shards, the number of inter-shard consensus steps can be reduced, lowering the overall communication overhead of the blockchain network. Furthermore, because events, rather than complete blocks, are propagated between shards, communication overhead can be further reduced.

[0029] This invention is based on a combination of DAG and sharding, which greatly improves the scalability and network partition tolerance of the blockchain while ensuring security. Within a shard, a structured DAG is used to achieve parallel broadcasting and transaction processing. Nodes only broadcast and store transaction blocks for their local shard, improving transaction processing efficiency and reducing storage overhead. In inter-shard communication, nodes send block events instead of blocks, which significantly reduces communication overhead between shards. Furthermore, batch merging reduces network bandwidth consumption and speeds up confirmation. Through inter-shard communication, nodes in different shards can maintain a consistent global block event state, resolving the security degradation problem caused by sharding.

[0030] The specific method for updating the node cycle is as follows: when the number of events received by a node in the current cycle reaches a preset second threshold, the current cycle ends and a new cycle begins. The second threshold can also be determined based on the number of nodes within the shard.

[0031] Furthermore, the specific methods for nodes in a shard to form intra-shard consensus based on the leader block include the following steps.

[0032] After a node commits the leader block, it performs a path check on the leader block. The specific path check method is as follows.

[0033] After a node commits a leader block for a round, within the range of the current round and the round in which the leader block was last committed, the node should recursively check, starting from the leader block of the current round, whether there is an inheritance relationship with the leader block of the previous round, i.e., whether there is at least one path. For example... Figure 3 If a red path exists in the sequence, the node should commit the leader block from the previous round and place it before the leader block of the current round. Then, path checking continues from the leader block of the previous round to the rounds preceding it. Blocks determined through inheritance relationships can be defined as ancestor blocks of the leader block.

[0034] Nodes sort leader blocks based on their associated paths, resulting in a leader sequence that represents the order of leader blocks. Based on this leader sequence, the ancestor blocks of each leader block are sorted according to deterministic rules to form intra-segment consensus. This path checking mechanism ensures that nodes have a consistent leader block order, thereby guaranteeing a consistent block order within the same segment.

[0035] To ensure that nodes within different shards can correctly sort a batch of events during the inter-shard consensus phase, ultimately forming a correct inter-shard consensus, nodes merge multiple events into a single batch based on the leader block, assigning a number to each event within the same batch. When a batch of events propagates between shards, the receiving nodes sort the events based on the batch number. To prevent nodes from being unable to sort different batches of events smoothly due to identical numbers, thus interfering with the formation of inter-shard consensus, when a node receives events from other shards, if at least two batches of events have the same number, the node reorders them based on hash values. The collision-resistant nature of the hash function ensures that nodes obtain a consistent batch order, thus ensuring a consistent global chain of block events.

[0036] To ensure that a node can successfully propagate a batch of events to other shards, when partitioning shards, each node in a shard must be a neighbor node of at least one node in another shard.

[0037] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An asynchronous consensus algorithm for blockchain based on DAG and sharding, characterized in that, include: The blockchain network is divided into multiple shards, each containing multiple nodes. When dividing the network into shards, each node in a shard must be a neighbor node of at least one node in another shard. Nodes create blocks and corresponding events based on the received transaction information. The specific methods for nodes to create events corresponding to blocks include: verifying blocks when a node receives blocks from other nodes; returning a signature confirmation message to the node that created the block when the node verifies the block's validity; and creating an event corresponding to the block and broadcasting it within the shard when the number of signature confirmation messages received by the node that created the block reaches a preset first threshold. Nodes in a shard determine the leader block based on a DAG structure and form intra-shard consensus based on the leader block. The method for nodes to determine the leader block includes: based on the locally maintained DAG structure, nodes determine the leader block from all the blocks they hold using a random coin method and submit it; the specific method for nodes in a shard to form intra-shard consensus based on the leader block includes: after a node submits the leader block, it performs a path check on the leader block; the node sorts the leader blocks based on the associated paths of the leader blocks to obtain a leader sequence that represents the order of the leader blocks; based on the leader sequence, the ancestor blocks of each leader block are sorted according to deterministic rules to form intra-shard consensus; Nodes merge multiple events into a batch based on the leader block, and the events in a batch are propagated between shards to form inter-shard consensus. While merging multiple events into a batch based on the leader block, nodes assign numbers to events in the same batch. When events in a batch are propagated between shards, nodes that receive the events sort them based on the batch number. When a node receives events from other shards, if at least two batches of events have the same number, the node reorders them based on the hash value.

2. The asynchronous consensus algorithm for blockchain based on DAG and sharding as described in claim 1, characterized in that, The specific methods for nodes to create blocks include: After receiving transaction information, the node stores the transaction information in an orderly manner in the transaction list; When a node starts a new round, it creates a block based on the transaction information in the transaction list; After a block is created, the node broadcasts the block across the shards.

3. The asynchronous consensus algorithm for blockchain based on DAG and sharding as described in claim 2, characterized in that, When the number of events received by a node in the current round reaches a preset second threshold, the current round ends and a new round begins.

Citation Information

Patent Citations

  • Hybrid consensus method based on fragmentation technology

    CN110570202A

  • Consensus method and device of block chain, computer equipment and storage medium

    CN114049123A