Implementation method and equipment of OptimiticRollup architecture based on decentralized Sequence
By adopting decentralized Sequencer in the Optimistic Rollup architecture and using random numbers and transaction hash values to sort transactions, the trust problems and single-point failure risks caused by centralized Sequencer are solved, and the consistency of transaction order and system stability are improved.
Patent Information
- Application Number
- CN202510114779.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-01-24
AI Technical Summary
In the existing Optimistic Rollup architecture, centralized Sequencer has trust problems and a single point of failure risk, which may affect transaction sorting and system stability.
The OptimisticRollup architecture based on decentralized Sequencer is adopted to generate random numbers based on the parent block and node private keys through the target node in the blockchain network, and transaction selection and sorting are performed in combination with transaction hash values. Random numbers are generated through the verifiable delay function VRF algorithm to ensure the consistency of transaction order.
Through the decentralized Sequencer architecture, we ensure the consistency of transaction order, prevent nodes from deliberately selecting transaction jobs, eliminate trust problems and single-point failure risks, and improve system stability and security.
Smart Images

Figure CN119946056A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a method and device for implementing an OptimisticRollup architecture based on a decentralized sequencer. Background Art
[0002] In the prior art, Optimistic Rollup is a capacity expansion solution that submits transaction data to the Layer 2 network and verifies it on the main chain. The core idea of Optimistic Rollup is that in Layer 2, transactions are considered as "optimistic" assumptions, submitted first and then verified, assuming that the submitted transactions are valid. Only when the challenger provides fraud proofs to prove that a transaction is invalid will it be rolled back and the submitter will be punished.
[0003] In the current Optimistic Rollup architecture, the determinism of transaction execution order is the key to ensuring that FraudProofs can be verified. To this end, all current implementations use a centralized sequencer model, in which transactions are sorted and submitted to the main chain through a centralized server or cluster. This design ensures fast transaction sequencing and low latency, but it also introduces the following potential problems:
[0004] As the only transaction sorting node, the centralized Sequencer may lead to cheating or abuse of power. Attackers can manipulate the Sequencer to select certain transactions or deliberately not select certain transactions, affecting the status of the entire system. The decentralized Sequencer ensures the fairness of transaction sorting and prevents nodes from deliberately selecting or not selecting certain transactions, that is, preventing nodes from doing evil.
[0005] The centralized sequencer may be manipulated, resulting in unfair transaction ordering, affecting the decentralized nature of the system and causing trust issues;
[0006] Traditional centralized solutions rely on a single node or cluster. If the node or cluster fails, it may cause service interruption or data inconsistency of the entire network. If the Sequencer fails or is attacked, the stability of the entire system will be affected, and there is a risk of single point failure.
[0007] In the existing technology, centralized sequencers are mainly used to sort transactions, such as Rollup systems such as Optimism and Arbitrum. These systems rely on a single central entity (or cluster) to receive and sort transactions in order, thus avoiding the problem of inconsistency in the order of transaction execution.
[0008] The transaction ordering of traditional decentralized solutions may be attacked or manipulated, resulting in inconsistent transaction order and inconsistency in transaction order, which will affect the verification of Fraud Proofs.
[0009] However, although these solutions guarantee performance and low latency, since all transactions must be ordered through a single sequencer, it leads to trust issues and the introduction of single point failure risks. Summary of the invention
[0010] One purpose of this application is to provide an implementation method and device of an OptimisticRollup architecture based on a decentralized sequencer to avoid the trust issues and single point failure risks brought about by existing centralized sequencer solutions, while maintaining high performance and low latency, ensuring the consistency of the execution order of all transactions, and facilitating participants to generate verifiable fraud proofs.
[0011] According to one aspect of the present application, a method for implementing an OptimisticRollup architecture based on a decentralized sequencer is provided, wherein the method includes:
[0012] Users submit all transactions to Layer 2, and broadcast the transactions to all nodes in the blockchain network;
[0013] When a target node in the blockchain network obtains the right to generate a block, the target node generates a random number Randomness according to the parent block and the node private key of the target node;
[0014] The target node selects and sorts the transactions according to the random number Randomness and the hash value of each transaction;
[0015] Execute all selected transactions in sorted order and generate an execution receipt, wherein the execution receipt includes the execution result of each transaction in all selected transactions;
[0016] The execution receipt is packaged and submitted to the main chain, so that other nodes in the blockchain network can challenge and verify based on the submitted transaction and its corresponding execution receipt.
[0017] Furthermore, in the above method, the target node generates a random number Randomness according to the parent block and the node private key of the target node, including:
[0018] The target node generates a hash seed according to the parent block and the node private key of the target node;
[0019] Generate a random number Randomness through the Verifiable Delay Function VRF algorithm, and the generated random number Randomness is used as a seed for transaction sorting;
[0020] Among them, the calculation formula for generating random number Randomness is:
[0021] Randomness=VRF(NodePrivateKey, ParentBlock)
[0022] Among them, VRF() is the verifiable delay function,
[0023] NodePrivateKey is the node private key of the target node.
[0024] ParentBlock is the hash of the parent block of the target node.
[0025] Furthermore, in the above method, the target node selects and sorts the transactions according to the random number Randomness and the hash value of each transaction, including:
[0026] The hash value of each transaction is calculated respectively, and the distance is calculated by the hash value of each transaction and the node ID of the target node, wherein the formula for calculating the distance is:
[0027] Distance(T, nodeID)=|Hash(T, Randomness)-Hash(nodeID, Randomness)|
[0028] Wherein, T is the current transaction, nodeID is the node ID of the target node;
[0029] Select transactions within the distance range from all submitted transactions and sort them;
[0030] The calculation formula for sorting the selected transactions within the distance range is:
[0031] SelectedTransaction i =Distance(Transaction i , nodeID)∈[0,TxRange]
[0032] Among them, SelectedTransaction i Indicates the selected transaction Transaction i 's sorting.
[0033] Furthermore, in the above method, the method further comprises:
[0034] If the challenge verification by other nodes in the blockchain network is successful, the target node is instructed to do evil and a transaction penalty is imposed on the target node;
[0035] If the challenge verification by other nodes in the blockchain network fails, the transaction submitted by the target node and its execution receipt will continue to remain valid.
[0036] Furthermore, in the above method, the method further comprises:
[0037] If the target node in the blockchain network commits malicious acts in one or more of generating transaction order, selecting transactions and executing receipts, other nodes in the blockchain network submit challenge verification through Fraud Proofs. The malicious target node will be subject to economic penalties, and a penalty corresponding to a preset proportion of the economic penalty will be rewarded to the node that successfully challenges the verification.
[0038] Furthermore, in the above method, the method further comprises:
[0039] A pseudo-random number r is generated by a verifiable random function VRF, and a proof is provided so that any node can verify that the pseudo-random number r is generated by the input and the key, wherein the working principle of the verifiable random function VRF includes the following elements:
[0040] Element 1: Input. The input of VRF includes a random seed value and a node private key.
[0041] Element 2: Output is a pseudo-random number r, which is a random value generated based on the input data and the node private key;
[0042] A proof, which is used to ensure that the pseudo-random number is generated by the node private key and the node private key is not exposed during the verification process;
[0043] Factor 3: The calculation formula for generating a pseudo-random number r through VRF is:
[0044] r = VRFeval(x, sk)
[0045] Among them, x is the input data; sk is the node private key of the node; r is the generated pseudo-random number;
[0046] Element 4: Proof generation. VRF also generates a proof π to ensure the correctness of the generated pseudo-random number r.
[0047] Among them, the proof π is obtained based on the calculation result of the input data x, the node private key sk of the node and the generated pseudo-random number r. The specific generation formula is:
[0048] π=VRFproof(x,sk)
[0049] The proof π is attached to the output so that any node can verify the source of the pseudo-random number r;
[0050] Element 5: Given an input data x, a node's public key pk and a proof π, verify the proof π to check whether the generated pseudo-random number r is valid and whether it is indeed generated by the node's private key sk. The calculation formula of the verification function is:
[0051] VRFverify(x,pk,r,π)=trueifandonlyifr=VRFeval(x,sk)
[0052] The verification function returns a Boolean value. If it is true, it means that the proof is valid and the generated pseudo-random number r is indeed generated by the node's private key sk; if it is false, it means that the generated pseudo-random number r has been tampered with or generated using an incorrect private key.
[0053] According to another aspect of the present application, a non-volatile storage medium is also provided, on which computer-readable instructions are stored. When the computer-readable instructions can be executed by a processor, the processor implements the implementation method of the OptimisticRollup architecture based on the decentralized Sequencer as described above.
[0054] According to another aspect of the present application, there is also provided a device for implementing an OptimisticRollup architecture based on a decentralized sequencer, wherein the device includes:
[0055] one or more processors;
[0056] A computer readable medium for storing one or more computer readable instructions,
[0057] When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the implementation method of the OptimisticRollup architecture based on the decentralized Sequencer as described above.
[0058] Compared with the prior art, this application submits all transactions to the Layer 2 network through the user, and propagates the transactions to all nodes in the blockchain network through broadcasting; when a target node in the blockchain network obtains the right to generate a block, the target node generates a random number Randomness according to the parent block and the node private key of the target node; the target node selects and sorts the transactions according to the random number Randomness and the hash value of each transaction; executes all selected transactions in the sorting order, generates an execution receipt, and the execution receipt includes the execution result of each transaction in all selected transactions; the execution receipt is packaged and submitted to the main chain, so that other nodes in the blockchain network can challenge and verify according to the submitted transactions and their corresponding execution receipts. Through the decentralized Sequencer architecture, by ensuring the consistency of transaction order and preventing nodes from deliberately selecting transaction jobs through transaction selection, it is ensured that each transaction can provide verifiable proof, and trust issues and single point failure risks are eliminated in a decentralized manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0060] Figure 1 A flow chart showing a method for implementing an OptimisticRollup architecture based on a decentralized Sequencer according to one aspect of the present application is shown.
[0061] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0062] The present application is described in further detail below in conjunction with the accompanying drawings.
[0063] In a typical configuration of the present application, the terminal, the device of the service network and the trusted party all include one or more processors (CPU), input / output interfaces, network interfaces and memories.
[0064] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0065] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0066] like Figure 1 As shown, Figure 1 A flowchart of an implementation method of an OptimisticRollup architecture based on a decentralized sequencer is proposed as one aspect of the present application. The method can be implemented, but not limited to, using a blockchain-based programming language such as Solidity (for the implementation of smart contracts), Rust or Go (for the implementation of nodes and verifiers), etc.; hardware requirements include high-performance computer nodes to support the operation of the decentralized sequencer to ensure the efficiency and reliability of transaction sorting. The method constructs a non-admission, decentralized Rollup implementation by removing the randomness on the chain and the transaction selection TransactionSelection mechanism, wherein the method includes steps S11, S12, S13, S14 and S15, specifically including the following steps:
[0067] In step S11, the user submits all transactions to the second-layer network Layer2, and propagates the transactions to all nodes in the blockchain network through broadcasting, which not only realizes the submission of transactions, but also completes the transaction broadcasting.
[0068] Step S12, when a target node in the blockchain network obtains the right to generate a block (for example, through POS or other consensus), the target node generates a random number Randomness through a verifiable random function VRF according to the parent block and the node private key of the target node. The generated random number Randomness facilitates subsequent transaction sorting; here, the target node is any node in the blockchain network.
[0069] Step S13: The target node selects and sorts the transactions according to the random number Randomness and the hash value of each transaction.
[0070] Step S14, executing all selected transactions in the sorting order, and generating an execution receipt, wherein the execution receipt includes the execution result of each transaction in all selected transactions.
[0071] In step S14, the transaction Execute Transaction is selected, all selected transactions are executed in sorted order, and an execution receipt (ER) is generated. The execution receipt records the transaction and its execution results, including but not limited to status changes, fees, etc.
[0072] Step S15, package the execution receipt and submit it to the main chain, so that other nodes in the blockchain network can challenge and verify the submitted transaction and its corresponding execution receipt. 5.
[0073] Rollup package submission
[0074] In step S15, the execution receipt ER will be packaged and submitted, and the final status will be submitted to the main chain. At this time, the transaction result has been determined, and the fraud proof Fraud Proof verification can be started. In the challenge verification stage of the fraud proof, other nodes in the blockchain network perform challenge verification based on the submitted transaction and the execution receipt corresponding to the transaction. The challenge verification includes the following steps:
[0075] Challenge Randomness
[0076] Challenge Transaction Selection;
[0077] Challenge Transaction Execution Receipt.
[0078] Among them, the challenger proves that the execution or selection of a transaction is wrong by providing Fraud Proof. The challenge and Fraud proof are not the focus of this application and will not be described in detail here.
[0079] Through the above steps S11 to S15, the decentralized sequencer architecture is used to generate transaction order to ensure the consistency of transaction order, and the transaction is selected by combining the random number Randomness, the hash value of the transaction and the node ID to prevent nodes from doing evil.
[0080] Following the above embodiment of the present application, the target node in step S12 generates a random number Randomness according to the parent block and the node private key of the target node, specifically including:
[0081] First, each target node in the blockchain network generates a hash seed according to the parent block (ParentBlock) and the node private key (NodePrivateKey) of the target node;
[0082] Then, a random number Randomness is generated through the Verifiable Delay Function VRF algorithm, and the generated random number Randomness is used as a seed for transaction sorting;
[0083] Among them, the calculation formula for generating random number Randomness is:
[0084] Randomness=VRF(NodePrivateKey, ParentBlock)
[0085] Among them, VRF() is the verifiable delay function,
[0086] NodePrivateKey is the node private key of the target node.
[0087] ParentBlock is the hash of the parent block of the target node, thereby realizing the generation of node blocks and random numbers.
[0088] Following the above embodiment of the present application, the target node in step S13 selects and sorts the transactions according to the random number Randomness and the hash value of each transaction, specifically including:
[0089] For each transaction T and random number Randomness, first, the hash value of each transaction is calculated respectively, and the distance is calculated by the hash value of each transaction and the node ID (nodeID) of the target node, wherein the formula for calculating the distance is:
[0090] Distance(T, nodeID)=|Hash(T, Randomness)-Hash(nodeID, Randomness)|
[0091] Wherein, T is the current transaction, nodeID is the node ID of the target node;
[0092] Then, transactions within the distance range are selected from all transactions submitted by the user and sorted;
[0093] The calculation formula for sorting the selected transactions within the distance range is:
[0094] SelectedTransaction i =Distance(Transaction i , nodeID)∈[0,TxRange]
[0095] Among them, SelectedTransaction i Indicates the selected transaction Transaction i 's sorting.
[0096] Here, the node uses the random number Randomness and the hash value of each transaction to determine the order of transactions, and selects transactions within the calculated distance range to achieve transaction selection and sorting.
[0097] Following the above embodiment of the present application, the method further includes:
[0098] If the challenge verification by other nodes in the blockchain network is successful, the target node is instructed to do evil and a transaction penalty is imposed on the target node; the transaction penalty includes but is not limited to a fine or cancellation of the transaction, etc.;
[0099] If the challenge verification by other nodes in the blockchain network fails, the transaction submitted by the target node and its execution receipt will continue to remain valid.
[0100] Following the above embodiment of the present application, the method further includes:
[0101] If the target node in the blockchain network commits a malicious act in one or more of the following situations: generating transaction order, selecting transactions, and executing receipts, other nodes in the blockchain network submit challenge verification through Fraud Proofs. The malicious target node will be subject to economic penalties, and the penalty corresponding to the preset proportion of the economic penalty will be rewarded to the node that successfully challenges the verification. Of course, there is also a reward distribution system in the blockchain network. For example, the block-producing node will receive the reward of the Rollup batch, thereby realizing the reward and punishment of the node.
[0102] Following the above embodiment of the present application, the method further includes:
[0103] A pseudo-random number r is generated by a verifiable random function VRF, and a proof is provided so that any node can verify that the pseudo-random number r is generated by the input and the key, wherein the Verifiable Random Function (VRF) is an encryption function that can generate a pseudo-random number and provide a proof so that anyone can verify that the random number is generated by a specific input and key without being tampered with. The working principle of the Verifiable Random Function VRF includes the following elements:
[0104] Element 1: Input. The input of VRF includes a random seed value and a node private key and other data; a random seed value includes but is not limited to the hash of the block header or other messages related to the system information of the blockchain network;
[0105] Element 2: Output, a pseudo-random number r, is a random value generated based on the input data and the node private key;
[0106] A proof, which is used to ensure that the pseudo-random number is generated by the node private key and that the node private key is not exposed during the verification process;
[0107] Factor 3: The calculation formula for generating a pseudo-random number r through VRF is:
[0108] r = VRFeval(x, sk)
[0109] Among them, x is the input data; sk is the node private key of the node; r is the generated pseudo-random number;
[0110] Element 4: Proof generation. VRF also generates a proof π to ensure the correctness of the generated pseudo-random number r.
[0111] Among them, the proof π is obtained based on the calculation result of the input data x, the node private key sk of the node and the generated pseudo-random number r. The specific generation formula is:
[0112] π=VRFproof(x,sk)
[0113] The proof π is attached to the output so that any node can verify the source of the pseudo-random number r;
[0114] Element 5: Given an input data x, a node's public key pk and a proof π, verify the proof π to check whether the generated pseudo-random number r is valid and whether it is indeed generated by the node's private key sk. The calculation formula of the verification function is:
[0115] VRFverify(x,pk,r,π)=trueifandonlyifr=VRFeval(x,sk)
[0116] The verification function returns a Boolean value. If it is true, it means that the proof is valid and the generated pseudo-random number r is indeed generated by the node's private key sk; if it is false, it means that the generated pseudo-random number r has been tampered with or generated using an incorrect private key.
[0117] According to another aspect of the present application, a non-volatile storage medium is also provided, on which computer-readable instructions are stored. When the computer-readable instructions can be executed by a processor, the processor implements the implementation method of the OptimisticRollup architecture based on the decentralized Sequencer as described above.
[0118] According to another aspect of the present application, there is also provided a device for implementing an OptimisticRollup architecture based on a decentralized sequencer, wherein the device includes:
[0119] one or more processors;
[0120] A computer readable medium for storing one or more computer readable instructions,
[0121] When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the implementation method of the OptimisticRollup architecture based on the decentralized Sequencer as described above.
[0122] Here, for the detailed contents of each embodiment of the implementation device of the OptimisticRollup architecture based on the decentralized Sequencer, please refer to the corresponding part of the implementation method embodiment of the OptimisticRollup architecture based on the decentralized Sequencer mentioned above, which will not be repeated here.
[0123] In the embodiments of this application, the purpose is to provide a decentralized sequencer architecture, which ensures the consistency of transaction order and prevents nodes from deliberately selecting transaction jobs through transaction selection, ensures that each transaction can provide verifiable fraud proofs, and eliminates trust issues and single point failure risks in a decentralized manner. Specific technical effects include the following:
[0124] Prevent nodes from doing evil: Ensure the fairness of transaction sorting through a decentralized sequencer to prevent nodes from deliberately selecting or not selecting certain transactions.
[0125] Unified transaction order: Ensure that all participants see the same transaction order to facilitate subsequent Fraud Proofs verification.
[0126] High reliability and security: The decentralized design eliminates the risk of single point failure and improves the stability and security of the system.
[0127] In summary, this application submits all transactions to the second-layer network Layer2 through users, and propagates the transactions to all nodes in the blockchain network through broadcasting; when a target node in the blockchain network obtains the right to generate a block, the target node generates a random number Randomness according to the parent block and the node private key of the target node; the target node selects and sorts the transactions according to the random number Randomness and the hash value of each transaction; executes all selected transactions in the sorting order, generates an execution receipt, and the execution receipt includes the execution result of each transaction in all selected transactions; the execution receipt is packaged and submitted to the main chain, so that other nodes in the blockchain network can challenge and verify according to the submitted transactions and their corresponding execution receipts. Through the decentralized Sequencer architecture, by ensuring the consistency of transaction order and preventing nodes from deliberately selecting transaction jobs through transaction selection, it is ensured that each transaction can provide verifiable proof, and trust issues and single point failure risks are eliminated in a decentralized manner.
[0128] It should be noted that the present application can be implemented in software and / or a combination of software and hardware, for example, 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 relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented using hardware, for example, as a circuit that cooperates with a processor to perform each step or function.
[0129] In addition, a part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. The program instruction for calling the method 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 a working memory of a computer device that runs according to the program instruction. Here, according to an embodiment of the present application, a device is included, the device including a memory for storing computer program instructions and a processor for executing program instructions, wherein, when the computer program instruction is executed by the processor, the device is triggered to run the method and / or technical solution based on the aforementioned multiple embodiments according to the present application.
[0130] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
Claims
1. A method for implementing an OptimisticRollup architecture based on a decentralized sequencer, wherein: The method includes: Users submit all transactions to Layer 2, and broadcast the transactions to all nodes in the blockchain network; When a target node in the blockchain network obtains the right to generate a block, the target node generates a random number Randomness according to the parent block and the node private key of the target node; The target node selects and sorts the transactions according to the random number Randomness and the hash value of each transaction; Execute all selected transactions in sorted order and generate an execution receipt, wherein the execution receipt includes the execution result of each transaction in all selected transactions; The execution receipt is packaged and submitted to the main chain, so that other nodes in the blockchain network can challenge and verify based on the submitted transaction and its corresponding execution receipt.
2. The method according to claim 1, wherein: The target node generates a random number Randomness according to the parent block and the node private key of the target node, including: The target node generates a hash seed according to the parent block and the node private key of the target node; Generate a random number Randomness through the Verifiable Delay Function VRF algorithm, and the generated random number Randomness is used as a seed for transaction sorting; Among them, the calculation formula for generating random number Randomness is: Randomness=VRF(NodePrivateKey, ParentBlock) Among them, VRF() is the verifiable delay function, NodePrivateKey is the node private key of the target node. ParentBlock is the hash of the parent block of the target node.
3. The method according to claim 2, wherein: The target node selects and sorts the transactions according to the random number Randomness and the hash value of each transaction, including: The hash value of each transaction is calculated respectively, and the distance is calculated by the hash value of each transaction and the node ID of the target node, wherein the formula for calculating the distance is: Distance(T'nodeID)=|Hash(T'Randomness)-Hash(nodeID,Randomness)| Wherein, T is the current transaction, nodeID is the node ID of the target node; Select transactions within the distance range from all submitted transactions and sort them; The calculation formula for sorting the selected transactions within the distance range is: SelectedTransaction i =Distance(Transactioni,nodeID)∈[0,TxRange] Among them, SelectedTransaction i Indicates the selected transaction Transaction i 's sorting.
4. The method according to claim 1, wherein: The method further comprises: If the challenge verification by other nodes in the blockchain network is successful, the target node is instructed to do evil and a transaction penalty is imposed on the target node; If the challenge verification by other nodes in the blockchain network fails, the transaction submitted by the target node and its execution receipt will continue to remain valid.
5. The method according to claim 4, wherein: The method further comprises: If the target node in the blockchain network commits a malicious act in one or more of generating transaction order, selecting transactions and executing receipts, other nodes in the blockchain network submit challenge verification through Fraud Proofs. The malicious target node will be subject to economic penalties, and a penalty corresponding to a preset proportion of the economic penalty will be rewarded to the node that successfully challenges the verification.
6. The method according to any one of claims 1 to 5, wherein: The method further comprises: A pseudo-random number r is generated by a verifiable random function VRF, and a proof is provided so that any node can verify that the pseudo-random number r is generated by the input and the key, wherein the working principle of the verifiable random function VRF includes the following elements: Element 1: Input. The input of VRF includes a random seed value and a node private key. Element 2: Output is a pseudo-random number r, which is a random value generated based on the input data and the node private key; A proof, which is used to ensure that the pseudo-random number is generated by the node private key and the node private key is not exposed during the verification process; Factor 3: The calculation formula for generating a pseudo-random number r through VRF is: r = VRFeval(x, sk) Among them, x is the input data; sk is the node private key of the node; r is the generated pseudo-random number; Element 4: Proof generation. VRF also generates a proof π to ensure the correctness of the generated pseudo-random number r. Among them, the proof π is obtained based on the calculation result of the input data x, the node private key sk of the node and the generated pseudo-random number r. The specific generation formula is: π=VRFproof(x,sk) The proof π is attached to the output so that any node can verify the source of the pseudo-random number r; Element 5: Given an input data x, a node's public key pk and a proof π, verify the proof π to check whether the generated pseudo-random number r is valid and whether it is indeed generated by the node's private key sk. The calculation formula of the verification function is: VRFverify(x, pk, r, π) = trueifandonlyifr = VRFeval(x, sk) wherein the verification function returns a Boolean value. If it is true, it indicates that the proof is valid and the generated pseudo-random number r is indeed generated by the node's private key sk; if it is false, it indicates that the generated pseudo-random number r has been tampered with or generated using the wrong private key.
7. A non-volatile storage medium having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executable by a processor, the processor is enabled to implement the method according to any one of claims 1 to 6.
8. A device for implementing the OptimisticRollup architecture based on a decentralized sequencer, wherein: The equipment includes: one or more processors; A computer readable medium for storing one or more computer readable instructions, When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Method for realizing roll-up of two-layer network and two-layer network
CN117439728A
Decentralized Roollup sequencer construction method
CN119313346A
Random number generation method, blockchain node, system and medium
WO2021093244A1