System of Optimitic Rollup architecture based on MMR and parallel computing
By adopting the Optimistic Rollup architecture of MMR and parallel computing in the Rollup solution, the balance between decentralization and performance is solved, and a high-performance and decentralized Rollup solution is realized, avoiding the risk of single point of failure.
Patent Information
- Application Number
- CN202510299127.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-06-20
AI Technical Summary
The existing Rollup solution is difficult to balance between decentralization and performance. Although the centralized Sequencer solution improves TPS, it has a single point of failure risk, while the decentralized solution has slow transaction processing speed and is difficult to meet the needs of large-scale users.
The Optimistic Rollup architecture based on MMR and parallel computing is adopted. By selecting multiple shards for parallel calculations when blocking, the number of tasks for each calculator is reduced, and the MMR data structure and on-chain random numbers are introduced to improve the TPS of decentralized Rollup.
It realizes the high performance of decentralized Rollup, supports the transaction needs of large-scale users, and avoids the single point of failure risk of centralized Sequencer, ensuring the decentralization and security of the system.
Smart Images

Figure CN120180495A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular, to a system based on the Optimistic Rollup architecture of MMR and parallel computing. Background Art
[0002] In the prior art, traditional Rollup solutions usually improve TPS by using a centralized sequencer. Especially for the solutions based on a centralized sequencer, although TPS can be improved, this method sacrifices the decentralized feature and brings a single point of failure risk. Decentralized and permissionless Rollup solutions often cannot provide sufficient performance. Due to the lack of an efficient consensus mechanism, the transaction processing speed is slow, making it difficult to meet the needs of a large number of users, and thus unable to effectively solve the trade-off problem between decentralization and performance in existing Rollup solutions. Summary of the Invention
[0003] An object of this application is to provide a system based on the Optimistic Rollup architecture of MMR and parallel computing. By additionally selecting multiple shards during block production to parallelly process all computing tasks, the number of tasks that each calculator needs to process is reduced to speed up, and at the same time, the MMR data structure is introduced to improve the TPS of decentralized Rollup, thereby better balancing the requirements of decentralization and high performance.
[0004] According to one aspect of this application, there is provided a system based on the Optimistic Rollup architecture of MMR and parallel computing, wherein the system includes:
[0005] Each shard chain in the blockchain holds complete state data and does not perform state sharding, and each shard chain independently performs block production consensus and executes computing tasks;
[0006] All shards in the block hold the full-chain data. When a shard produces a block, it broadcasts a shard proposal. When the consensus chain produces a block, it includes all shard proposals;
[0007] Each transaction in the blockchain is assigned to a shard in the blockchain for calculation according to the sender identifier of the transaction;
[0008] Before parallelly calculating the shard proposal, each shard performs verifiable sorting on all the transactions assigned to it through an on-chain random number and executes them in order;
[0009] Aggregate the shard proposals of all shards calculated in parallel into the MMR and submit them to the main chain. Each new consensus block creates a new leaf node on the rightmost side of the MMR tree to ensure only one hash calculation.
[0010] Further, in the above system, before parallel computing the shard proposals, all the transactions assigned to each shard are verifiably sorted by the on-chain random number, and the sequential execution includes:
[0011] Before parallel computing the shard proposals, each shard groups all the transactions assigned to it by the on-chain random number, and uses the Fisher-Yates algorithm to verifiably sort the transactions in each group, and executes them in sequence.
[0012] Further, in the above system, before parallel computing the shard proposals, each shard groups all the transactions assigned to it by the on-chain random number, and uses the Fisher-Yates algorithm to verifiably sort the transactions in each group, and executes them in sequence, including:
[0013] Perform the following steps on the transactions in each shard:
[0014] Deduplicate all the assigned transactions;
[0015] Group the deduplicated transactions to obtain at least one group and the transactions in each group;
[0016] Use the on-chain random number on the main chain to generate a random seed for transaction sorting;
[0017] Adopt the Fisher-Yates algorithm, and each time select a group from the at least one group according to the generated random seed, and output all the elements in the selected group until all the groups are output, so as to complete the sorting of all the assigned transactions;
[0018] Execute all the transactions in sequence.
[0019] Further, in the above system, the grouping of the deduplicated transactions to obtain at least one group and the transactions in each group includes:
[0020] Group the deduplicated transactions according to the sender identifier of the transaction, and group the transactions without the signature of the sender identifier separately to obtain at least one group and the transactions in each group.
[0021] Further, in the above system, the system further includes:
[0022] After each consensus block is generated, the system enters a challenge period;
[0023] If there is a malicious shard node, other shard nodes in the blockchain submit a FraudProof for challenge.
[0024] Further, in the above system, the system includes:
[0025] If the Fraud Proof is accepted, the consensus node removes the Rollup data and rolls back the state data corresponding to the affected shard nodes;
[0026] Among them, the misbehaving shard nodes will be punished and the pledged tokens will be forfeited.
[0027] Compared with the prior art, a system based on the Optimistic Rollup architecture of MMR and parallel computing provided by the present application, wherein the system includes: each shard chain in the blockchain holds complete state data and does not perform state sharding, and each shard chain independently performs block generation consensus and execution of computing tasks; all shards in the block hold the full-chain data, and when a shard generates a block, it broadcasts a shard proposal, wherein when the consensus chain generates a block, it includes all shard proposals; each transaction in the blockchain is allocated to a shard in the blockchain for calculation according to the sender identifier of the transaction; before parallel computing of the shard proposals, each shard performs verifiable sorting on all the transactions allocated to it through an on-chain random number and executes them in order; aggregates the shard proposals of all shards in parallel computing into the MMR and submits them to the main chain, and each new consensus block creates a new leaf node on the rightmost side of the MMR tree to ensure only one hash calculation. The present application speeds up by reducing the number of tasks that each calculator needs to process through additional selection of multiple calculators to perform parallel processing on all computing tasks during block generation, and at the same time introduces the MMR data structure and on-chain random number to improve the TPS of the decentralized Rollup, so as to better balance the requirements of decentralization and high performance.
[0028] In the present application, the TPS of the decentralized Rollup is improved by introducing the MMR data structure and the technology of computing shards. Specifically, verifiable sorting is performed through an on-chain random number and the shard calculation does not shard the state to achieve parallel computing, thereby ensuring decentralization and fairness. While effectively improving the performance, the system ensures the decentralization and security of the system. The specific technical effects include the following items:
[0029] Through the parallel computing of shards and the MMR data structure, the transaction processing capacity is greatly improved, supporting the transaction needs of a large number of users, thereby improving the TPS of the decentralized Rollup;
[0030] Through the decentralized consensus mechanism, the single-point failure risk brought by the centralized Sequencer is avoided, thereby achieving decentralization.
[0031] Using the hash path verification mechanism of MMR, the storage and computing burdens are reduced, and the data verification efficiency is improved, thereby achieving the purpose of efficient verification;
[0032] Through the on-chain random number and the Fraud Proof mechanism, the security and anti-malicious behavior ability of the system are ensured, thus enhancing the system security. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Other features, objects, and advantages of the present application will become more apparent by reading the detailed description of the non-limiting embodiments with reference to the following drawings:
[0034] Figure 1 A schematic diagram showing the implementation step process of a system with an Optimistic Rollup architecture based on MMR and parallel computing according to an aspect of the present application;
[0035] Figure 2 A schematic diagram showing the formation of a Merkle Tree in the prior art;
[0036] Figure 3 A schematic diagram showing a binary tree constructed in a symmetric manner when the number of leaf digits of the MMR in a system with an Optimistic Rollup architecture based on MMR and parallel computing according to an aspect of the present application is 14;
[0037] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0038] The present application will be further described in detail below with reference to the drawings.
[0039] In a typical configuration of the present application, the terminal, the devices of the service network, and the trusted party each include one or more processors (CPUs), an input / output interface, a network interface, and a memory.
[0040] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM), and / or non-volatile memory in the form of, for example, read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
[0041] A computer-readable medium includes permanent and non-permanent, removable and non-removable media that can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassette tapes, magnetic disk storage, or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media do not include transitory media such as modulated data signals and carrier waves.
[0042] In this application, it aims to solve the trade-off problem between centralization and performance in the Rollup solution. Rollup is a technical solution for expanding blockchains. By removing transaction data from the main chain, it reduces the burden on the main chain to improve performance. In a system of an Optimistic Rollup architecture based on MMR and parallel computing proposed in one aspect of this application, it combines computational sharding (i.e., parallel computing) and the MMR (Merkle Mountain Ranges) data structure, and uses an on-chain random number to sort transactions, thereby improving the TPS of decentralized Rollup.
[0043] The specific implementation steps are as Figure 1 shown. This system includes steps S11, S12, S13, S14, and S15. Specifically, the implementation is as follows:
[0044] Step S11, each shard chain in the blockchain holds complete state data and does not perform state sharding. Each shard chain independently conducts block production consensus and executes computing tasks. Here, each shard chain in the blockchain does not perform state sharding, each holds complete state data, but will independently conduct operations such as block production consensus and execute computing tasks.
[0045] Step S12, all shards in the block hold full-chain data. When a shard produces a block, it broadcasts a shard proposal. Among them, when the consensus chain produces a block, it includes all shard proposals. That is, all shards hold full-chain data. When a shard produces a block, it broadcasts a shard proposal ShardVoting. When the consensus chain ProposerChain produces a block, it will include all shard proposals.
[0046] Here, in the embodiments of the present application, there is no division into subnets to partition different shards. Instead, when generating a block, at least two calculators are additionally selected to perform parallel processing on all the computing tasks in this block, and the speed is increased by reducing the number of tasks that each calculator needs to process. Therefore, in the embodiments of the present application, it is actually computing sharding rather than network sharding, thereby achieving parallel computing of tasks.
[0047] Step S13: Each transaction in the blockchain is assigned to a shard Shard in the blockchain for calculation according to the sender identifier account_id of the transaction;
[0048] Step S14: Before performing parallel computing shard proposals, each shard will perform verifiable sorting on all the transactions assigned to it through an on-chain random number and execute them in order;
[0049] Step S15: Aggregate the shard proposals ShardVoting of all shards Shard in parallel computing into the MMR and submit them to the main chain. Each new consensus Proposer block creates a new leaf node on the far right of the MMR tree to ensure only one hash calculation.
[0050] The embodiments of the present application can implement the MMR data structure, shard processing, transaction sorting, and on-chain random number generation through smart contract programming languages (such as Solidity, etc.) and blockchain technology. In addition, efficient distributed computing resources are used to support the shard processing and verification processes; in terms of hardware, it is recommended to use high-performance GPUs and distributed storage to accelerate data processing and verification to ensure the efficiency of the system.
[0051] It should be noted that MMR (Merkle Mountain Ranges) is a data structure based on the Merkle tree. It can efficiently verify the integrity of data through a hash path. Different from the traditional Merkle tree, MMR supports dynamic expansion by gradually inserting new nodes, especially suitable for data added step by step in chronological order. In the embodiments of the present application, the advantage of the sequential insertion performance of MMR is utilized. Because in the embodiments of the present application, the computing speed is increased by the parallel computing method of multiple calculators, the modification of the MPT that was originally rolled up once is increased to N times, which will greatly affect the performance. Additionally, the same is true when imposing fines for fraud proofs. Here, introducing MMR is used to alleviate this problem. The following further elaborates on the differences between the MMR used in the embodiments of the present application and the existing Merkle Tree through an example:
[0052] MMR is a variation of the Merkle Tree. Similar to the Merkle Tree, the leaves are the hashes of pieces of data, and the other nodes are the hashes after concatenating the child nodes. The difference lies in the handling of the asymmetric binary tree structure. When the Merkle Tree encounters a situation where the number of leaves is not 2^n, it cannot form a completely symmetric binary tree structure, that is, there are nodes that cannot be paired up. In this case, they are paired with themselves, as Figure 2 shown.
[0053] When adding a new leaf, the hashes of the entire path from the bottom to the top of this leaf need to be recalculated. If the total number of leaves is n, then roofLog2n calculations are required.
[0054] However, MMR will try to construct a symmetric binary tree under the condition of the current number of leaves. For example, if the number of leaves is 14, then:
[0055] The first 8 leaves can construct a symmetric binary tree with a depth of 3,
[0056] For the remaining 6 leaves, 4 of them can construct a symmetric binary tree with a depth of 2,
[0057] The remaining 2 leaves can construct a symmetric binary tree with a depth of 1,
[0058] In shape, it is like the 3 small mountains as Figure 3 shown. This is also the origin of the name MMR. The calculation method of the MMR root is to concatenate the root hash of the first small mountain and the root hash of the second small mountain, and calculate the resulting hash; then, on this basis, concatenate with the 3rd small mountain and calculate the resulting hash; if there are more, loop in sequence.
[0059] Taking Figure 3 the number of leaves as a binary representation, that is, 1110. When adding a new leaf at this time, only 1 hash calculation is required;
[0060] If the number of leaves is 1101101, adding a new leaf requires 2 hash calculations;
[0061] If the number of leaves is 1100111, adding a new leaf requires 4 hash calculations;
[0062] If the number of leaves is 1011111, adding a new leaf requires 6 hash calculations;
[0063] The calculation rule is the number of consecutive small mountains on the rightmost side + 1.
[0064] If the Merkle Tree is adopted, the number of hash operations required for the above three cases is 7 times, that is, Log2n rounded up.
[0065] For the MMR, the worst case is that all the small mountains are continuous, that is, the case where the number of leaves is 1111111. Adding a new leaf requires 7 hash operations, the same as using the Merkle Tree. However, in the actual application scenario of this application, since each time it is only appended to the rightmost side of the MMR tree, only 1 hash calculation is required. Compared with the Merkle Tree in the prior art, there is a great performance advantage.
[0066] Following the above embodiments of this application, before each shard parallelly calculates the shard proposal, all the transactions allocated are verifiably sorted by the on-chain random number and executed in order, which specifically includes:
[0067] Before each shard parallelly calculates the shard proposal, all the transactions allocated are grouped by the on-chain random number, and the Fisher-Yates algorithm is used to verifiably sort the transactions in each group and execute them in order.
[0068] In the embodiments of this application, in addition to using the Fisher-Yates algorithm to verifiably sort the transactions in each group to ensure the verifiable randomness of the transaction order, other sorting algorithms based on random numbers can also be tried to ensure the fairness and decentralization of the transaction order, so as to achieve the purpose of sorting. Here, in addition to PoS and the on-chain random number, other consensus algorithms (such as BFT, Tendermint, etc.) can also be combined for shard consensus, so as to implement a multi-level consensus mechanism.
[0069] Further, before each shard parallelly calculates the shard proposal, all the transactions allocated are grouped by the on-chain random number, and the Fisher-Yates algorithm is used to verifiably sort the transactions in each group and execute them in order, which specifically includes:
[0070] Perform the following steps on the transactions in each shard:
[0071] Deduplicate all the allocated transactions;
[0072] Group the deduplicated transactions to obtain at least one group and the transactions in each group, realizing the deduplication of the allocated and deduplicated transactions;
[0073] Generate a random seed for transaction sorting using the on-chain random number on the main chain; here, use the on-chain random number on the main chain as the random seed for transaction sorting. Since the random seed comes from the chain and the same random seed will produce the same result, everyone can replay the sorting process to verify whether there is any malicious behavior;
[0074] Adopt the Fisher-Yates algorithm. Each time, select a group from the at least one group according to the generated random seed, and output all the elements within the selected group until all groups are output, so as to complete the sorting of all the assigned transactions;
[0075] Execute all transactions in order.
[0076] The grouping and sorting are further described below by means of a specific embodiment. For example:
[0077] The transactions before grouping are: (Alice, 1), (Bob, 1), (Bob, 2), (Alice, 2), (Charlie, 1), (Alice, 3), (Charlie, 2)
[0078] After grouping: (Alice, 1), (Alice, 2), (Alice, 3), (Bob, 1), (Bob, 2), (Charlie, 1), (Charlie, 2)
[0079] After sorting: (Charlie, 1), (Alice, 1), (Bob, 1), (Alice, 2), (Charlie, 2), (Alice, 3), (Bob, 2)
[0080] It should be noted that in the embodiments of the present application, by combining the on-chain verifiable random number with the grouped Fisher-Yates algorithm, the calculation order of each calculator can be verified (different calculation orders will lead to different results. If the order cannot be verified, each calculator can profit by manipulating the order to cheat). This algorithm is used to perform deterministic sorting on the calculation task list to ensure that the calculator cannot manipulate the order. At the same time, it also ensures that the transaction order initiated by the same account will not change. For example, first transfer to A, and then transfer to B. If there is no money for the second transfer to B, the grouped Fisher-Yates algorithm proposed in the embodiments of the present application ensures that this result will not change.
[0081] In this embodiment, the step of grouping the deduplicated transactions to obtain at least one group and the transactions in each group specifically includes:
[0082] Group the deduplicated transactions according to the sender identifier account_id of the transaction. Group the transactions without a signature of the sender identifier separately to obtain at least one group and the transactions in each group. Here, the sender identifier account_id of the transaction is the transaction identifier of the person who initiated the transaction.
[0083] Continuing with the above embodiments of the present application, a system based on the Optimistic Rollup architecture of MMR and parallel computing proposed by one aspect of the present application further includes:
[0084] After each consensus Proposer block is generated, the system enters a challenge period;
[0085] If there is a malicious shard node, other shard nodes in the blockchain can submit a Fraud Proof for challenge;
[0086] Further, if the Fraud Proof is accepted, the consensus Proposer node needs to remove the Rollup data and roll back the state data corresponding to the affected shard nodes; the malicious shard node will be punished and the pledged token will be forfeited. Through such a challenge mechanism and fraud proof, the system can effectively prevent malicious behavior and ensure data accuracy.
[0087] In summary, a system based on the Optimistic Rollup architecture of MMR and parallel computing provided by the present application, wherein the system includes: each shard chain in the blockchain holds complete state data and does not perform state sharding, and each shard chain independently performs block production consensus and executes computing tasks; all shards in the block hold the full amount of chain data, and a shard proposal is broadcast when the shard produces a block. When the consensus chain produces a block, it includes all shard proposals; each transaction in the blockchain is allocated to a shard in the blockchain for calculation according to the sender identifier of the transaction; before parallel computing the shard proposals, each shard performs a verifiable sorting of all the transactions allocated to it through a chain random number and executes them in order; aggregate the shard proposals of all shards in parallel computing into the MMR and submit them to the main chain. Each new consensus block creates a new leaf node on the rightmost side of the MMR tree to ensure only one hash calculation. The present application speeds up by selecting multiple additional calculators to perform all computing tasks in parallel when producing a block, reducing the number of tasks that each calculator needs to process, and at the same time introducing the MMR data structure and chain random number to improve the TPS of the decentralized Rollup, so as to better balance the requirements of decentralization and high performance.
[0088] It should be noted that the present application can be implemented in software and / or a combination of software and hardware. For example, it can be implemented using an application specific integrated circuit (ASIC), a general purpose computer, or any other similar hardware device. In one embodiment, the software program of the present application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of the present application (including related data structures) can be stored in a computer-readable recording medium, such as a RAM memory, a magnetic or optical drive, or a floppy disk and similar devices. Additionally, some steps or functions of the present application can be implemented using hardware, for example, as a circuit that cooperates with a processor to execute each step or function.
[0089] In addition, a part of the present application can be applied as a computer program product, such as computer program instructions, which when executed by a computer, through the operation of the computer, can call or provide the methods and / or technical solutions according to the present application. The program instructions for calling the methods of the present application may be stored in a fixed or removable recording medium, and / or transmitted through a data stream in a broadcast or other signal-bearing medium, and / or stored in the working memory of a computer device running according to the program instructions. Here, an embodiment according to the present application includes a device, which includes a memory for storing computer program instructions and a processor for executing the program instructions. When the computer program instructions are executed by the processor, the device is triggered to run based on the methods and / or technical solutions according to the foregoing multiple embodiments of the present application.
[0090] For those skilled in the art, it is obvious that the present application is not limited to the details of the above exemplary embodiments, and without departing from the spirit or basic characteristics of the present application, the present application can be implemented in other specific forms. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present application is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present application. Any reference signs in the claims should not be construed as limiting the claimed rights. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. The multiple units or devices stated in the apparatus claims can also be implemented by one unit or device through software or hardware. First, second, etc. are used to denote names and do not denote any particular order.
Claims
1. A system based on the Optimistic Rollup architecture of MMR and parallel computing, wherein: The system includes: Each shard chain in the blockchain holds complete state data and does not perform state sharding. Each shard chain independently performs block consensus and computing tasks. All shards in the block hold the full amount of chain data. When a shard generates a block, it broadcasts a shard proposal. When the consensus chain generates a block, it contains all shard proposals. Each transaction in the blockchain is assigned to a shard in the blockchain for computation based on the sender identifier of the transaction; Before each shard calculates the shard proposal in parallel, it verifiably sorts all the assigned transactions using the on-chain random number and executes them in order; The shard proposals of all shards calculated in parallel are aggregated into the MMR and submitted to the main chain. Each new consensus block creates a new leaf node on the rightmost side of the MMR tree to ensure that there is only one hash calculation.
2. The system according to claim 1, wherein: Before calculating the shard proposals in parallel, each shard verifiably sorts all the assigned transactions using the random number on the chain, and executes them in order, including: Before each shard calculates the shard proposal in parallel, it groups all the assigned transactions using on-chain random numbers, and uses the Fisher-Yates algorithm to verifiably sort the transactions in each group and execute them in order.
3. The system according to claim 2, wherein: Before calculating the shard proposals in parallel, each shard groups all the assigned transactions by using the random number on the chain, and uses the Fisher-Yates algorithm to verifiably sort the transactions in each group and execute them in order, including: The following steps are performed for transactions in each shard: De-duplicate all assigned transactions; Group the deduplicated transactions to obtain at least one group and the transactions in each group; Use the on-chain random number on the main chain to generate a random seed for transaction sorting; Using the Fisher-Yates algorithm, one group is selected from the at least one group each time according to the generated random seed, and all elements in the selected group are output until all groups are output, so as to complete the sorting of all the allocated transactions; Execute all transactions in sequence.
4. The system according to claim 3, wherein: The deduplicated transactions are grouped to obtain at least one group and the transactions in each group, including: The deduplicated transactions are grouped according to the sender identifier of the transaction, and the transactions without the signature of the sender identifier are grouped separately to obtain at least one group and the transactions in each group.
5. The system according to any one of claims 1 to 4, wherein: The system also includes: After each consensus block is generated, the system enters a challenge period; If a shard node acts maliciously, other shard nodes in the blockchain submit a fraud proof Fraud Proof for challenge.
6. The system according to claim 5, wherein: The system includes: If the Fraud Proof is accepted, the consensus node removes the Rollup data and rolls back the status data corresponding to the affected shard nodes; Among them, malicious shard nodes will be punished and the staked tokens will be confiscated.