Implementation method and device of optimistic rollup architecture based on decentralized sequencer

By using a decentralized sequencer architecture, which utilizes all nodes in the blockchain network to generate random numbers and hash values ​​to select transactions, the trust issues and single point of failure risks associated with centralized sequencers are resolved, achieving consistency in transaction order and system stability.

CN119946056BActive Publication Date: 2025-11-04SHANGHAI KUNYAO NETWORK SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510114779.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-11-04
Estimated Expiration
2045-01-24

AI Technical Summary

Technical Problem

In the existing Optimistic Rollup architecture, the trust issues and single point of failure risks caused by the centralized Sequencer affect the fairness of transaction ordering and the stability of the system.

Method used

It adopts a decentralized Sequencer architecture, in which transactions are broadcast through all nodes in the blockchain network. The target node generates a random number based on the parent block and the node's private key, and selects and sorts the nodes by combining the transaction hash value. It then generates an execution receipt and submits it to the main chain, where other nodes challenge and verify it.

Benefits of technology

Ensure the consistency of transaction order, prevent malicious node behavior, eliminate trust issues and single point of failure risks, and improve system stability and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119946056B_ABST
    Figure CN119946056B_ABST
Patent Text Reader

Abstract

The application aims to provide an implementation method and device of an Optimistic Rollup architecture based on a decentralized Sequencer. All transactions are submitted to a Layer 2 network by a user and are propagated to all nodes in a blockchain network through broadcasting. When a target node in the blockchain network obtains block generation right, the target node generates a random number Randomness according to a parent block and a node private key of the target node, and selects and sorts transactions according to the random number Randomness and a hash value of each transaction. All selected transactions are executed in a sorted order to generate an execution receipt. The execution receipt is packaged and submitted to a main chain, so that other nodes in the blockchain network verify the challenge according to the submitted transactions and the corresponding execution receipt. Through the decentralized Sequencer architecture, the consistency of the transaction order is ensured, and the transaction selection prevents the nodes from intentionally selecting transaction jobs. Through the decentralized manner, the trust problem and the single-point failure risk are eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of blockchains, and in particular to an implementation method and device of an Optimistic Rollup architecture based on a decentralized Sequencer. BACKGROUND

[0002] In the prior art, Optimistic Rollup is a scaling solution that submits transaction data to a Layer2 network and verifies it on the main chain. The core idea of Optimistic Rollup is that in Layer2, transactions are assumed to be "optimistic" and are verified after being submitted, assuming that the submitted transactions are valid. Only when a challenger provides Fraud Proofs to prove that a transaction is invalid will the system be rolled back and the submitter be punished.

[0003] In the current Optimistic Rollup architecture, the certainty of the order of transaction execution is the key to ensuring that Fraud Proofs 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 by a centralized server or cluster. This design ensures fast sequencing and low latency of transactions, but also introduces the following potential problems:

[0004] The centralized Sequencer, as the only transaction sequencing node, can lead to problems of cheating or abuse of power. Attackers can manipulate the Sequencer to select certain transactions or deliberately not select certain transactions, affecting the state of the entire system. By decentralizing the Sequencer, the fairness of transaction sequencing can be ensured, and nodes can be prevented from intentionally selecting or not selecting certain transactions, i.e., preventing nodes from committing fraud.

[0005] The centralized Sequencer can be manipulated, leading to unfair transaction sequencing and affecting the decentralization characteristics of the system, resulting in trust issues.

[0006] The traditional centralized solution relies on a single node or cluster, and if this node or cluster fails, it can cause the entire network to be interrupted or the data to be inconsistent. If the Sequencer fails or is attacked, the stability of the entire system will be affected, and there is a single point of failure risk.

[0007] In the prior art, a centralized Sequencer is mainly used for transaction sequencing, such as the Rollup systems of Optimism and Arbitrum, which use this solution. These systems rely on a single central entity (or cluster) to receive and sequence transactions in order, thereby avoiding the problem of inconsistent order of transaction execution.

[0008] The transaction ordering of the traditional decentralized solution can be attacked or manipulated, resulting in inconsistent transaction order and non-uniformity of transaction order, thereby affecting the verification of Fraud Proofs.

[0009] However, although these solutions guarantee performance and low latency, the trust problem and single point of failure risk are introduced due to the fact that all transactions must be ordered by a single Sequencer. SUMMARY

[0010] An object of the present application is to provide an implementation method and device of an Optimistic Rollup architecture based on a decentralized Sequencer, to avoid the trust problem and single point of failure risk brought by the existing centralized Sequencer solution, while maintaining high performance and low latency, ensuring the consistency of all transaction execution order, and facilitating participants to generate verifiable Fraud Proofs.

[0011] According to one aspect of the present application, an implementation method of an Optimistic Rollup architecture based on a decentralized Sequencer is provided, wherein the method comprises:

[0012] The user submits all transactions to Layer 2 and broadcasts the transactions to all nodes in the blockchain network;

[0013] When a target node in the blockchain network obtains the block generation right, 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 orders the transactions according to the random number Randomness and the hash value of each transaction;

[0015] According to the order, all selected transactions are executed to generate an execution receipt, which includes the execution result of each transaction in the selected transactions;

[0016] The execution receipt is packaged and submitted to the main chain, so that other nodes in the blockchain network verify the challenge according to the submitted transactions and their corresponding execution receipts.

[0017] Further, 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, comprising:

[0018] The target node generates a hash seed according to the parent block and the node private key of the target node;

[0019] A random number Randomness is generated by a verifiable delay function VRF algorithm, and the generated random number Randomness is used as a seed for transaction ordering;

[0020] The calculation formula for generating the random number Randomness is:

[0021] Randomness = VRF(NodePrivateKey, ParentBlock)

[0022] wherein VRF() is a verifiable delay function,

[0023] NodePrivateKey is a node private key of the target node,

[0024] ParentBlock is a hash of a parent block of the target node.

[0025] Further, in the above method, the target node selects and orders the transactions according to the random number Randomness and the hash value of each transaction, comprising:

[0026] calculating the hash value of each transaction respectively, and calculating the distance through 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, and nodeID is the node ID of the target node;

[0029] selecting the transactions within the range of the distance from all submitted transactions, and ordering them;

[0030] wherein the calculation formula for ordering the selected transactions within the range of the distance is:

[0031] SelectedTransaction i = Distance(Transaction i , nodeID) ∈ [0, TRange]

[0032] wherein SelectedTransaction i represents the ordering of the selected transaction Transaction i , and [0, TxRange] represents a preset range.

[0033] Further, in the above method, the method further comprises:

[0034] If the other nodes in the blockchain network challenge verification successfully, it indicates that the target node is malicious, and the target node is punished by transaction;

[0035] If the other nodes in the blockchain network challenge verification unsuccessfully, the transaction submitted by the target node and its execution receipt continue to maintain validity.

[0036] Further, in the above method, the method further comprises:

[0037] If the target node in the blockchain network is malicious in one or more of the following situations: generating transaction order, selecting transaction and executing receipt, the other nodes in the blockchain network submit challenge verification through fraud proofs, the malicious target node will be economically punished, and the preset proportion of the economic punishment corresponds to the punishment, which is rewarded to the node that successfully challenges verification.

[0038] Further, 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 to enable any node to verify that the pseudo-random number r is generated by input and key, wherein the working principle of the verifiable random function VRF includes the following elements:

[0040] Element one, input, the input of VRF includes a random seed value and a node private key of a node;

[0041] Element two, output, a pseudo-random number r, which is a random value generated based on input data and a node private key;

[0042] A proof Proof is used to ensure that the pseudo-random number is generated by the node private key and the node private key will not be exposed in the verification process;

[0043] Element three, the calculation formula for generating a pseudo-random number r by VRF is:

[0044] r=VRFeval(x,sk)

[0045] Wherein, x is the input data; sk is the node private key of the node; r is the generated pseudo-random number;

[0046] Element four, the generation of the proof Proof, a proof π is also generated by VRF to ensure the correctness of the generated pseudo-random number r;

[0047] wherein the proof π is a result of a calculation based on the input data x, the node private key sk of the node, and the generated pseudo-random number r, and the specific generation formula is:

[0048] π = VRFproof(x, sk)

[0049] The proof π is attached in the output, so that any node can verify the source of the pseudo-random number r;

[0050] Element five, given an input data x, a node public key pk of a node, and a proof π, by verifying the proof π to check whether the generated pseudo-random number r is valid, and whether it is indeed generated by the node private key sk of the node, wherein the calculation formula of the verification function is:

[0051] VRF1verify(x, pk, r, π) = true if and only if r = VRFeval(x, sk)

[0052] Wherein the verification function returns a Boolean value, if true, it means that the proof is valid, and the generated pseudo-random number r is indeed generated by the node private key sk of the node; if false, it means that the generated pseudo-random number r is tampered with or generated with the wrong private key.

[0053] According to another aspect of the present application, a non-volatile storage medium is also provided, which stores computer readable instructions, and the computer readable instructions can be executed by a processor to enable the processor to implement the implementation method of the above-mentioned decentralized Sequencer-based Optimistic Rollup architecture.

[0054] According to another aspect of the present application, a device for implementing a decentralized Sequencer-based Optimistic Rollup architecture is also provided, wherein the device comprises:

[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 above-mentioned decentralized Sequencer-based Optimistic Rollup architecture.

[0058] Compared with the prior art, all transactions are submitted to Layer 2 by a user, and the transactions are propagated to all nodes in the blockchain network through broadcasting; when a target node in the blockchain network obtains the block right, the target node generates a random number Randomness according to a parent block and a 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; all selected transactions are executed according to the sorting order to generate an execution receipt, the execution receipt including the execution result of each transaction in the selected transactions; the execution receipt is packaged and submitted to the main chain, so that other nodes in the blockchain network verify the challenge according to the submitted transactions and the corresponding execution receipt. Through the decentralized Sequencer architecture, the consistency of the transaction order is ensured, and the transaction selection is used to prevent the node from intentionally selecting the transaction job, so that each transaction can provide a verifiable proof, and the trust problem and single point failure risk are eliminated in a decentralized manner. BRIEF DESCRIPTION OF DRAWINGS

[0059] Other features, objects, and advantages of the application will become more apparent from the following detailed description of non-limiting embodiments made with reference to the drawings:

[0060] Figure 1 A flowchart showing an implementation method of a decentralized Sequencer-based Optimistic Rollup architecture according to an aspect of the application is shown.

[0061] The same or similar reference signs in the drawings represent the same or similar components. DETAILED DESCRIPTION

[0062] The application will be further described in detail below with reference to the drawings.

[0063] In a typical configuration of the application, the terminal, the device of the service network and the trusted party each include one or more processors (CPU), input / output interfaces, network interfaces and memories.

[0064] The memory can include a non-permanent memory in a computer readable medium, random access memory (RAM) and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer readable medium.

[0065] Computer-readable media includes 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 disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carriers.

[0066] As shown in Figure 1 Figure 1 A flowchart of an implementation method of a decentralized Sequencer-based Optimistic Rollup architecture is proposed as an aspect of the present application. The method can be implemented using a blockchain-based programming language, such as Solidity (for implementation of smart contracts), Rust or Go (for implementation of nodes and validators), etc. The hardware requirements include high-performance computer nodes to support the operation of the decentralized Sequencer, ensuring the efficiency and reliability of transaction ordering. The method constructs an admission-free, decentralized Rollup implementation through off-chain randomness and transaction selection mechanism. The method includes steps S11, S12, S13, S14 and S15, specifically including the following steps:

[0067] Step S11, the user submits all transactions to the Layer2 network and broadcasts the transactions to all nodes in the blockchain network, not only realizing the submission of transactions, but also completing the broadcast of transactions.

[0068] Step S12, when a target node in the blockchain network obtains the block right (such as through POS or other consensus, etc.), 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 ordering. Here, the target node is any node in the blockchain network.

[0069] ​Step S13, the target node selects and orders the transactions according to the random number Randomness and the hash value of each transaction.

[0070] Step S14, execute all selected transactions in the order, and generate an execution receipt including the execution result of each transaction in the selected transactions.

[0071] In step S14, the selected transactions are executed in order and an execution receipt (ER) is generated, which records the transactions and their execution results, including but not limited to state changes, fees, etc.

[0072] Step S15, package and submit the execution receipt to the main chain, so that other nodes in the blockchain network can verify the challenge according to the submitted transaction and its corresponding execution receipt.5.

[0073] Rollup packaging submission

[0074] In step S15, the execution receipt ER will be packaged and submitted and the final state will be submitted to the main chain, at which point the transaction result is already determined and fraud proof Fraud Proof verification can begin. In the challenge verification phase of the fraud proof, other nodes in the blockchain network verify the challenge according to the submitted transaction and the execution receipt corresponding to the transaction. The challenge verification includes the following steps:

[0075] Challenge randomness generation (Challenge Randomness);

[0076] Challenge transaction selection (Challenge Transaction Selection);

[0077] Challenge transaction execution result (Challenge Execution Receipt).

[0078] Wherein, the challenger proves that the execution or selection of a certain transaction is wrong by providing Fraud Proof, and the challenge and Fraud proof are not the focus of the present application, and will not be described in detail here.

[0079] Through the above steps S11 to S15, the transaction ordering is generated by using the architecture of the decentralized Sequencer to ensure the consistency of the transaction order, and by combining the random number Randomness, the hash value of the transaction and the node ID, the transaction is selected to prevent node fraud.

[0080] Next, the above embodiment of the present application, the step S12 target node according to the parent block and the node private key of the target node, generate random number Randomness, specifically including:

[0081] First, each target node in the blockchain network according to the parent block (ParentBlock) and the node private key (NodePrivateKey) of the target node generates a hash seed;

[0082] Then, the random number Randomness is generated by the verifiable delay function VRF algorithm, and the random number Randomness is used for the seed of transaction sorting;

[0083] Wherein, the calculation formula of generating random number Randomness is:

[0084] Randomness = VRF (NodePrivateKey, ParentBlock)

[0085] Wherein, VRF() is a 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 block and random number.

[0088] Next, the above embodiment of the present application, the step S13 target node according to the random number Randomness and the hash value of each transaction, the transaction is selected and sorted, specifically including:

[0089] For each transaction T and random number Randomness, first, the hash value of each transaction is calculated, 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, and nodeID is the node ID of the target node;

[0092] Then, select the transaction within the range of the distance from all the transactions submitted by the user, and sort them;

[0093] Wherein, the calculation formula for sorting the selected transactions in the distance range is:

[0094] SelectedTransaction i = Distance(Transaction i , nodeID) ∈ [0, TxRange]

[0095] Wherein, SelectedTransaction i represents the order of the selected transaction Transaction i , and [0, TxRange] represents the preset range.

[0096] Here, the order of the transaction is determined by the node using the random number Randomness and the hash value of each transaction, and the transaction with the calculated distance in the preset range [0, TxRange] is selected, realizing the selection and sorting of the transaction.

[0097] Next, the above embodiment of the present application, the method further comprises:

[0098] If the challenge verification of other nodes in the blockchain network is successful, it indicates that the target node is malicious, and the target node is punished for the transaction; the transaction punishment includes but is not limited to penalty fine or revocation of transaction, etc.;

[0099] If the challenge verification of other nodes in the blockchain network fails, the transaction submitted by the target node and its execution receipt continue to maintain validity.

[0100] Next, the above embodiment of the present application, the method further comprises:

[0101] If the target node in the blockchain network is malicious in one or more of the following situations: generating transaction order, selecting transaction and executing receipt, the other nodes in the blockchain network submit challenge verification through fraud proof Fraud Proofs, the target node will be punished economically, and the preset proportion of the economic punishment corresponds to the punishment, and the node that successfully challenges the verification is rewarded. Of course, there is also a reward distribution system in the blockchain network, for example, the block node will get the reward of Rollup batch, so as to realize the reward and punishment of the node.

[0102] Next, the above embodiment of the present application, the method further comprises:

[0103] A pseudo-random number r is generated by a verifiable random function VRF, and a proof is provided to enable any node to verify that the pseudo-random number r is generated by an input and a key, wherein the verifiable random function (VRF) is an encryption function capable of generating a pseudo-random number and providing a proof to enable anyone to 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 one, input, the input of VRF includes a random seed value and a node private key of a node and the like data; wherein the 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 two, output, a pseudo-random number r is a random value generated based on the input data and the node private key;

[0106] A proof Proof is used to ensure that the pseudo-random number is generated by the node private key, and the node private key is not exposed in the verification process;

[0107] Element three, the calculation formula for generating a pseudo-random number r by VRF is:

[0108] r=VRFeval(x,sk)

[0109] Wherein x is the input data; sk is the node private key of the node; r is the generated pseudo-random number;

[0110] Element four, the generation of the proof Proof, a proof π is also generated by VRF to ensure the correctness of the generated pseudo-random number r;

[0111] Wherein the proof π is a calculation result based on the input data x, the node private key sk of the node and the generated pseudo-random number r, and the specific generation formula is:

[0112] π=VRFproof(x,sk)

[0113] The proof π is attached in the output, so that any node can verify the source of the pseudo-random number r;

[0114] Element five, given an input data x, a node public key pk of a node and a proof π, the generated pseudo-random number r is checked by verifying the proof π to check whether the generated pseudo-random number r is valid and whether it is indeed generated by the node private key sk of the node, wherein the calculation formula of the verification function is:

[0115] VRFverify(x, pkx, r, π) = true if and only if r = VRFeval(x, sk)

[0116] wherein the verification function returns a Boolean value, if true, it means that the proof is valid, and the generated pseudo-random number r is indeed generated by the node private key sk of the node; if false, it means that the generated pseudo-random number r is tampered or generated using the wrong private key.

[0117] According to another aspect of the present application, a non-volatile storage medium is also provided, which stores computer readable instructions, the computer readable instructions can be executed by a processor to enable the processor to implement the implementation method of the decentralized Sequencer-based Optimistic Rollup architecture as described above.

[0118] According to another aspect of the present application, an implementation device of the decentralized Sequencer-based Optimistic Rollup architecture is also provided, wherein the device comprises:

[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 decentralized Sequencer-based Optimistic Rollup architecture as described above.

[0122] Here, the detailed contents of each embodiment of the implementation device of the decentralized Sequencer-based Optimistic Rollup architecture can be referred to the corresponding part of the implementation method of the decentralized Sequencer-based Optimistic Rollup architecture as described above, and will not be repeated here.

[0123] In the embodiments of the present application, the purpose is to provide a decentralized Sequencer architecture, which guarantees the consistency of transaction order, prevents nodes from deliberately selecting transaction jobs through transaction selection, ensures that each transaction can provide verifiable fraud proofs, and eliminates trust problems and single point failure risks in a decentralized manner. The specific technical effects include the following points:

[0124] Prevent malicious nodes: The decentralized Sequencer ensures the fairness of transaction ordering, preventing nodes from intentionally selecting or not selecting certain transactions.

[0125] Uniform transaction order: Ensure that all participants see the same transaction order, facilitating subsequent Fraud Proofs verification.

[0126] High reliability and security: Decentralized design eliminates single point of failure risk, improving system stability and security.

[0127] In summary, the present application submits all transactions to Layer2 by the user, and broadcasts the transactions to all nodes in the blockchain network. When a target node in the blockchain network obtains the block right, the target node generates a random number Randomness based on the parent block and the node private key of the target node. The target node selects and orders the transactions based on the random number Randomness and the hash value of each transaction. All selected transactions are executed in order, generating an execution receipt that includes the execution result of each transaction in the 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 transactions and their corresponding execution receipts. Through the decentralized Sequencer architecture, the consistency of transaction order is guaranteed, and the selection of transactions prevents nodes from intentionally selecting transactions, ensuring that each transaction can provide verifiable proof, and eliminating trust issues and single point of failure risk through decentralization.

[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 related data structures) can be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or soft disk and similar devices. In addition, some steps or functions of the present application can be implemented using hardware, such as circuitry cooperating with the processor to perform various steps or functions.

[0129] In addition, part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present application can be invoked or provided. The program instructions invoking the method of the present application can 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 the computer device running according to the program instructions. Here, according to an embodiment of the present application includes an apparatus comprising a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, the apparatus is triggered to run the method and / or technical solutions based on the foregoing according to the plurality of embodiments of 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 can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Therefore, the embodiments should be regarded as exemplary and non-limiting, and the scope of the present application is defined by the appended claims rather than the above description, and 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 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. The plurality of 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, not any specific order.

Claims

1. An implementation method of an OptimisticRollup architecture based on a decentralized Sequencer, wherein, The method includes: Users submit all transactions to Layer 2 and broadcast them to all nodes in the blockchain network. When a target node in the blockchain network obtains the right to produce a block, the target node generates a random number Randomness based on the parent block and the target node's private key. Calculate the hash value of each transaction, and then calculate the distance between the hash value of each transaction and the node ID of the target node. The formula for calculating the distance is as follows: Distance(T, nodeID)=|Hash(T, Randomness)-Hash(nodeID, Randomness)| Where T is the current transaction and nodeID is the node ID of the target node; Select transactions within the specified distance from all submitted transactions and sort them. The formula for sorting transactions within the selected distance range is as follows: SelectedTransaction i =Distance(Transaction i ,nodeID)∈[0,TxRange] Among them, SelectedTransaction i Indicates the selected transaction. i The sorting is [0, TxRange], which represents the preset range; Execute all selected transactions in the sorted order and generate an execution receipt, which includes the execution result of each of the selected transactions. The execution receipts are packaged and submitted to the main chain so that other nodes in the blockchain network can perform challenge verification based on the submitted transactions and their corresponding execution receipts.

2. The method according to claim 1, wherein, The target node generates a random number, Randomness, based on the parent block and the target node's private key, including: The target node generates a hash seed based on the parent block and the target node's private key; Randomness is generated using the Verifiable Delay Function (VRF) algorithm and is used as a seed for transaction sorting. The formula for calculating the randomness of the generated random number is as follows: Randomness=VRF(NodePrivateKey,ParentBlock) Where VRF() is a verifiable delay function. NodePrivateKey is the private key of the target node. ParentBlock is the hash of the parent block of the target node.

3. The method according to claim 1, wherein, The method further includes: If other nodes in the blockchain network successfully challenge and verify the data, the target node is instructed to act maliciously, and the target node is penalized for transactions. If other nodes in the blockchain network fail to challenge the verification, the transaction submitted by the target node and its execution receipt remain effective.

4. The method according to claim 3, wherein, The method further includes: If the target node in the blockchain network acts maliciously in one or more of the following situations: generating transaction order, selecting transactions, and executing receipts, other nodes in the blockchain network submit a challenge verification through fraudulent proofs (Fraud Proofs). The malicious target node will be subject to economic penalties, and a predetermined proportion of the penalty will be awarded to the node that successfully completes the challenge verification.

5. The method according to any one of claims 1 to 4, wherein, The method further includes: A pseudo-random number r is generated using a verifiable random function (VRF), and proof is provided so that any node can verify that the pseudo-random number r was generated from the input and the key. The working principle of the verifiable random function (VRF) includes the following elements: Element 1: Input. The input to VRF includes a random seed value and a node's private key. Element 2, the output, is a pseudo-random number r, which is a random value generated based on the input data and the node's private key; A proof is provided to ensure that the pseudo-random number is generated by the node's private key and that the node's private key is not exposed during the verification process; Element 3: The formula for calculating a pseudo-random number r generated by VRF is as follows: r = VRFeval(x, sk) Where x is the input data; sk is the node's private key; and r is the generated pseudo-random number; Element 4: Proof generation. A proof π is also generated through VRF to ensure the correctness of the generated pseudo-random number r. The proof of π is based on the input data x, the node's private key sk, and the generated pseudo-random number r. The specific generation formula is as follows: π = VRFproof(x, sk) The proof π is appended 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 was indeed generated by the node's private key sk. The formula for calculating the verification function is: VRFverify(x,pk,r,π)=true if and only if r=VRFeval(x,sk) 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.

6. A non-volatile storage medium having stored computer-readable instructions thereon, which, when executed by a processor, cause the processor to perform the method as described in any one of claims 1 to 5.

7. An implementation device based on a decentralized Sequencer and an OptimisticRollup architecture, wherein, The device includes: One or more processors; 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 as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Decentralized Roollup sequencer construction method

    CN119313346A

  • Random number generation method, blockchain node, system and medium

    WO2021093244A1