Blockchain systems based on parallel chain structures and their construction methods
By using a parallel chain structure and a random weight mechanism, the problem of traditional blockchain systems being vulnerable to live attacks is solved, achieving efficient and secure ledger convergence and fast transaction processing, thereby improving the system's security and throughput.
Patent Information
- Application Number
- CN202510055579.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-01-14
AI Technical Summary
Traditional tree-graph-based blockchain systems are vulnerable to live attacks, which can cause the ledger state to fail to converge. Furthermore, the adaptive weight adjustment mechanism is time-consuming and resource-intensive.
It adopts a parallel chain structure, with each chain recording transactions and using the heaviest subtree principle to build the ledger. Block creation is decoupled from on-chain, and random weights are assigned through hash values. A set of tamper-proof hash values is used for verification and sorting. Nodes synchronize data through the PoW consensus mechanism.
It improves system security and throughput, reduces ledger convergence time, enhances system resistance to attacks and stability, and reduces confirmation latency.
Smart Images

Figure CN119853926B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain, specifically to a highly efficient and secure blockchain system based on a parallel chain structure and its construction method. Background Technology
[0002] DAGs, with their high concurrency characteristics, are considered one of the most promising directions for solving blockchain scalability issues. DAG-based distributed ledger structures can be categorized into three types: 1) Main chain-based DAG distributed ledger structure: a main chain is first agreed upon in the ledger, and then the other blocks in the DAG are topologically sorted based on the main chain to determine the final order of blocks in the entire ledger; 2) Parallel chain-based DAG ledger structure: each node or account in the network maintains its own chain to record local information, and the interaction and referencing between these chains constitute a parallel chain-based DAG ledger; 3) Naive DAG-based distributed ledger structure: the topological properties of DAGs are used to sort blocks, and when multiple blocks are available for selection, a voting mechanism is used for consensus.
[0003] GHOST and Conflux are currently mainstream DAG-based blockchain systems. The GHOST protocol was the first to propose using a tree structure to store blocks, reducing mining difficulty and utilizing the principle of the heaviest subtree on branches to determine the order of blocks in the ledger, thus preventing double-spending attacks. However, GHOST is vulnerable to liveness attacks by malicious nodes. Attackers can exploit network latency to control the order and time of block arrival, causing two or more heaviest subtrees with equal weights in a node's local ledger, making it impossible to determine which subtree is the heaviest.
[0004] To address the vulnerability of GHOST to liveness attacks, Conflux proposes an adaptive weight adjustment mechanism. During mining, nodes detect potential liveness attacks by comparing the weights between subtrees and the duration of the ledger's non-converged state. If a liveness attack is detected, the system increases the mining difficulty, assigning higher weights to successfully mined blocks.
[0005] However, the aforementioned adaptive weight adjustment mechanism requires nodes to continuously monitor the local ledger status, and the weight adjustment process is relatively time-consuming. Therefore, how to increase the difficulty of active attacks by attackers, reduce ledger convergence time, save local node resources, and improve system security has become a current research focus in this field. Summary of the Invention
[0006] The present invention aims to at least partially solve one of the technical problems existing in the related art.
[0007] One objective of this invention is to provide a blockchain system based on a parallel chain structure, which solves the problem that traditional blockchain systems based on tree graph structures are susceptible to liveness attacks, thereby improving system security while ensuring high system throughput.
[0008] Another objective of this invention is to provide a method for constructing the aforementioned blockchain system based on a parallel chain structure.
[0009] To achieve the above objectives, the present invention provides a blockchain system based on a parallel chain structure, comprising:
[0010] Multiple parallel chains, each used to record transactions and construct the ledger using the heaviest subtree principle;
[0011] Each block is assigned a random weight based on the number of leading zeros in its hash value after it is created;
[0012] By decoupling block creation from the on-chain process, after a node successfully mines, if there are k chains in the system, the last chain is determined based on the block hash value. The bit determines which chain the block will be added to;
[0013] Each block contains a tamper-proof hash value set, which is selected by traversing each chain and according to the principle of the heaviest subtree;
[0014] The node performs a verification mechanism on the received block, verifying its hash value and tamper-proof hash value set.
[0015] A further preferred technical solution of the present invention is that when a node joins the network, it establishes a connection with other nodes through broadcasting, synchronizes historical data and the status of other nodes in the network, and verifies the historical data through the PoW consensus mechanism.
[0016] Preferably, each block is assigned a random weight after creation based on the number of leading zeros in its hash value. Specifically, each block is assigned a weight by calculating the number of leading zeros in its hash value, and the weight of the block is equal to the number of leading zeros in its hash value.
[0017] As a preferred method, the selection method for the set of tamper-proof hash values for each block is as follows:
[0018] Traverse each chain, performing a depth-first traversal of each chain according to the principle of the heaviest subtree;
[0019] If multiple blocks in the same layer have the same weight, select the block with the smaller hash value and continue traversing downwards;
[0020] If multiple blocks have the same hash value and the same block weight, select the earlier created block based on the block creation timestamp and continue traversing downwards.
[0021] Preferably, the node performs a verification mechanism on the received block to verify its hash value and tamper-proof hash value set. The specific method is as follows:
[0022] After a node receives a block in the network, it first verifies whether the block's hash value meets the conditions. If it does, it then traverses k chains to determine whether the block in the anti-tampering hash value set actually exists in each chain and whether it is located on the main chain.
[0023] As a preferred method, the node sorts the blocks in the ledger as follows:
[0024] The node iterates through each chain sequentially, starting from the genesis block. It selects the child block with the highest weight and adds it to the end of the block sequence.
[0025] The child blocks of the sub-block with the largest hash value are added to the block sequence in ascending order.
[0026] Select the block with the highest weight from all child blocks and continue traversing until a leaf node is reached.
[0027] Another aspect of the present invention provides a method for constructing the above-mentioned blockchain system based on a parallel chain structure, comprising the following steps:
[0028] S100. When a node joins the network, a genesis block without any transactions is created for each chain to initialize the ledger structure.
[0029] S200 nodes use the PoW mechanism for mining;
[0030] S300: When a node is mining, it selects a portion of the content to add to the block header for hash value calculation.
[0031] S400: After receiving blocks from other nodes in the network, the node stores them locally and uploads the blocks to the blockchain through the consensus mechanism.
[0032] S500: Select a tamper-proof block for each chain based on the principle of the heaviest subtree;
[0033] S600: Newly added nodes in the network establish connections with other nodes and synchronize historical data.
[0034] Preferably, the parameters of the genesis block of each chain in step S100 are fixed and written in the Genesis File. When a node downloads a client, it obtains the file through the built-in Genesis File download address. After the download is completed, the file signature is verified through the public key.
[0035] Preferably, in step S400, after a node receives a block sent by other nodes in the network, it uploads the block to the blockchain through a consensus mechanism, including verifying the received block and performing the blockchain upload operation; wherein:
[0036] The process of verifying a received block involves first verifying whether its hash value meets a certain condition, i.e., whether the hash value of the block is less than a certain value; then verifying the correctness of the transactions in the block, i.e., checking whether the transactions have been tampered with.
[0037] The on-chain operation involves a node converting the calculated hash value into decimal and taking the remainder when divided by k to obtain a number. This number indicates which chain the block needs to be added to.
[0038] Preferably, in step S600, when a newly added node in the network establishes a connection with other nodes, it discovers other nodes in the network through the DNS domain name resolution service. The new node establishes a connection with other nodes through the TCP / IP protocol. Once the connection is successful, the new node sends identity information to the node, including the node's public key, version information, IP address, and port.
[0039] At the same time, newly joined nodes will obtain the list of requesting nodes from the node, obtain other active nodes in the current network, and connect with nodes that have not yet established a connection with them based on the node list;
[0040] After successfully establishing a connection, the new node retrieves ledger data from other nodes and synchronizes it.
[0041] Beneficial Effects: This invention provides a highly efficient, secure, and fast-responding blockchain system solution. The parallel chain structure and decoupling mechanism significantly improve the system's transaction processing speed and ledger update speed, increasing throughput and efficiency. The random weight assignment mechanism and tamper-proof hash value set enhance the ledger's security and tamper resistance, while also strengthening the system's resistance to attacks. The optimized ledger convergence mechanism enables rapid stabilization of the ledger state under liveness attacks, improving the system's stability and reliability. Attached Figure Description
[0042] Figure 1 This is a structural diagram of the blockchain system based on the parallel chain structure of this invention.
[0043] Figure 2 This is a comparison chart of the confirmation latency of the blockchain system of the present invention with that of other blockchain systems when it has not been subjected to an active attack.
[0044] Figure 3 This is a comparison chart of the confirmation latency of the blockchain system of the present invention under active attack conditions with other blockchain systems.
[0045] Figure 4This is a comparison chart of the throughput of the blockchain system of this invention with the throughput of other blockchain systems. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, embodiments of this invention, and should not be construed as limiting the invention. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention. In the description of this invention, it should be understood that the terminology used is for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0047] While traditional tree-graph-based blockchain systems can significantly improve throughput by leveraging the concurrency inherent in tree-graph structures, they still suffer from numerous security vulnerabilities. To address the issue of tree-graph-based blockchain systems being susceptible to liveness attacks that prevent ledger state convergence, this invention proposes a scalable blockchain system, P-DAG (Parallel-Directed Acyclic Graph), based on a parallel chain structure. This system offers high throughput, high security, and low confirmation latency.
[0048] The following is combined with Figures 1-4 This invention provides a detailed description of the blockchain system based on a parallel chain structure and its construction method.
[0049] Example 1: This example provides a blockchain system based on a parallel chain structure, such as... Figure 1 As shown. Includes:
[0050] Multiple parallel chains are used, each chain is used to record transactions and the ledger is constructed using the heaviest subtree principle.
[0051] When a node joins the network, it does not need to register. When a node first joins the network, it needs to establish a connection with other nodes through broadcasting to synchronize historical data and the status of other nodes in the network.
[0052] Nodes in the network mine based on the Proof-of-Work (PoW) consensus mechanism. During mining, in order to ensure the tamper-proof nature of the blockchain system, a tamper-proof block needs to be selected on each chain, and the hash value of these blocks is stored in the block header for mining.
[0053] Successful mining nodes assign weights to blocks based on their hash values. The weight of a block is equal to the number of leading zeros in its hash value. The node then broadcasts the mined block to other nodes in the network. This random weighting mechanism reduces ledger convergence time. The randomness of hash values means attackers cannot predict the hash value of the next block in the network, increasing the difficulty for attackers to launch live attacks by maintaining equal weights in the tree.
[0054] By decoupling block creation from on-chain processing, nodes do not need to select a parent block to include in the block header when mining to calculate the hash value. After a node successfully mines, if there are k chains in the system, the hash value is calculated based on the last chain of the block hash value. Determine which chain the block needs to be added to.
[0055] The block structure is changed to ensure the tamper-proof characteristics of the system. Each block contains a set of tamper-proof hash values, which are selected by traversing each chain. Each chain is traversed in depth first according to the principle of the heaviest subtree.
[0056] If multiple blocks in the same layer have the same weight, select the block with the smaller hash value and continue traversing downwards;
[0057] If multiple blocks have the same hash value and the same block weight, then the earlier created block is selected to continue traversing downwards based on the block creation timestamp.
[0058] The way nodes verify blocks differs from traditional blockchain systems. After receiving a block from other nodes in the network, a node verifies it, checking if the block's mining difficulty proof is correct and if a tamper-proof hash value set corresponds to a block in each chain. If the verification passes, the node determines the block's validity based on the last digit of the hash value. The block is added to the leaf node with the largest weight in the heaviest subtree of the chain. If multiple leaf nodes have the same weight, the block is added to the leaf node with the smallest hash value. If multiple leaf nodes have the same hash value, the block is added to the earliest created leaf node.
[0059] The method by which nodes sort blocks in the ledger differs from that of traditional blockchain systems. Nodes in the network reach a consensus on the order of blocks in the ledger. Each node traverses each chain sequentially, starting from the genesis block. It selects the child block with the highest weight and adds it to the end of the block sequence. Then, it adds the child blocks of the child block with the highest weight to the block sequence in ascending order of hash value. From all the child blocks, it selects the block with the highest weight and continues traversing until it reaches a leaf node.
[0060] The theoretical analysis of the blockchain system (P-DAG system) based on the parallel chain structure constructed in the above embodiments is as follows:
[0061] To analyze a P-DAG system, we first need to define some parameters. Assume there is n nodes in the network, and an attacker A exists who can control the proportion of nodes in the network. The controlled nodes are called Byzantine nodes, and the proportion of honest nodes is... Assuming each node in the system has k chains in its local ledger, and the hash function is modeled as a random oracle, each node can only perform one hash operation at any given time. Therefore, the number of hash operations that attacker A can perform at any given time in this system is... Next. Assume the mining difficulty of the node is... ,in This represents the expected time required for a new block to be generated in the network. The distance between blocks represents the number of edges on the path between two blocks.
[0062] Lemma 1: For any At t=r, in a chain of the local ledger of honest nodes in the network, for any block b located on the heaviest subtree, when t=r+T, the expected increase in the weight of block b and the block it points to is greater than or equal to... , where avg is the weight of each block itself.
[0063] Proof: The weight of a block equals its own weight plus the sum of the weights of blocks in the subtree rooted at that block. Since hash values are random and follow a uniform distribution, according to the random weight assignment mechanism based on hash values, the weight range of each block is [x, 255], where x represents the number of leading zeros required for a valid block's hash value. For simplicity, the following analysis assumes that the weight of each block is equal, avg = ... Let S represent the main chain selected according to the principle of the most weighted subtree in any chain in the ledger. Whenever a node packages a block or receives a block b' from another node in the network, block b' is either on S or it branches off from the root node at some block b in S, meaning block b' is a child block of block b. Let X represent the time required to increase the length of S by 1. If an honest node successfully mines a block, the time required is at most 1 / s. In time, all honest nodes in the network will receive the block. Since the average time required for honest nodes to mine a block is... ,so Therefore, the maximum time required to increase the weight of a certain block by avg is... Let N(T) be a random variable representing the number of blocks added within time period T. According to the Chernoff-Hoeffding inequality, at time... In the internal ledger, the weight of the main chain S, selected according to the principle of the heaviest subtree, is increased. The probability is .
[0064] Lemma 2: Let subTree represent a subtree of a chain in the ledger at time r, where only malicious nodes mine in this subtree, honest nodes mine in another subtree, and they share the same parent node. At time r+T, an honest node in the network receives a block from the subtree subTree for the first time. There exists a negligible function... , satisfy when At that time, the probability that the subTree intersects with the main chain of any honest node (i.e., the probability that an attacker successfully executes a double-spending attack) is less than or equal to .
[0065] Proof: Continuing with the assumptions in Lemma 1, each block has a weight of avg. Let block b represent the parent block of the subtree. Since honest nodes in the network are unaware of the subtree's existence, they mine on the subtree rooted at the other child nodes of block b, let's assume this subtree is B. At time T, the honest node receives its first block from the subtree. To prevent a double-spending attack, the honest node must mine more blocks than the attacker within time T. By Lemma 1, the honest node's mining rate is... The attacker's mining rate is Attackers can exploit network latency to cause inconsistencies in the local ledgers of some nodes. Therefore, to eliminate the impact of network latency, if... If this holds true, then according to the Chernoff-Hoeffding inequality, it can be guaranteed that the probability of an attacker making the subtree the heaviest subtree is less than [a certain value]. .
[0066] Lemma 3: Suppose that the weight of the heaviest subtree of a chain in the ledger increases by in time T. Then there exists a threshold. , making when At that time, attackers cannot exploit network latency to launch live attacks.
[0067] Proof: Lemma 3 provides the condition for block confirmation and the proof. The block generation process on each chain follows a Poisson distribution with parameter λ, where... Each block on the chain has a weight represented by a random variable W. This represents the sum of block weights arriving at a certain chain in the system at time t. Suppose that a hash value satisfying the mining conditions must contain at least x leading zeros. Since hash values follow a uniform distribution, therefore... , Let N(T) represent the number of blocks generated within time T. Let represent the block weight. Then, in time T, the sum of the weights of the newly added blocks in the system is... .because Since the random variables are independent and identically distributed, and each has a finite expectation and variance, according to the Central Limit Theorem, S(T) can be approximated as a normal distribution, i.e. ,in It represents the variance of the sum of weights of all blocks in the system.
[0068] Suppose attacker A wants to attack a chain. A needs to maintain at least one subtree on the chain with a weight close to the weight of the heaviest subtree. Starting from the moment attacker A launches the attack, a random variable... and These represent the increases in the weight of the subtree maintained by the honest node and the attacker, respectively, within time T. and Let T and T represent the average block weights of honest nodes and attackers on a certain chain within time T, respectively. and Let represent the variances of the total block weights generated by honest nodes and attackers within time period T, respectively. .because and They are all normally distributed and independent of each other, therefore It also follows a normal distribution. Transforming into a standard normal distribution yields A block can be securely confirmed if, after confirmation, the probability that the main chain containing that block will be replaced in the future is extremely low. The probability is very small, let's assume it's 1%, so... Convert to ,set up Under the standard normal distribution, such that Substitute 0.01 D represents the confirmation threshold, so D = -2.326 Simplifying, we get Satisfying the demand When T increases, the root block of the heaviest subtree can be confirmed, and the probability of this block being replaced by an attacker decreases exponentially. Therefore, when the difference between the weight of the heaviest subtree and the weight of any other subtree is greater than D, the root block of the subtree can be confirmed while ensuring security.
[0069] By Lemma 1, we can obtain that in time T, for any The difference between the weight of the subtree maintained by the honest node and the weight of the subtree maintained by the attacker is Diff = ,make , can be obtained Therefore, as long as the following conditions are met... This can ensure that the system is protected from active attacks by attackers.
[0070] Since the k chains of this invention are independent of each other, and any one chain satisfies the above three lemmas, the entire system also satisfies the above three properties.
[0071] To verify the system performance, a simulation experiment was conducted:
[0072] Figure 2 The comparison of the acknowledgment latency between the P-DAG system and GHOST and Conflux is shown when the attacker does not perform an active attack and different parameters k are set. It can be seen that when k=16, the acknowledgment latency of P-DAG is the smallest and is less than that of GHOST and Conflux.
[0073] Figure 3 This demonstrates the convergence time of ledgers in different blockchain systems under a liveness attack, where d represents the weight difference between the two heaviest subtrees in a P-DAG, such as... Figure 3 As shown, from the start of an attacker's live attack, it takes approximately 1800 seconds for the difference d between the weights of the heaviest subtree and the weights of other subtrees to exceed D, ultimately leading to ledger convergence. In contrast, Conflux's adaptive adjustment mechanism requires 4000 seconds to create a significant difference between the weights of the heaviest subtree and the weights of other subtrees, resulting in ledger convergence. Therefore, under live attack conditions, the convergence speed of P-DAG is more than twice that of Conflux.
[0074] Figure 4The comparison of throughput between P-DAG, GHOST, and Conflux shows that the throughput of the P-DAG system is higher than that of the GHOST system and close to that of the Conflux system. Theoretically, the throughput of the P-DAG system should be k times that of GHOST, but this is not achieved, mainly due to physical factors such as network bandwidth. The throughput of the P-DAG system is slightly lower than that of Conflux because Conflux is a graph-based blockchain system with higher concurrency; all blocks in the ledger are included in the block output sequence of Algorithm 3. P-DAG, on the other hand, is a tree-based blockchain system. Although the ledger convergence speed is faster than Conflux, some blocks are not on the heaviest subtree in the final convergence during the period from system startup to ledger convergence. For system security reasons, these blocks are discarded and not included in the system throughput.
[0075] This invention employs multiple parallel chains as the ledger structure, decoupling block creation from on-chain processing. This disperses the computing power of malicious nodes, enhancing the overall system security. Leveraging the randomness and uniform distribution of hash values, a random weight assignment mechanism based on hash values is designed to reduce the convergence time of each chain and the block confirmation latency. Theoretical analysis and simulation experiments show that P-DAG has similar throughput to Conflux, but the required ledger convergence time is reduced by approximately 50% compared to Conflux, and the block confirmation latency is reduced by approximately 30%.
[0076] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A blockchain system based on a parallel chain structure, characterized in that, include: Multiple parallel chains, each used to record transactions and construct the ledger using the heaviest subtree principle; Each block is assigned a random weight based on the number of leading zeros in its hash value after it is created; By decoupling block creation from the on-chain process, after a node successfully mines, if there are k chains in the system, the last chain is determined based on the block hash value. The bit determines which chain the block will be added to; Each block contains a set of tamper-proof hash values, which is selected by traversing each chain and according to the principle of the heaviest subtree; the selection method for the set of tamper-proof hash values for each block is as follows: Traverse each chain, performing a depth-first traversal of each chain according to the principle of the heaviest subtree; If multiple blocks in the same layer have the same weight, select the block with the smaller hash value and continue traversing downwards; If multiple blocks have the same hash value and the same block weight, select the earlier created block based on the block creation timestamp and continue traversing downwards. The node performs a verification mechanism on the received block, verifying its hash value and tamper-proof hash value set.
2. The blockchain system based on a parallel chain structure according to claim 1, characterized in that, When a node joins the network, it establishes a connection with other nodes through broadcasting, synchronizes historical data and the state of other nodes in the network, and verifies historical data through the PoW consensus mechanism.
3. The blockchain system based on a parallel chain structure according to claim 1, characterized in that, After each block is created, it is assigned a random weight based on the number of leading zeros in its hash value. Specifically, each block is assigned a weight by calculating the number of leading zeros in its hash value, and the weight of the block is equal to the number of leading zeros in its hash value.
4. The blockchain system based on a parallel chain structure according to claim 1, characterized in that, The node performs a verification mechanism on the received block, verifying its hash value and tamper-proof hash value set. The specific method is as follows: After a node receives a block in the network, it first verifies whether the block's hash value meets the conditions. If it does, it then traverses k chains to determine whether the block in the anti-tampering hash value set actually exists in each chain and whether it is located on the main chain.
5. The blockchain system based on a parallel chain structure according to claim 1, characterized in that, The method by which nodes sort blocks in the ledger is as follows: The node iterates through each chain sequentially, starting from the genesis block. It selects the child block with the highest weight and adds it to the end of the block sequence. The child blocks of the sub-block with the largest hash value are added to the block sequence in ascending order. Select the block with the highest weight from all child blocks and continue traversing until a leaf node is reached.
Citation Information
Patent Citations
Method for improving security of block chain system based on hybrid consensus algorithm of PoW + PoS
CN115442379A
Blockchain consensus method, apparatus, and device, and storage medium
US20240163121A1