Blockchain node consensus method and system based on blockchain sharding

By introducing the FlexMPT tree and optimizing the node design, the delay and complexity issues in the blockchain sharding reconfiguration process are resolved, the throughput and transaction processing rate of the blockchain system are improved, and the real-time and security of the system are ensured.

CN119583037BActive Publication Date: 2025-10-03SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411716434.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-10-03
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

The blockchain sharding reconfiguration process has high latency and complexity problems, which cannot meet user needs. In addition, the traditional method will increase the delay time when the transaction volume increases, affecting system performance.

Method used

An asynchronous reconfiguration method for blockchain sharding based on Merkle compressed prefix tree is adopted. By introducing FlexMPT tree and optimizing node design, the state data synchronization overhead is reduced and the security and efficiency of sharding reconfiguration are improved.

Benefits of technology

It achieves rapid adaptation to changes in network status, reduces data access and processing delays, improves system throughput, ensures the real-time and security of blockchain transactions, and reduces transaction verification and consensus time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119583037B_ABST
    Figure CN119583037B_ABST
Patent Text Reader

Abstract

The present invention discloses a blockchain node consensus method and system based on blockchain sharding. The method includes: referring blockchain nodes added to committee shards as committee nodes, the committee nodes collecting transaction data, performing hash processing on the transaction data, and obtaining hash values; the committee nodes configuring themselves into a committee Merkle tree according to the hash values; the committee Merkle tree is implemented by adopting an improved Merkle compressed prefix tree structure; at the same time, referring blockchain nodes added to global shards as global nodes, the global nodes receiving the root hashes of each committee shard; according to the root hashes, configuring the global nodes into a global Merkle tree; the global Merkle tree is also implemented by adopting an improved Merkle compressed prefix tree structure; performing consensus operations on the committee nodes of the committee shards; and performing consensus operations on the global nodes of the global shards.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain node consensus technology, and in particular to a blockchain node consensus method and system based on blockchain sharding. Background Art

[0002] Blockchain technology, first widely known as the underlying technology for Bitcoin, is a decentralized distributed ledger that uses cryptography to ensure the security and immutability of transaction data. As blockchain applications continue to expand, its applications in various industries, including finance, supply chain, and healthcare, are gradually emerging. Blockchain's core advantage lies in its ability to provide a transparent, secure, and decentralized data sharing environment. However, as the number of nodes in blockchain networks increases and transaction volumes rise, its existing architecture faces challenges in scalability and processing efficiency. Sharding technology has emerged to address blockchain scalability issues. Sharding divides the network into multiple smaller shards, allowing each shard to process transactions and store data in parallel, significantly improving system throughput. Each shard handles transactions for a portion of the network without interfering with each other, while maintaining data consistency across the entire network. While sharding has achieved significant results in improving blockchain performance, it also introduces new challenges. In particular, the reconfiguration of each shard requires the network to maintain full consistency during the shard update process, which inevitably introduces high latency and complexity, failing to meet user needs. Summary of the Invention

[0003] To address the shortcomings of the existing technology, the present invention provides a blockchain node consensus method and system based on blockchain sharding. To improve the security of shard reconfiguration and reduce the overhead of state data synchronization, the present invention provides a blockchain shard asynchronous reconfiguration method based on a Merkle Patricia Trie tree to address this issue. The Merkle Patricia Trie is a data structure used in blockchain technologies such as Ethereum to store state and transaction data, offering excellent search efficiency and update speed. By introducing additional attributes into the MPT tree, the present invention reduces the overhead of state data synchronization and improves the security and efficiency of shard reconfiguration.

[0004] On the one hand, a blockchain node consensus method based on blockchain sharding is provided, including:

[0005] Blockchain nodes choose to join committee shards, global shards, or neither shard based on their own hardware performance characteristics.

[0006] Blockchain nodes added to committee shards are called committee nodes. Committee nodes collect transaction data and hash it to obtain a hash value. Based on the hash value, committee nodes configure themselves into a committee Merkle tree. The committee Merkle tree is implemented using an improved Merkle compressed prefix tree structure. Meanwhile, blockchain nodes added to global shards are called global nodes. Global nodes receive the root hash of each committee shard and, based on the root hash, configure themselves into a global Merkle tree. The global Merkle tree is also implemented using an improved Merkle compressed prefix tree structure.

[0007] For committee sharding, if the critical threshold of a committee node is less than the set threshold, the current committee node is set to an inactive node, the hash value of the inactive node is recorded in its parent node, all nodes under the parent node are deleted, and the parent node's flag is set to zero; for global sharding, if the critical threshold of a global node is less than the set threshold, the current global node is set to an inactive node, and the flag of the inactive node's parent node is set to zero;

[0008] Complete consensus operations on committee nodes of committee shards; complete consensus operations on global nodes of global shards.

[0009] On the other hand, a blockchain node consensus system based on blockchain sharding is provided, including: blockchain nodes;

[0010] Blockchain nodes choose to join committee shards, global shards, or neither shard based on their own hardware performance characteristics.

[0011] Blockchain nodes added to committee shards are called committee nodes. Committee nodes collect transaction data and hash it to obtain a hash value. Based on the hash value, committee nodes configure themselves into a committee Merkle tree. The committee Merkle tree is implemented using an improved Merkle compressed prefix tree structure. Meanwhile, blockchain nodes added to global shards are called global nodes. Global nodes receive the root hash of each committee shard and, based on the root hash, configure themselves into a global Merkle tree. The global Merkle tree is also implemented using an improved Merkle compressed prefix tree structure.

[0012] For committee sharding, if the critical threshold of a committee node is less than the set threshold, the current committee node is set to an inactive node, the hash value of the inactive node is recorded in its parent node, all nodes under the parent node are deleted, and the parent node's flag is set to zero; for global sharding, if the critical threshold of a global node is less than the set threshold, the current global node is set to an inactive node, and the flag of the inactive node's parent node is set to zero;

[0013] Complete consensus operations on committee nodes of committee shards; complete consensus operations on global nodes of global shards.

[0014] The above technical solution has the following advantages or beneficial effects:

[0015] This application introduces the FlexMPT tree, redesigns the extension nodes, branch nodes, and leaf nodes of the FlexMPT tree, and optimizes the data path to make the blockchain sharding reconfiguration process more efficient, quickly adapt to changes in network status, and effectively reduce the delay in data access and processing.

[0016] This application adopts committee sharding and VRF technology to ensure the fair election of global shards of the blockchain, reduce potential security risks, and quickly reconfigure shards, further shortening the transaction waiting time of the blockchain; at the same time, combined with the shard asynchronous reconfiguration mechanism proposed in the implementation method of this application, it can further reduce the time required for transaction verification and consensus, and improve the real-time and security of the system.

[0017] This application designs and optimizes a compressed state tree, effectively reducing the transmission volume and storage requirements of blockchain data and further improving the processing rate of blockchain transactions.

[0018] More significantly, as the number of blockchain transactions increases, the delays in consensus and reconfiguration required by traditional methods continue to grow, causing significant system latency. However, in this application, the delays in consensus and shard reconfiguration remain nearly constant as the number of blockchain transactions increases, effectively improving system throughput and demonstrating excellent compatibility with demand. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0020] Figure 1 This is a global sharded FlexMPT data structure design method according to the first embodiment of the present invention;

[0021] Figure 2 This is a committee-sharded FlexMPT data structure design method according to the first embodiment of the present invention. DETAILED DESCRIPTION

[0022] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.

[0023] Example 1

[0024] This embodiment provides a blockchain node consensus method based on blockchain sharding;

[0025] The blockchain node consensus method based on blockchain sharding includes:

[0026] S101: Blockchain nodes choose to join committee shards, global shards, or neither shard based on their own hardware performance characteristics.

[0027] S102: The blockchain nodes added to the committee shard are called committee nodes. The committee nodes collect transaction data and hash the transaction data to obtain a hash value. The committee nodes configure themselves into the committee Merkle tree based on the hash value. The committee Merkle tree is implemented using an improved Merkle compressed prefix tree structure.

[0028] At the same time, the blockchain nodes added to the global shard are called global nodes. Global nodes receive the root hash of each committee shard. Based on the root hash, global nodes are configured into the global Merkle tree. The global Merkle tree is also implemented using an improved Merkle compressed prefix tree structure.

[0029] S103: For committee shards, if the critical threshold of the committee node is less than the set threshold, the current committee node is set to an inactive node, the hash value of the inactive node is recorded in its parent node, and all nodes under the parent node are deleted, and the flag bit of the parent node is set to zero;

[0030] For global sharding, if the key threshold of the global node is less than the set threshold, the current global node is set to an inactive node, and the flag bit of the parent node of the inactive node is set to zero;

[0031] S104: Complete the consensus operation on the committee nodes of the committee shards; complete the consensus operation on the global nodes of the global shards.

[0032] Furthermore, the blockchain node chooses to join the committee shard, the global shard, or not to join any shard based on its own hardware performance characteristics, which also includes:

[0033] S100: Constructing a blockchain; the blockchain includes a global shard and several committee shards; the global shard includes: several global nodes; each committee shard includes: several committee nodes.

[0034] The global shard is responsible for maintaining the overall state of the blockchain. Global nodes within the global shard perform cross-shard data validation and transaction coordination, ensuring data consistency across shards. Global shards utilize an improved Merkle-compressed prefix tree structure to improve data access efficiency and optimize storage space utilization. Furthermore, the global shard is responsible for generating and verifying network-wide consensus decisions, serving as the hub for information exchange and decision-making within the blockchain network. The root hash of the global Merkle tree provides a comprehensive view of the network-wide data state, enabling global nodes to efficiently verify data consistency across shards.

[0035] The committee shard processes transactions and generates blocks within the sharded blockchain. The committee shard maintains the current state of active accounts within the shard, as well as historical data on verified blocks. This historical data is used to verify transactions in newly proposed blocks and facilitate user queries for past block information. Any node with computing power can join the network through the Proof-of-Stake (PoS) mechanism.

[0036] The global node is used to maintain the overall state of the blockchain network and ensure the consistency and integrity of data within the network. The global node optimizes data processing and storage through an improved Merkle compressed prefix tree structure, improving access efficiency and security.

[0037] The committee nodes are used to process specific tasks and generate blocks. The committee nodes enable them to efficiently manage local data and transactions without impacting global node performance, thereby accelerating the processing speed and response time of the entire network.

[0038] The global node and committee node are both implemented through blockchain nodes.

[0039] Furthermore, the S101: blockchain nodes choose to join committee shards, global shards, or neither shard based on their own hardware performance characteristics, including:

[0040] If the processing speed of a blockchain node is higher than the set threshold, the current blockchain node is allowed to choose to join the committee shard;

[0041] If the storage capacity of a blockchain node is greater than the set threshold, the current blockchain node is allowed to choose to join the global shard;

[0042] If the processing speed of a blockchain node is higher than the set threshold and the storage capacity is greater than the set threshold, the current blockchain node is allowed to choose to join both the committee shard and the global shard.

[0043] Furthermore, the S102: improved Merkel compressed prefix tree structure includes: an extension node, a branch node and a leaf node connected in sequence; the extension node connects one or more branch nodes, and the branch node connects one or more leaf nodes; the attributes of the extension node include: a common prefix, a pointer, a flag bit and a key threshold; the attributes of the branch node include: a branch, a flag bit and a key threshold; the attributes of the leaf node include: the end part of the account balance information path, the data value and the key threshold.

[0044] The shared prefix refers to an address prefix shared by all child nodes in an extended node, and is a sequence consisting of a series of address bits.

[0045] The shared prefix is ​​used to simplify and accelerate data access paths within the blockchain network. By pre-parsing the shared prefix, the system can quickly direct data to the correct child node, reducing processing time and improving efficiency.

[0046] The pointer refers to a reference pointing to the next node of the current node. The next node may be an extension node, a branch node or a leaf node.

[0047] The pointer is used to navigate in the tree structure so that the data structure can be accessed continuously and sequentially, thereby supporting complex query and update operations.

[0048] The flag bit refers to a binary mark used to indicate a specific state of a node in a tree structure.

[0049] The flag bit is used to indicate the accessibility or validity of a node. In extension nodes and branch nodes, the flag bit can be used to indicate whether the node participates in a certain operation. For example, if the flag bit is set to 1, it may indicate that the node is active and accessible; if it is set to 0, it means that the node and its downstream nodes are abandoned.

[0050] The critical threshold is a numerical value used to indicate the activity of a node or its importance in the tree.

[0051] The key threshold is used to distinguish the active state of the node. Specifically, when the key threshold is greater than 10, the node is considered "active", which means that the node is frequently accessed or operated and should be processed. On the contrary, when the key threshold is less than or equal to 10, the node is considered "inactive", indicating that the node is accessed and updated less frequently, and their hash values ​​are recorded in the parent node, and the entire subtree under the parent node is deleted. The flag field of the parent node corresponding to these inactive nodes is then set to 0.

[0052] The branches refer to multiple linked child nodes, which can be extension nodes or leaf nodes.

[0053] The branches are used to manage the diversity of data paths, allowing the tree structure to expand in a nonlinear manner, thereby enhancing the flexibility and indexing capability of the data structure.

[0054] The end portion of the account balance information path refers to the final portion in the leaf node that points to the specific account balance after the path navigation is completed.

[0055] The end portion of the account balance information path is used to accurately point to and access the specific balance information of the blockchain account, supporting accurate account management and transaction verification.

[0056] The data value refers to the actual information stored in the leaf node, such as the balance of an account.

[0057] The data value is used to store and provide specific information about blockchain accounts, such as balances, to support transaction processing and account status updates.

[0058] Furthermore, the S102: committee node configures itself into the committee Merkle tree according to the hash value, including:

[0059] Assume the hash value is a seven-digit number ABCDEFG;

[0060] First, based on the first two digits AB of the hash value, confirm the extension node to which the current committee node belongs in the committee Merkle tree;

[0061] Then, based on the third digit C of the hash value, confirm the branch node to which the current committee node belongs in the committee Merkle tree;

[0062] Then, based on the last four digits of the hash value, DEFG, the leaf node to which the current committee node belongs in the committee Merkle tree is confirmed.

[0063] S102: Blockchain nodes added to the committee shard collect transaction data for specific functions (such as specific types of smart contract executions or small-scale fast payment transactions). Each transaction is hashed to construct a Merkle tree, which is then stored as a leaf node in the Merkle tree. After the committee Merkle tree is generated, the root hash of the committee Merkle tree is calculated using the SHA-256 hash function. The root hash of the committee Merkle tree is sent to the global shard for subsequent data integration and global verification.

[0064] S102: The global node receives the root hash from each committee shard and constructs a global Merkle tree. The root hash of the global Merkle tree provides a comprehensive view of the data state across the network, allowing the global node to effectively verify data consistency across shards.

[0065] Furthermore, the step of configuring the global node into the global Merkle tree based on the root hash is consistent with the step of configuring the committee node itself into the committee Merkle tree based on the hash value.

[0066] Furthermore, in S103, nodes arriving at a new shard face the challenge of synchronizing a large amount of state data within the shard. When nodes switch between shards, they must download all relevant state data from the new shard, resulting in significant data synchronization overhead. To address this issue, removing inactive nodes can reduce the amount of state data that needs to be maintained and synchronized, thereby reducing the amount of data that new nodes must process for synchronization. This reduces network bandwidth usage and storage requirements, improves overall network responsiveness and transaction processing rates, and enhances system stability and availability.

[0067] Inactive nodes refer to nodes whose activity (such as access frequency and transaction participation) is below a preset threshold in a blockchain system. These nodes have not made significant contributions or participated in the activities of the blockchain network for a certain period of time and are therefore considered inactive.

[0068] For global sharding, if the key threshold of the global node is less than the second set threshold, the current global node is set to an inactive node, and the flag bit of the parent node of the inactive node is set to zero;

[0069] Furthermore, S104: completing the consensus operation on the committee nodes of the committee shards; completing the consensus operation on the global nodes of the global shards, wherein the specific process of completing the consensus operation on the committee nodes of the committee shards is consistent with that of completing the consensus operation on the global nodes of the global shards, and completing the consensus operation on the committee nodes of the committee shards includes:

[0070] S104-1: Generate reconfiguration plan: The committee shard uses a verifiable random function (VRF) to randomize all nodes in the network to ensure fairness and randomness of node allocation;

[0071] Randomized shuffling is a method used during sharding to randomly assign nodes to committees, typically to ensure fairness and security of the network.

[0072] After the shuffle is complete, the committee shards build consensus on the new reconfiguration plan formed for each epoch (epoch k), ensuring that all nodes in the network unanimously agree on the reconfiguration plan and preparing for the next phase. The new reconfiguration plan reallocates nodes to appropriate shards based on their performance. This helps optimize the overall performance and resource utilization of the network. A reconfiguration plan typically refers to a series of adjustments made at the end of each epoch (the period from one set of blocks to the next) to adjust or optimize network resources and node distribution. This plan is formed after the shuffle process is complete, ensuring that node reallocation in the new epoch is based on the latest network status and needs.

[0073] S104-2: Broadcast reconfiguration plan: After preliminary consensus confirmation, the new reconfiguration plan is broadcast to the entire blockchain network;

[0074] This broadcast mechanism ensures that all participating nodes update the reconfiguration information synchronously so that they can unify the network state and start their respective reconfiguration phases;

[0075] After the broadcast reaches consensus, each committee shard officially enters the reconfiguration phase and begins adjusting and optimizing its internal state to respond to the new network configuration requirements;

[0076] S104-3: Compressed state tree: The committee nodes in each committee shard will traverse the account state tree it currently maintains, remove inactive or redundant nodes, obtain the FlexMPT tree, and mark the FlexMPT tree as This process not only reduces the storage burden but also optimizes data access and query efficiency. The inactive or redundant nodes are nodes with a count less than or equal to 10.

[0077] S104-4: Transmit State Trie: The updated state trie (i.e., FlexMPT) is sent by the committee node to the committee node of the corresponding committee shard in the next cycle to ensure the continuity and consistency of information and provide support for on-chain transactions and verification.

[0078] S104-5: Merge State Tree: After receiving the updated FlexMPT, the committee node merges it with the FlexMPT from the previous cycle to form the latest FlexMPT. This merging process is based on the characteristics of the FlexMPT tree structure and aims to optimize data storage and access speed.

[0079] When there is a new account status change, the status change is integrated into the existing FlexMPT to ensure that the status of each account is up to date and unique, by adding new leaf nodes or updating the values ​​of existing leaf nodes.

[0080] When the new FlexMPT contains nodes that are duplicated with the existing tree, the duplicate nodes are removed and only the latest state is retained to optimize storage space and improve data access efficiency.

[0081] When new transaction data affects the structure of multiple nodes, necessary path adjustments and node hash recalculations are performed to maintain the structural integrity and data consistency of the state tree.

[0082] After all nodes are updated and confirmed, the state tree is optimized and compressed, and unnecessary branches and nodes are deleted, thereby reducing the storage burden and improving query efficiency.

[0083] S104-6: Status Consensus: After the update is completed, the committee shards reach consensus on the root hash of the FlexMPT of all shards, thereby confirming the account status across the entire network.

[0084] In addition, all global nodes have reached consensus on their FlexMPTs, marking the successful completion of the reconfiguration phase for that shard. After that, the shard enters the consensus phase of the next cycle and begins a new block generation process.

[0085] The committee shard is a crucial component of the blockchain infrastructure and is comprised of committee nodes. Committee nodes maintain the integrity of the blockchain network by maintaining account state data across the entire ledger. By preserving account state, these committee nodes help validators verify transactions (TXs) within blocks.

[0086] Furthermore, the committee nodes are peer nodes, which are elected within the shard.

[0087] Furthermore, the Verifiable Random Function (VRF) is a key cryptographic tool that combines randomness generation and result verification. During the committee sharding and consensus phases, VRF is used to randomly select validators, ensuring that the validator election process is fair and difficult to manipulate. This randomness reduces the potential impact of malicious attackers on the network.

[0088] Furthermore, the global shard is responsible for processing transactions and generating blocks within the sharded blockchain. A global shard maintains the current state of active accounts within its assigned shard, as well as historical data on the blocks they have verified. This historical data is used to verify transactions in newly proposed blocks and facilitate user queries for past block information.

[0089] An improved Merkle Patricia Trie tree structure. The improved Merkle Patricia Trie tree is called a Flexible Merkle Patricia Trie (FlexMPT tree).

[0090] The FlexMPT tree includes three types of nodes: extension nodes, branch nodes, and leaf nodes:

[0091] (1) Extension nodes are used to simplify path access. They contain a shared prefix, shardnibbles, a pointer to another node, a flag indicating a specific state, and a critical threshold, count, to distinguish whether a node is active. Extension nodes do not store data; their primary function is to reduce the number of nodes that need to be visited during a search, thereby improving access efficiency. The data structure of an extension node is represented as follows, where || represents a join operation.

[0092] N e ={shardnibbles||next||flag||count}

[0093] (2) Branch nodes can directly point to multiple different child nodes. Each branch node includes a Branches attribute that links to other nodes, a flag attribute that indicates a specific state, and a count attribute that is a critical threshold for distinguishing whether the node is active. Branch nodes manage the bifurcation points of data paths, allowing the tree structure to expand and index data in a nonlinear manner, enhancing the efficiency and functionality of the entire data structure. The data structure of a branch node is represented as follows, where || represents a join operation.

[0094] N b ={Branches||flags||count}

[0095] (3) Leaf nodes are used to store specific values ​​and mark the end of a path. The key-end attribute represents the remaining portion of a blockchain account after reaching a leaf node, the value attribute represents the balance of the blockchain account, and the count attribute represents the frequency of node access. The data structure of a leaf node is shown below, which is directly related to data storage and query efficiency, where ‖‖ represents a join operation.

[0096] N l ={key-end||value||count}

[0097] Committee Node: A group of committee nodes forms a committee shard. Committee nodes are responsible for processing transactions and generating new blocks on their shard's blockchain. Furthermore, these nodes manage the current state of active accounts within their shard and their associated historical block records. This historical data is used to verify transactions in new blocks and provides users with convenient access to past block information. To ensure scalability and inclusiveness, any node with the necessary computing resources can join the network using a Proof of Stake (PoS) mechanism.

[0098] Global nodes: Global nodes are key components of blockchain networks, forming the global shards. They maintain account state data across the entire ledger and are crucial to maintaining the integrity of the blockchain network. By preserving this account state, global nodes not only support validators in verifying the authenticity of transactions within blocks, but also enable the generation of reconstruction schemes using Verifiable Random Functions (VRFs), further enhancing the security and stability of the network.

[0099] It's important to note that global shards are not a centralized component of the blockchain network. They can be composed of any node in the network with significant data storage capacity, ensuring the network's distributed nature and universal data accessibility. Blockchain nodes can choose to join committee shards, global shards, or both, based on their computing or storage capabilities.

[0100] To further understand sharding reconfiguration, we introduce the data structure of FlexMPT, which maintains the account status in the global shard and committee shards. It is redesigned from MPT to adapt to the needs of the sharding reconfiguration process.

[0101] Since committee nodes only maintain the state of certain accounts within their respective committee shards for transaction validation, while the global shard keeps the complete account state of the network, we use different methods for processing the received FlexMPT data structure for the global shard and committee shards.

[0102] For committee sharding, Figure 1 As shown, FlexMPT only includes accounts that initiated transactions within the current epoch. For nodes with a count value less than 10 in FlexMPT, the node subtree starting from such a node is considered inactive. To manage these inactive nodes, their hash values ​​are recorded in the parent node, and the entire subtree under the parent node is deleted. The flag field of the parent node corresponding to these inactive nodes is then set to 0. When a global shard accesses FlexMPT during the consensus phase and encounters a node that stores the hash value of the next node but has its flag set to 0, it cannot access nodes under that branch or directly insert data.

[0103] For global nodes, such as Figure 2 As shown, FlexMPT needs to save the latest status of all accounts. For nodes with a count value less than 10 in FlexMPT, the node and its corresponding branch are still retained for further verification. However, to maintain consistency with the global sharding, the flag field of the parent node corresponding to these inactive nodes is also set to 0.

[0104] Example 2

[0105] This embodiment provides a blockchain node consensus system based on blockchain sharding, including: a blockchain node;

[0106] Blockchain nodes choose to join committee shards, global shards, or neither shard based on their own hardware performance characteristics.

[0107] Blockchain nodes added to committee shards are called committee nodes. Committee nodes collect transaction data and hash it to obtain a hash value. Based on the hash value, committee nodes configure themselves into a committee Merkle tree. The committee Merkle tree is implemented using an improved Merkle compressed prefix tree structure. Meanwhile, blockchain nodes added to global shards are called global nodes. Global nodes receive the root hash of each committee shard and, based on the root hash, configure themselves into a global Merkle tree. The global Merkle tree is also implemented using an improved Merkle compressed prefix tree structure.

[0108] For committee sharding, if the critical threshold of a committee node is less than the set threshold, the current committee node is set to an inactive node, the hash value of the inactive node is recorded in its parent node, all nodes under the parent node are deleted, and the parent node's flag is set to zero; for global sharding, if the critical threshold of a global node is less than the set threshold, the current global node is set to an inactive node, and the flag of the inactive node's parent node is set to zero;

[0109] Complete consensus operations on committee nodes of committee shards; complete consensus operations on global nodes of global shards.

[0110] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. The blockchain node consensus method based on blockchain sharding is characterized by: include: Blockchain nodes choose to join committee shards, global shards, or neither shard based on their own hardware performance characteristics. The blockchain nodes that join the committee shard are called committee nodes. Committee nodes collect transaction data, hash the transaction data, and obtain hash values. The committee node configures itself into the committee Merkle tree based on the hash value; The committee Merkle tree is implemented using an improved Merkle compressed prefix tree structure. Blockchain nodes added to the global shard are called global nodes. Global nodes receive the root hash of each committee shard and are configured into the global Merkle tree based on the root hash. The global Merkle tree is also implemented using an improved Merkle compressed prefix tree structure; For committee sharding, if the critical threshold of a committee node is less than the set threshold, the current committee node is set to an inactive node, the hash value of the inactive node is recorded in its parent node, and all nodes under the parent node are deleted, and the flag bit of the parent node is set to zero; For global sharding, if the key threshold of the global node is less than the set threshold, the current global node is set to an inactive node, and the flag bit of the parent node of the inactive node is set to zero; Complete consensus operations on the committee nodes of the committee shards; Complete consensus operations on global nodes of global shards.

2. The blockchain node consensus method based on blockchain sharding as claimed in claim 1 is characterized in that: The blockchain node chooses to join the committee shard, the global shard, or neither shard based on its own hardware performance characteristics, and previously also includes: Constructing a blockchain; the blockchain includes a global shard and several committee shards; the global shard includes: several global nodes; each committee shard includes: several committee nodes; the global shard is responsible for maintaining the overall state of the blockchain; the committee shards are used to process transactions and generate blocks in the sharded blockchain.

3. The blockchain node consensus method based on blockchain sharding as claimed in claim 1 is characterized in that: Blockchain nodes choose to join committee shards, global shards, or neither shard based on their own hardware performance characteristics, including: If the processing speed of a blockchain node is higher than the set threshold, the current blockchain node is allowed to choose to join the committee shard; If the storage capacity of a blockchain node is greater than the set threshold, the current blockchain node is allowed to choose to join the global shard; If the processing speed of a blockchain node is higher than the set threshold and the storage capacity is greater than the set threshold, the current blockchain node is allowed to choose to join both the committee shard and the global shard.

4. The blockchain node consensus method based on blockchain sharding as claimed in claim 1 is characterized in that: An improved Merkle compressed prefix tree structure includes: an extension node, a branch node, and a leaf node connected in sequence; the extension node connects one or more branch nodes, and the branch node connects one or more leaf nodes; the attributes of the extension node include: a common prefix, a pointer, a flag bit, and a critical threshold; the attributes of the branch node include: a branch, a flag bit, and a critical threshold; the attributes of the leaf node include: the end portion of the account balance information path, a data value, and a critical threshold.

5. The blockchain node consensus method based on blockchain sharding as claimed in claim 4 is characterized in that: The shared prefix refers to the address prefix shared by all child nodes in an extended node, which is a sequence consisting of a series of address bits; The pointer is a reference pointing to the next node of the current node, which may be an extension node, a branch node or a leaf node; The flag bit refers to a binary mark used to indicate the state of the node in the tree structure; The critical threshold is a numerical value used to indicate the activity of a node or its importance in the tree.

6. The blockchain node consensus method based on blockchain sharding as claimed in claim 1 is characterized in that: The committee node configures itself into the committee Merkle tree based on the hash value, including: Assume the hash value is a seven-digit number ABCDEFG; First, based on the first two digits AB of the hash value, confirm the extension node to which the current committee node belongs in the committee Merkle tree; Then, based on the third digit C of the hash value, confirm the branch node to which the current committee node belongs in the committee Merkle tree; Then, based on the last four digits of the hash value, DEFG, the leaf node to which the current committee node belongs in the committee Merkle tree is confirmed.

7. The blockchain node consensus method based on blockchain sharding as claimed in claim 1 is characterized in that: The consensus operation of the committee nodes of the committee shards is completed, including: Generate reconfiguration plan: The committee shard uses a verifiable random function to randomly shuffle all nodes in the network to ensure the fairness and randomness of node allocation; Broadcast reconfiguration plan: After preliminary consensus confirmation, the new reconfiguration plan is broadcast to the entire blockchain network; Compressed state tree: The committee nodes in each committee shard will traverse the account state tree they currently maintain, remove inactive or redundant nodes, and obtain an improved Merkel compressed prefix tree structure FlexMPT tree, marking the FlexMPT tree as Transmit state tree: The updated FlexMPT tree is sent by the committee node to the committee node of the corresponding committee shard in the next cycle; Merge state tree: After receiving the updated FlexMPT, the committee node merges it with the FlexMPT of the previous cycle to form the latest FlexMPT; Status consensus: After the update is completed, the committee shards reach consensus on the root hash of FlexMPT of all shards, thereby confirming the account status across the entire network.

8. The blockchain node consensus method based on blockchain sharding as claimed in claim 7, Its characteristic is that the state tree is merged: after receiving the updated FlexMPT, the committee node merges it with the FlexMPT of the previous cycle to form the latest FlexMPT, including: When there is a new account status change, the status change is integrated into the existing FlexMPT to ensure that the status of each account is up-to-date and unique, by adding a new leaf node or updating the value of an existing leaf node; When the new FlexMPT contains nodes that are duplicated with the existing tree, the duplicate nodes are removed and only the latest state is retained; When new transaction data affects the structure of multiple nodes, necessary path adjustments and node hash recalculations are performed; After all nodes are updated and confirmed, the state tree is optimized and compressed, and unnecessary branches and nodes are deleted.

9. The blockchain node consensus method based on blockchain sharding as claimed in claim 7, characterized in that: The FlexMPT tree includes three types of nodes: extension nodes, branch nodes, and leaf nodes: Extension nodes are used to simplify path access. They contain a common prefix shard nibbles, a pointer next to other nodes, a flag indicating a specific state, and a key threshold count to distinguish whether the node is active. Extension nodes do not store data. Their function is to reduce the number of nodes that need to be visited during the search process. The data structure of an extension node is shown below, where ‖‖ represents a connection operation. N e ={shard nibbles||next||flag||count} A branch node directly points to multiple different child nodes. Each branch node includes a Branches attribute that links to other nodes, a flag attribute that indicates a specific state, and a count attribute that is a key threshold for distinguishing whether the node is active. Branch nodes manage the bifurcation points of data paths, allowing the tree structure to expand and index data in a nonlinear manner. The data structure of a branch node is represented as follows, where ‖‖ represents a join operation. N b ={Branches||flags||Count} (3) Leaf nodes are used to store specific values ​​and mark the end of a path. The key-end attribute represents the remaining portion of the blockchain account after reaching the leaf node, the value attribute represents the balance of the blockchain account, and the count attribute represents the frequency of node access. The data structure of the leaf node is shown below, which is directly related to the storage and query efficiency of the data, where || represents the connection operation. N l ={key-end||value||count}。 10. The blockchain node consensus system based on blockchain sharding is characterized by: include: Blockchain nodes; Blockchain nodes choose to join committee shards, global shards, or neither shard based on their own hardware performance characteristics. The blockchain nodes that join the committee shard are called committee nodes. Committee nodes collect transaction data, hash the transaction data, and obtain hash values. The committee node configures itself into the committee Merkle tree based on the hash value; The committee Merkle tree is implemented using an improved Merkle compressed prefix tree structure. Blockchain nodes added to the global shard are called global nodes. Global nodes receive the root hash of each committee shard and are configured into the global Merkle tree based on the root hash. The global Merkle tree is also implemented using an improved Merkle compressed prefix tree structure; For committee sharding, if the critical threshold of a committee node is less than the set threshold, the current committee node is set to an inactive node, the hash value of the inactive node is recorded in its parent node, and all nodes under the parent node are deleted, and the flag bit of the parent node is set to zero; For global sharding, if the key threshold of the global node is less than the set threshold, the current global node is set to an inactive node, and the flag bit of the parent node of the inactive node is set to zero; Complete consensus operations on the committee nodes of the committee shards; Complete consensus operations on global nodes of global shards.

Citation Information

Patent Citations

  • Block chain consensus method

    CN114511319A

  • Block chain fragmentation method, block chain system and cross-fragmentation transaction processing method

    CN116582239A