Non-redundant parallel blockchain system and method with variable difficulty

By introducing S-MerkleTree and Bloom filter group BFS into the blockchain system, combined with m-for-1 idea and variable difficulty control, the problem of transaction redundancy and confirmation delay in the parallel blockchain system is solved, and the efficiency is improved Blockchain’s throughput and applicability enhance security.

CN114817397BActive Publication Date: 2024-08-23WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210049233.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-17
Publication Date
2024-08-23
Estimated Expiration
2042-01-17

AI Technical Summary

Technical Problem

Existing blockchain technology has problems in scalability, transaction redundancy and block confirmation delays. Especially in parallel blockchain systems, it is difficult to effectively improve throughput and adapt to changes in block generation capabilities, and there are resource constraints Waste and security threats.

Method used

Designed a non-redundant parallel blockchain system with variable difficulty, using S-MerkleTree and Bloom filter group BFS, combined with m-for-1 idea, to achieve parallel block generation and difficulty control, and optimize the block confirmation mechanism , solving the problems of transaction redundancy and block confirmation delay.

Benefits of technology

It improves the transaction throughput of the blockchain, reduces resource waste, enhances the applicability and security of the blockchain, achieves efficient block confirmation, and is suitable for complex many-to-one block generation scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114817397B
    Figure CN114817397B
Patent Text Reader

Abstract

The present invention discloses a non-redundant parallel blockchain system and method with variable difficulty, the system includes an architecture module, a parallel mining module, a difficulty control module and a global serialization module; the architecture module is used to provide an overall architecture for the parallel blockchain system, covering the necessary layers of the blockchain; the parallel mining module is used to concurrently generate blocks to build a parallel mode blockchain, including collecting preliminary information to build a full block and performing workload hashing and filling the block body to generate a new block; the difficulty control module is used in a variable mining capacity scenario, compatible with parallel block generation and difficulty control at the same time; the global serialization module is used for parallel blockchain systems to confirm blocks, verify existence and serialize into a valid account book in scenarios where a global account book is required. The present invention solves the problem of poor scalability, handles the problem of transaction tolerance redundancy, proposes a difficulty value control method, and designs an efficient serialization mechanism, which is very meaningful for the continuous development of blockchain protocols to adapt to more needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of blockchain, and relates to a non-redundant parallel blockchain system and method, and specifically designs a non-redundant parallel blockchain system and method with variable difficulty. Background Art

[0002] Blockchain technology originated from Bitcoin invented by Satoshi Nakamoto in 2008. The Nakamoto protocol uses Proof of Work (PoW) to collect transactions and solve computational problems, and reach consensus on the latest state of the block sequence according to the longest chain principle. The Nakamoto protocol is simple and has high security, but as the demand becomes more complex, its poor scalability has attracted more attention (7 transactions per second). Inherited from the CAP theory of distributed systems, there is a ternary relationship between security, scalability, and degree of decentralization in blockchain protocol design. Weighing the ternary relationship and improving the scalability of the Nakamoto protocol is one of the key issues in the blockchain field. Although a large number of solutions to expand the Nakamoto protocol have been proposed (such as GHOST, Bitcoin-NG, Subchain, Fruitchain, etc.), the performance improvement is limited due to its reliance on the Nakamoto protocol architecture. Breaking away from the traditional single chain model, the idea of ​​using directed acyclic graph (DAG) to organize blocks was born (such as Spectre, Conflux, Phantom, etc.), generating blocks concurrently, and using divergent blocks to maintain the DAG structure to improve throughput. However, this type of work branches diverges and it is difficult to maintain block connections, making the implementation complex and difficult to provide an efficient confirmation mechanism. The Spectre solution does not provide a specific implementation, and the Conflux solution compresses the DAG into a single chain for confirmation, limiting its performance. Based on previous work, the present invention believes that the 2-for-1 concept (the document Bitcoin Backbone Protocol) implements the m-for-1 multi-to-one block generation idea to further solve the scalability problem. Multiple blockchain nodes generate blocks on multiple chains at the same time, but each blockchain node can only append blocks to a certain chain at a time, and a parallel structure is maintained globally. Compared with DAG, the parallel structure is more structured. Solutions OHIE, Prism, ParallelChain, ChainWeb, etc. also implement similar m-for-1 ideas, but there are still some unresolved issues.

[0003] First, in a distributed environment, the same transaction may be collected into different blocks by different blockchain nodes, which is the problem of transaction redundancy. The probability of this problem is higher when blocks are generated concurrently in a parallel structure. Even if redundant transactions can be found during verification, it still causes resource waste and extra overhead. Existing solutions such as Conflux, OHIE, and Prism do not consider this problem or directly ignore duplicate transactions. If the transaction redundancy problem is solved before block broadcasting, the throughput will be effectively improved. Designing a blockchain protocol that implements the m-for-1 block generation idea and solves transaction redundancy is the key to improving scalability.

[0004] Secondly, blockchains based on proof of work need to adapt to the changing capacity of block generation. Since the birth of Bitcoin, the capacity of block generation has increased by nearly 1014 times. If the original difficulty value is still used to solve the hash problem, the block interval will drop from 10 minutes to 6 picoseconds, resulting in an excessively high fork rate, which seriously undermines the security of Bitcoin and tolerates malicious block generation capacity from 50% to 10-11. Using the difficulty value adjustment algorithm to change the target threshold can prevent this situation. However, it cannot be directly applied to parallel structures, and it is necessary to give a difficulty adjustment algorithm suitable for parallel chain protocols.

[0005] Finally, the execution of blockchain is a process of continuously appending new blocks to the confirmed block sequence to update the transaction ledger. Bitcoin is compared to a block tree that continuously selects the longest branch. The multiple chains of the parallel chain protocol in this article are equivalent to multiple block trees. The random block generation makes the relationship between blocks on different chains not intuitive. The Prism scheme mainly includes two types of structures: submission tree and voting tree. Multiple voting trees optimize the block confirmation delay of the submission tree, but its block submission depends on a single block tree, and random block generation causes its performance to have a "short board effect". The OHIE scheme uses the Nakamoto protocol when confirming each block tree, and predefines the global block order between multiple block trees through the (rank, next_rank) field. However, the predefined order is not completely consistent with the block joining time, which may introduce security threats. Designing a global block sequence that fits the parallel chain is the key to an efficient and secure blockchain protocol. Summary of the invention

[0006] To solve the above problems, the present invention designs a new transaction integration structure S-MerkleTree and m-for-1 idea to propose a parallel chain protocol that alleviates transaction redundancy and effectively improves the transaction throughput of the blockchain. A variable difficulty value mechanism suitable for the parallel chain protocol is given to optimize the application scenarios of the parallel chain. The Bloom filter group BFS is constructed to design a block confirmation mechanism that fits the parallel chain and improves the block confirmation delay.

[0007] The technical solution adopted by the system of the present invention is: a non-redundant parallel blockchain system with variable difficulty, including an architecture module, a parallel block generation module, a difficulty control module and a global serialization module;

[0008] The architecture module is used to provide an overall architecture for the parallel blockchain system, covering all layers of the blockchain, including the application layer, protocol layer, data layer, consensus layer and network layer;

[0009] The parallel block generation module is arranged in the data layer and the consensus layer, and is used to concurrently generate blocks to build a parallel mode blockchain, including collecting preliminary information to build a full block and performing workload hashing and filling the block body to generate a new block; the full block contains information of all parallel branches and all types of transaction information. After the workload hashing, the new block is obtained by retaining valid information and providing relevant proofs according to the parallel block generation principle; the database in the data layer stores transaction and block information, wherein transactions are integrated using an improved sparse Merkel tree structure, and multi-branch blocks are integrated using a traditional Merkel tree structure;

[0010] The difficulty control module is set in the consensus layer and is used in scenarios with variable block generation capabilities, compatible with parallel block generation and simultaneous difficulty control;

[0011] The global serialization module is set in the consensus layer and the network layer, and is used to perform block confirmation, existence verification and serialization into a valid ledger for the parallel blockchain system in scenarios where a global ledger is required.

[0012] The technical solution adopted by the method of the present invention is: a non-redundant parallel blockchain method with variable difficulty, using a parallel block generation module to generate blocks, and the specific implementation includes the following steps:

[0013] Step 1: The blockchain nodes participating in the workload competition collect the preliminary information required to generate blocks and construct a full block, which contains information about all parallel branches and all types of transaction information. After the workload hash, the valid information is retained according to the parallel block generation principle and relevant proofs are given to obtain a new block;

[0014] Step 2: Process the preliminary information to generate a preliminary block header and perform workload hashing;

[0015] Step 3: When several blockchain nodes are mining blocks concurrently, the blockchain nodes can generate blocks on multiple blockchain branches at the same time, integrate all branches as pre-information and perform hash calculations, classify the block hashes, and each blockchain node only appends one blockchain branch at a time;

[0016] Step 4: Fill the block according to the hash classification obtained in step 3 to generate a new block;

[0017] Step 5: Broadcast the block;

[0018] Step 6: The rest of the blockchain nodes verify the block and update their local databases.

[0019] The present invention also provides a non-redundant parallel blockchain method with variable difficulty, which is characterized by: using a difficulty control module to be compatible with parallel block generation and perform difficulty control at the same time under variable block generation capacity scenarios;

[0020] Select chain0 with a parallel chain ID of 0 as the pivot chain, and its difficulty value changes using the Bitcoin difficulty value control algorithm; the difficulty value changes of the remaining chain instances follow chain0; when collecting meta information for non-pivot chains, select the latest block of the pivot chain as the difficulty reference parent pivotParent; the difficulty value of the next block of pivotParent on the pivot chain will be used as the difficulty value of the non-pivot chain block that references the block, and the calculation is based on the past block interval using the Bitcoin difficulty value control algorithm; among them, the selection of pivotParent must be non-decreasing in difficulty;

[0021] After the difficulty value is selected and the block generation is completed, if there is a disagreement, that is, multiple blocks appear to be selected in the same block generation cycle and the same chain instance, the heaviest chain principle is adopted, that is, the block with a larger difficulty value is selected and retained.

[0022] The present invention also provides a non-redundant parallel blockchain method with variable difficulty, characterized in that: when the parallel blockchain system performs block confirmation and existence verification in a scenario requiring a global ledger and serializes it into a valid ledger, a global serialization module and a serialization method that matches the parallel chain are used;

[0023] The specific implementation includes the following steps:

[0024] Step 1: Construct a data structure Bloom filter group containing historical state information to provide the existence of the confirmed block relative to the current block;

[0025] Assume that the current block generation cycle is Rn, the security parameter is set to k, the confirmed block is the block of cycle Rn-k, there are block confirmations of Rn cycle, and the blocks to be confirmed are in the range of Rn-k+1 to Rn-1;

[0026] Step 2: Ensure that the block confirmation process can be executed safely, and append block fields to the data layer of the architecture layer to ensure the consistency and non-tamperability of the global confirmation results;

[0027] Step 3: Serialize the block using the block information and embedded fields.

[0028] Compared with the prior art, the advantages and positive effects of the present invention are mainly reflected in the following aspects:

[0029] (1) The present invention designs a parallel many-to-one block generation mode to achieve block concurrency while ensuring structuring, and designs a new storage structure to solve the problem of redundant records, avoid resource waste and additional overhead, and actually improve the transaction throughput of the blockchain.

[0030] (2) The present invention designs a variable difficulty value mechanism, unifies the block generation difficulty changes in the complex parallel chain mode, improves the high fork rate risk that may be caused by poor adaptation to fixed difficulty, and significantly enhances the applicable scenarios of the parallel mode blockchain of the present invention. It can increase the adaptability of the present invention to changes in computing power.

[0031] (3) A global serialization mechanism is designed and proposed, which provides a method to overcome the confirmation limitations of the single-chain mode in the parallel mode, achieves efficient and fast confirmation, effectively reduces the block confirmation delay, and provides universal support for high-frequency trading and timely trading scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 is a system principle diagram of an embodiment of the present invention;

[0033] Figure 2 The overall system architecture diagram of an embodiment of the present invention;

[0034] Figure 3 A flow chart of parallel block generation in an embodiment of the present invention;

[0035] Figure 4 A new sparse Merkle tree structure diagram in an embodiment of the present invention;

[0036] Figure 5 A schematic diagram of a difficulty adjustment algorithm in an embodiment of the present invention;

[0037] Figure 6 Schematic diagram of the block confirmation mechanism in an embodiment of the present invention. DETAILED DESCRIPTION

[0038] In order to facilitate the understanding and implementation of the present invention by those skilled in the art, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the implementation examples described herein are only used to illustrate and explain the present invention and are not used to limit the present invention.

[0039] Please see Figure 1 and Figure 2 , a non-redundant parallel blockchain system with variable difficulty provided by the present invention includes an architecture module, a parallel block generation module, a difficulty control module and a global serialization module;

[0040] The architecture module of this embodiment is used to provide an overall architecture for the parallel blockchain system, covering all layers of the blockchain, including the application layer, protocol layer, data layer, consensus layer, and network layer;

[0041] The parallel block generation module of this embodiment is set in the data layer and the consensus layer, and is used to concurrently generate blocks to build a parallel mode blockchain, including collecting preliminary information to build a full block and performing workload hashing and filling the block body to generate a new block; the full block contains information of all parallel branches and all types of transaction information. After the workload hashing, the new block is obtained by retaining valid information and providing relevant proofs according to the parallel block generation principle; the database in the data layer stores transaction and block information, where transactions are integrated using an improved sparse Merkel tree structure, and multi-branch blocks are integrated using a traditional Merkel tree structure;

[0042] The difficulty control module of this embodiment is set in the consensus layer and is used in scenarios with variable block generation capabilities, compatible with parallel block generation and simultaneous difficulty control;

[0043] The global serialization module of this embodiment is set in the consensus layer and the network layer, and is used to perform block confirmation, existence verification and serialization into a valid ledger for the parallel blockchain system in scenarios where a global ledger is required.

[0044] The consensus layer of this embodiment is provided with a consensus module for executing the process from block generation to release, including realizing a parallel chain without duplicate transactions, utilizing a block generation mechanism of state change difficulty, and obtaining a confirmation method for a global block sequence.

[0045] The consensus layer of this embodiment is also provided with a verification module for verifying the legitimacy of the workload difficulty value and verifying the consistency and integrity of the block body information and related proofs filled after hash calculation with the collected information, and verifying the workload of the new block and related information with the membership proof of the Merkle tree root.

[0046] The parallel block generation module of this embodiment is used to realize the overall architecture of the parallel chain and handle the corresponding transaction redundant record problem. A new storage structure S-MerkleTree is designed and a new mode of transaction verification is provided; the difficulty value control module of this embodiment is used to improve the applicability of the present invention, and the variable difficulty principle of the parallel mode and the design points for ensuring security and activity are provided based on the Bitcoin difficulty control algorithm; the global serialization module of this embodiment constructs a new existence proof structure BFS so that the global block can be quickly confirmed without waiting for local confirmation, and the solidified global sequence is universal for the parallel chain mode. The present invention solves the problem of poor scalability, handles the problem of transaction tolerance redundancy, proposes a difficulty value control method, and designs an efficient serialization mechanism. The present invention is very meaningful for the continuous development of blockchain protocols to adapt to more needs.

[0047] Please see Figure 3The present invention provides a non-redundant parallel blockchain method with variable difficulty, which uses a parallel block generation module to generate blocks. The specific implementation includes the following steps:

[0048] Step 1: Initialize the system, create a transaction pool and create m blocks, where m represents the number of parallel chain instances in this embodiment. After initialization, execution starts from step 2.

[0049] Step 2: The blockchain node collects preliminary meta information including the previous blocks and transactions of multiple branches, etc., which are used to build the full block. After the full block is built, it proceeds to step 6.

[0050] Step 3: Collect transaction information from the transaction pool. To solve the problem of redundant transaction records, a mapping relationship between transactions and chain instance numbers is established based on the post-logm bit of the transaction ID.

[0051] Step 4: Collect pre-information. To implement the m-for-1 principle of block generation, collect the latest blocks of m chain instances as the latest state.

[0052] The many-to-one block generation principle of this embodiment is that the blockchain node can generate blocks on multiple blockchain branches at the same time, integrate all branches as pre-information and perform hash calculation, classify the block hash, and each blockchain node only appends one blockchain branch at a time; the many-to-one block generation principle of this embodiment is intended to build multiple parallel blockchain branches, realize multiple blockchain nodes to generate multiple blocks concurrently, and each blockchain node extends one branch at a time. The blockchain node cannot predict the branch to be extended before the hash calculation, integrates all branch information, and determines the extended branch according to the block hash after the workload hash calculation.

[0053] Step 5: Collect confirmation information. To achieve fast confirmation, collect m Bloom filter groups BFS from the latest block in step 4 as confirmation information.

[0054] Step 6: Process the metadata to construct a full block and generate a preliminary block header;

[0055] Step 6.1: Process transaction information to solve transaction redundancy. Under the many-to-one concept, blockchain nodes cannot predict which chain instance to append blocks to in the future before hash calculation. Merkle tree structure is used for integration, but if blockchain nodes cannot collect all m types of transactions, the traditional Merkle tree will be unstable and difficult to provide existence proof. Construct sparse Merkle tree S-MerkleTree as shown in the attached Figure 4 The transaction constructs the branches of the S-MerkleTree according to the mapping relationship.

[0056] Step 6.2: Process the previous information to achieve many-to-one parallel block generation. Take the latest blocks of m chain instances as the previous state and integrate them using the Merkle tree.

[0057] Step 6.3: Process the confirmation information and merge the collected m Bloom filter sets BFS (BloomFilterSets) as confirmation information.

[0058] Step 6.4: Use the transaction root of step 6.1, the previous root of step 6.2, the confirmation information hash summary of step 6.3, and a random number to construct a preliminary block header.

[0059] Step 7: Continuously change the random number, perform workload hash calculation, the block hash meets the target value, and obtain the real block header. Note that the target value of the present invention is not a fixed parameter based on the difficulty value control mechanism.

[0060] Step 8: Perform hash classification based on the block hash in step 7 to achieve many-to-one block generation. The block will be appended to the chain instance with post-logM bits, and the corresponding chain instance ID will be obtained naturally.

[0061] Step 9: Fill in the block content according to the chain instance ID in step 8;

[0062] Step 9.1: Fill in transactions. Keep the transactions under the i-th branch of S-Merkle (i corresponds to the chain ID) and provide membership proof. The present invention uses Merkle proof as membership proof, and the Merkle proof of S-MerkleTree is consistent with the traditional Merkle proof.

[0063] Step 9.2: Fill in the previous parent. Connect the previous block of the chain instance to the new block based on the chain ID and provide membership proof. The proof of the present invention is to ensure integrity and non-tamperability.

[0064] Step 9.3: Fill in confirmation information. Compress the hash of the new block with BloomFilter and append it to the BloomFilter group BFS in step 6.3 as key information for the subsequent global serialization confirmation mechanism.

[0065] Step 10: Broadcast the complete new block.

[0066] Step 11: After receiving the new block, the blockchain node verifies its legitimacy and integrity;

[0067] Step 11.1: Verify that the workload hash meets the target value and recalculate the checksum.

[0068] Step 11.2: Verify transaction information integrity and membership proof; verify the membership proof and consistency of the predecessor parent; verify the consistency of the confirmation information.

[0069] Step 12: Update the local database. When most nodes in the entire network have updated their status, the blockchain status changes.

[0070] Please see Figure 5 The present invention provides a non-redundant parallel blockchain method with variable difficulty, which adopts a difficulty control module and is compatible with parallel block generation and difficulty control in variable block generation capacity scenarios;

[0071] Select chain0 with a parallel chain instance ID of 0 as the pivot chain, and its difficulty value changes according to the Bitcoin difficulty value control algorithm; the difficulty value changes of the remaining chain instances follow chain0; when collecting meta information for non-pivot chains, select the latest block of the pivot chain as the difficulty reference parent pivotParent. The difficulty value of the next block of pivotParent on the pivot chain will be used as the difficulty value of the non-pivot chain block that references the block. The difficulty value calculation is based on the past block interval using the Bitcoin difficulty value control algorithm; the selection of pivotParent must be non-decreasing in difficulty. Avoid attackers referencing old blocks to perform selfish block generation attacks.

[0072] After the difficulty value is selected and the block generation is completed, if there is a disagreement, that is, multiple blocks appear to be selected in the same block generation cycle and the same chain instance, the heaviest chain principle is adopted, that is, the block with a larger difficulty value is selected and retained.

[0073] The block selection of this embodiment is compatible with the confirmation mechanism of global serialization, which can achieve fast and efficient block selection and main chain selection. It solves the problem of random block addition under multiple parallel chain instances, and the difficulty value regulation needs to coordinate the global state. It ensures that the difficulty value regulation does not introduce new security risks.

[0074] The difficulty value control module of this embodiment needs to be compatible with the other modules, and needs to confirm the mode modification and difficulty value change principle.

[0075] Please see Figure 6 The present invention provides a non-redundant parallel blockchain method with variable difficulty. When the parallel blockchain system performs block confirmation and existence verification in a scenario where a global ledger is required and serializes it into a valid ledger, a global serialization module and a serialization method that matches the parallel chain are used;

[0076] The specific implementation includes the following steps:

[0077] Step 1: Assume that the current block generation cycle is Rn, the security parameter is set to k, the confirmed block is the block of cycle Rn-k (with block confirmation of Rn cycle), and the block to be confirmed is in the range of Rn-k+1 to Rn-1.

[0078] In this embodiment, under the security confirmation cycle parameters, the pending blocks are used to ensure tolerance to malicious attacks and self-errors; in simple terms, the pending blocks refer to blocks that have not yet been globally publicly authenticated.

[0079] In this embodiment, backward existence verification and sliding window method are used to perform block confirmation and existence verification; the confirmation window is determined according to Rn and k, and the block on the left edge of the window will be confirmed when the block on the right edge is generated; the confirmation can not only confirm the block of Rn cycle with successful block generation, but also the subsequent blockchain nodes can confirm and update their own database;

[0080] When generating a block, the blockchain node fills its own block information into the Bloom filter group BFS; when confirming a block, the blockchain node collects the previous information and merges the BFS; when confirming a block, the blockchain node verifies the existence of the collected BFS. When its own period is Rn, the block of the Rn-k period can be verified for existence in the merged BFS, which means it is considered to be confirmable; when a majority of people globally confirm a block, the block is confirmed.

[0081] In this embodiment, the confirmation window is maintained at a size of K using a sliding window concept. When the size of the BFS of the preceding block is K, the new block needs to remove the Bloom filter at the bottom of the confirmed BFS and then append its own Bloom filter to the top of the BFS when merging the BFS.

[0082] Step 2: After the block is confirmed, it can be solidified, and the block confidence and embedded fields are used to serialize the block, generate a global block sequence, and calculate the latest ledger.

[0083] Because it is a multi-parallel chain mode, the solidification uses the instance ID and block cycle for sorting, and the overall protocol of the present invention runs to complete a single instance implementation.

[0084] In this embodiment, the confirmation cycle is prioritized, and the global block list is given in ascending order. Blocks that are not in the global sequence (greater than the left edge cycle of the window) are in the pending confirmation state and cannot change the final ledger.

[0085] This embodiment ensures that the block confirmation process can be executed safely, and appends block fields to the data layer of the architecture layer to ensure the consistency and non-tamperability of the global confirmation results;

[0086] In this embodiment, the majority principle is aimed at making decisions based on principle 3 of the difficulty value control module when there is a disagreement in the block. The majority principle is the guarantee of distributed final consistency.

[0087] The architecture module of the present invention provides the overall system architecture for the present invention, and defines that the architecture of the blockchain mainly includes the network layer, consensus layer, data layer, protocol layer and application layer, wherein the present invention mainly introduces the data layer and consensus layer, and the remaining layers have a supporting role for the present invention. The parallel block generation module constructs the main body of the consensus layer of the present invention, mainly including the proposal of many-to-one block generation ideas, preliminary information collection, proof of work hash and block filling, block verification and release, etc., covering the overall process from block generation to release. The difficulty value control module is intended to improve the applicability of the present invention. The protocol based on proof of work to handle the change of computing power is a necessary requirement. The present invention provides the difficulty control principle and specific implementation method of the parallel chain. The global serialization module mainly includes two parts: block confirmation and solidification, which are used to reduce the block confirmation time and provide a global block sequence. The present invention constructs a new blockchain protocol to solve the problem of poor scalability, handles the problem of transaction tolerance redundancy, proposes a difficulty value control method, and designs an efficient serialization mechanism. The present invention is very meaningful for the continuous development of blockchain protocols to adapt to more needs.

[0088] It should be understood that the above description of the preferred embodiment is relatively detailed and cannot be regarded as limiting the scope of patent protection of the present invention. Under the enlightenment of the present invention, ordinary technicians in this field can also make substitutions or modifications without departing from the scope of protection of the claims of the present invention, which all fall within the scope of protection of the present invention. The scope of protection requested for the present invention shall be based on the attached claims.

Claims

1. A non-redundant parallel blockchain system with variable difficulty, characterized by: Including architecture module, parallel mining module, difficulty control module and global serialization module; The architecture module is used to provide an overall architecture for the parallel blockchain system, covering all layers of the blockchain, including the application layer, protocol layer, data layer, consensus layer and network layer; The parallel mining module is arranged in the data layer and the consensus layer, and is used to concurrently generate blocks to build a parallel mode blockchain, including collecting preliminary information to build a full block and performing workload hashing and filling the block body to generate a new block; the full block contains information of all parallel branches and all types of transaction information. After the workload hashing, the new block is obtained by retaining valid information and providing relevant proofs according to the parallel mining principle; the database in the data layer stores transaction and block information, wherein transactions are integrated using an improved sparse Merkel tree structure, and multi-branch blocks are integrated using a traditional Merkel tree structure; The improved sparse Merkle tree structure is a nested Merkle tree structure, and there are two layers of Merkle trees with ω and ωi as roots; if there are two types of transactions, where transaction 0 and transaction 1 are first-type transactions, and transaction 2 and transaction 3 are second-type transactions; then the sparse Merkle tree uses all transactions of the first type as leaves to perform traditional Merkle tree integration to obtain the root ω0, and similarly, the second-type transactions obtain the root ω1, completing the construction of the lower tree; then, the hash value of the first transaction of each type of transaction and the Merkle root of each type of transaction are used as leaf nodes, and traditional Merkle integration is performed again to finally obtain the sparse Merkle tree root ω; The difficulty control module is set at the consensus layer and is used in scenarios with variable mining capacity, compatible with parallel block generation and simultaneous difficulty control; Among them, chain0 with a parallel chain ID of 0 is selected as the pivot chain, and its difficulty value changes adopt the Bitcoin difficulty value regulation algorithm; the difficulty value changes of other chain instances follow chain0; when collecting meta information for non-pivot chains, the latest block of the pivot chain is selected as the difficulty reference parent pivotParent; the difficulty value of the next block of pivotParent on the pivot chain will be used as the difficulty value of the non-pivot chain block that references the block, and the calculation is based on the past block interval using the Bitcoin difficulty value regulation algorithm; among them, the selection of pivotParent must be non-decreasing in difficulty; After the difficulty value is selected and the block generation is completed, if there is a disagreement, that is, multiple blocks appear in the same mining cycle and the same chain instance to be selected, the heaviest chain principle is adopted, that is, the block with the larger difficulty value is selected and retained; The global serialization module is set in the consensus layer and the network layer, and is used to perform block confirmation, existence verification and serialization into a valid ledger for the parallel blockchain system in scenarios where a global ledger is required.

2. The variable difficulty non-redundant parallel blockchain system according to claim 1, characterized in that: The consensus layer is provided with a consensus module for executing the process from block generation to release, including realizing a parallel chain without duplicate transactions, and utilizing a mining mechanism of state change difficulty to obtain a confirmation method for a global block sequence.

3. The variable difficulty non-redundant parallel blockchain system according to claim 1, characterized in that: The consensus layer is provided with a verification module for verifying the legitimacy of the workload difficulty value and verifying the consistency and integrity of the block body information and related proofs filled after hash calculation for the collected information, and verifying the workload of the new block and related information for the membership proof of the Merkle tree root.

4. A non-redundant parallel blockchain method with variable difficulty, applied to the system according to any one of claims 1 to 3; characterized in that: The parallel mining module is used to generate blocks. The specific implementation includes the following steps: Step 1: Miners participating in the workload competition collect the preliminary information required to generate blocks and construct a full block, which contains information about all parallel branches and all types of transaction information. After the workload hash, valid information is retained according to the parallel mining principle and relevant proofs are given to obtain a new block; Step 2: Process the preliminary information to generate a preliminary block header and perform workload hashing; Step 3: When several miners are mining blocks concurrently, they can mine on multiple blockchain branches at the same time, integrate all branches as pre-information and perform hash calculations, classify the block hashes, and each miner only appends one blockchain branch at a time; Step 4: Fill the block according to the hash classification obtained in step 3 to generate a new block; Step 5: Broadcast the block; Step 6: The rest of the miners verify the block and update their local databases.

5. The variable difficulty non-redundant parallel blockchain method according to claim 4 is characterized in that: The specific implementation of step 2 includes the following sub-steps: Step 2.1: Process transaction information and construct a sparse Merkle tree S-MerkleTree. The transaction constructs the branches of the S-MerkleTree according to the mapping relationship; Step 2.2: Process the previous information to realize many-to-one parallel mining; use the latest blocks of m chain instances as the previous state and integrate them using the Merkle tree; Step 2.3: Process the confirmation information and merge the collected m Bloom filter groups BFS as confirmation information; Step 2.4: Use the transaction tree root of step 2.1, the previous tree root of step 2.2, the confirmation information hash summary of step 2.3, and a random number to construct a preliminary block header; Step 2.5: Keep changing the random number, perform the workload hash calculation, the block hash meets the target value, and get the real block header.

6. The variable difficulty non-redundant parallel blockchain method according to claim 4 is characterized in that: The generation of a new block as described in step 4 includes the following sub-steps: Step 4.1: Fill in transactions, keep transactions under the i-th branch of S-Merkle and provide membership proof; Step 4.2: Fill in the previous parent, connect the previous block of the chain to the new block according to the chain ID and provide membership proof; Step 4.3: Fill in confirmation information; compress the hash of the new block into a Bloom filter, and append it to the Bloom filter group BFS as key information for the subsequent global serialization confirmation mechanism.

7. The variable difficulty non-redundant parallel blockchain method according to claim 4, characterized in that: The remaining miners described in step 6 verify the block, verify whether the workload hash meets the target value, and recalculate the checksum; verify the membership proof and consistency of the predecessor parent, and verify the consistency of the confirmation information.

8. A non-redundant parallel blockchain method with variable difficulty, applied to the system according to any one of claims 1 to 3; characterized in that: When the parallel blockchain system performs block confirmation and existence verification and serializes into a valid ledger in scenarios that require a global ledger, it uses a global serialization module and a serialization method that matches the parallel chain; The specific implementation includes the following steps: Step 1: Construct a data structure Bloom filter group containing historical state information to provide the existence of the confirmed block relative to the current block; Assume that the current mining cycle is Rn, the security parameter is set to k, the confirmed block is the block of cycle Rn-k, there are block confirmations of Rn cycle, and the blocks to be confirmed are in the range of Rn-k+1 to Rn-1; Step 2: Ensure that the block confirmation process can be executed safely, and append block fields to the data layer of the architecture module to ensure the consistency and non-tamperability of the global confirmation results; Step 3: Serialize the block using the block information and embedded fields.

9. The variable difficulty non-redundant parallel blockchain method according to claim 8, characterized in that: In step 1, backward existence verification and sliding window method are used to confirm the block and verify its existence; The confirmation window is determined based on Rn and k. The blocks on the left edge of the window will be confirmed when the blocks on the right edge are generated. When generating blocks, miners fill their own block information into the Bloom filter group BFS. When confirming blocks, miners collect previous information and merge BFS. When confirming blocks, miners verify the existence of the collected BFS. When their own cycle is Rn, the blocks of the Rn-k cycle are verified for existence in the merged BFS and are considered to be confirmed. When a majority of people globally confirm a block, the block is confirmed. The confirmation window is maintained at a size of k using the sliding window idea. When the size of the BFS of the preceding block is K, the new block needs to remove the Bloom filter at the bottom of the confirmed BFS and then append its own Bloom filter to the top of the BFS when merging the BFS.