Block chain transaction processing method and system for solving mobility splitting

By introducing Layer1 and Layer2 nodes into the blockchain system and realizing state data sharing, the MEV and single point of failure problems of Layer2 layer, as well as the data isolation problem between Layer1 and Layer2, improving the user experience.

CN120013667AActive Publication Date: 2025-05-16SHANGHAI NUOWA LINGKE TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510103212.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-05-16
Estimated Expiration
2045-01-22

AI Technical Summary

Technical Problem

In the existing blockchain system, Layer2 has MEV and single point failure problems, and at the same time, there is data isolation between Layer1 and Layer2, resulting in poor user experience.

Method used

By introducing Layer1 and Layer2 nodes into the blockchain system, the smart contract is deployed on the Layer1 node, and the state data set of the Layer2 node is a superset of the state data set of the Layer1 node. The Layer2 node obtains the to-process blockchain transactions and sends them to the Layer1 node for sorting. The Layer2 node executes the transaction based on the sorting results and updates the status data of the Layer1 and Layer2 nodes based on the execution status information.

Benefits of technology

It avoids the MEV and single point failure problems of the Layer2 sorter, and at the same time realizes the status data sharing between Layer1 and Layer2, solves the data isolation problem and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013667A_ABST
    Figure CN120013667A_ABST
Patent Text Reader

Abstract

The invention provides a block chain transaction processing method and system for solving mobility splitting, the scheme is applied to a block chain system composed of a Layer1 node and a Layer2 node, during transaction processing, sorting is not performed by a Layer2 sorter any more, but is performed by a decentralized Layer1 node, so that MEV cannot be realized, and the problem of single-point fault is avoided. Meanwhile, the intelligent contract in the scheme is deployed in the Layer1 node, and the state data set of the Layer2 node is a superset of the state data set of the Layer1 node, so that the Layer2 node has full-amount state data, the execution of the Layer2 type transaction content does not influence the state data change of the Layer1, and the Layer2 type transaction content is more accurate. The state data change of the Layer1 can be reflected in the state data set of the Layer1 and the Layer2 in real time, so that a safe and convenient state data sharing mode is provided, and data isolation between the Layer2 and the Layer1 is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information technology, and in particular to a blockchain transaction processing method and system for solving liquidity fragmentation. Background Art

[0002] The "impossible triangle" in blockchain refers to the difficulty in simultaneously achieving the three key characteristics of decentralization, security, and scalability in the design of blockchain systems.

[0003] In order to solve this problem, we can introduce a two-layer blockchain system based on a single-layer blockchain system. The first-layer blockchain system is Layer1, which can be called the basic blockchain or main chain, and is the core layer of blockchain technology. It is responsible for handling basic transactions in the blockchain network, such as the final settlement of transactions, data storage, consensus mechanism, etc. Layer1 is highly decentralized and has no single control point. It provides high security through consensus mechanisms (such as proof of work PoW or proof of stake PoS), thereby ensuring the centralization and security of the blockchain. The second-layer blockchain system is Layer2, which can be called the extension layer. It is an additional protocol or solution built on the basis of Layer1. Its main goal is to improve the scalability of Layer1 while maintaining the security and decentralization of Layer1, thereby solving the impossible triangle problem of the blockchain system.

[0004] However, the current blockchain solution composed of Layer1 and Layer2 still has the following problems. First, after the user sends the transaction to the Layer2 blockchain network, the Layer2 blockchain network will sort and package the transactions through a centralized sequencer, and then execute these transactions based on the sorting results. In this process, since the operator of the Layer2 Sequencer can easily achieve MEV (Maximal Extractable Value) when sorting transactions, it can also review each transaction and control which transactions can be put on the chain. At the same time, because it is a centralized operation, there will also be a single point of failure problem. In addition, if a DApp (Decentralized Application) wants to be available to users of different blockchains, the smart contract of this DApp must be deployed on different blockchains. The state data of the smart contract is also completely isolated, and it is impossible to share data and the code logic of the smart contract. This will lead to data isolation between Layer2 and Layer1, resulting in a poor user experience. Summary of the invention

[0005] One purpose of the present application is to provide a blockchain transaction processing method and system for solving liquidity fragmentation, so as to solve the problems of MEV and single point failure in Layer 2 and data isolation between Layer 1 and Layer 2 in the prior art.

[0006] To achieve the above purpose, the embodiment of the present application provides a blockchain transaction processing method for solving liquidity fragmentation. The method is applied to a blockchain system composed of Layer 1 nodes and Layer 2 nodes, and the smart contract is deployed in the Layer 1 node. The state data set of the Layer 2 node is a superset of the state data set of the Layer 1 node. The method includes:

[0007] The Layer2 node obtains the pending blockchain transactions and sends them to the Layer1 node, which sorts the pending blockchain transactions.

[0008] The Layer 2 node executes the blockchain transaction in sequence according to the sorting result; wherein executing the blockchain transaction includes:

[0009] The Layer2 node determines the execution type of the transaction content in the blockchain transaction, where the execution type includes a Layer1 type and a Layer2 type;

[0010] For the transaction content of Layer 1 type, the Layer 2 node executes the transaction content of Layer 1 type in the blockchain transaction according to the status data about the Layer 1 node in the Layer 2 node, and updates the status data of the Layer 1 node and the Layer 2 node at the same time according to the status information after execution;

[0011] For Layer2 type transaction content, the Layer2 node executes the Layer2 type transaction content in the blockchain transaction according to the status data about the Layer2 node in the Layer2 node, and the status data of the Layer2 node according to the status information after execution.

[0012] Furthermore, the Layer2 node obtains the pending blockchain transactions and sends them to the Layer1 node, which sorts the pending blockchain transactions, including:

[0013] The Layer2 node obtains the blockchain transactions to be processed, packages the blockchain transactions to be processed and sends them to the Layer1 node, so that the Layer1 node sorts the blockchain transactions to be processed according to the packaged data, and sends the sorting results to the Layer2 node.

[0014] Furthermore, before the Layer2 node executes the blockchain transactions in sequence according to the sorting results, it also includes:

[0015] Predefine the functions of smart contracts executed in Layer 2;

[0016] The Layer2 node determines the execution type of the blockchain transaction, including:

[0017] The Layer2 node determines the execution type of the blockchain transaction according to a predefined function of the smart contract executed on Layer2.

[0018] Furthermore, the blockchain transaction includes Layer 1 transactions and hybrid transactions, wherein the Layer 1 transaction is a blockchain transaction that only contains Layer 1 type transaction content, and the hybrid transaction is a blockchain transaction that contains both Layer 1 type transaction content and Layer 2 type transaction content.

[0019] Furthermore, the Layer2 node determines the execution type of the transaction content in the blockchain transaction and executes the transaction content in the blockchain transaction through a pre-compiled contract method.

[0020] Furthermore, the Layer2 node executes the transaction content in the blockchain transaction through a pre-compiled contract method, including:

[0021] For Layer1 type transaction content, the Layer2 node calls the Layer2 node through the Layer1 calling method, using the status data about the Layer1 node as the context of the method, executes the Layer1 type transaction content in the blockchain transaction, and updates the status data of the Layer1 node and the Layer2 node at the same time according to the status information after execution.

[0022] Furthermore, the Layer 2 node executes the transaction content in the blockchain transaction through a pre-compiled contract method, including:

[0023] For Layer2 type transaction content, the Layer2 node calls the status data about the Layer2 node in the Layer2 node through the Layer2 calling method as the context of the method, executes the Layer2 type transaction content in the blockchain transaction, and updates the status data of the Layer2 node according to the status information after execution.

[0024] Furthermore, the Layer2 node includes two status databases, which are respectively used to store status data of Layer1 type transaction content and status data of Layer2 type transaction content.

[0025] The embodiment of the present application also provides a blockchain system for solving liquidity fragmentation, the system includes a Layer 1 node and a Layer 2 node, the smart contract is deployed in the Layer 1 node, and the state data set of the Layer 2 node is a superset of the state data set of the Layer 1 node;

[0026] The Layer2 node is used to obtain the blockchain transaction to be processed and send the blockchain transaction to be processed to the Layer1 node. The Layer2 node executes the blockchain transaction in sequence according to the result of the Layer1 node sorting the blockchain transactions to be processed; wherein, executing the blockchain transaction includes: the Layer2 node determines the execution type of the transaction content in the blockchain transaction, and the execution type includes the Layer1 type and the Layer2 type; for the transaction content of the Layer1 type, the Layer2 node executes the transaction content of the Layer1 type in the blockchain transaction according to the status data of the Layer1 node in the Layer2 node, and updates the status data of the Layer1 node and the Layer2 node at the same time according to the status information after execution; for the transaction content of the Layer2 type, the Layer2 node executes the transaction content of the Layer2 type in the blockchain transaction according to the status data of the Layer2 node in the Layer2 node, and updates the status data of the Layer2 node according to the status information after execution;

[0027] The Layer 1 node is used to sort the blockchain transactions to be processed.

[0028] An embodiment of the present application also provides a computer-readable medium on which computer program instructions are stored, and the computer program instructions can be executed by a processor to implement the blockchain transaction processing method for solving liquidity fragmentation.

[0029] The embodiment of the present application provides a blockchain transaction processing solution for solving liquidity fragmentation. The solution is applied to a blockchain system composed of Layer 1 nodes and Layer 2 nodes. When processing transactions, the Layer 2 node can obtain the blockchain transactions to be processed and send the blockchain transactions to be processed to the Layer 1 node. The Layer 1 node sorts the blockchain transactions to be processed, and then the Layer 2 node executes the blockchain transactions in sequence according to the sorting results. Since the sorting is no longer performed by the Layer 2 sorter but by the decentralized Layer 1 node, MEV cannot be achieved and the problem of single point failure is avoided.

[0030] At the same time, the smart contract in this solution is deployed in the Layer1 node, and the state data set of the Layer2 node is a superset of the state data set of the Layer1 node. When executing the blockchain transaction, the Layer2 node first determines the execution type of the transaction content in the blockchain transaction. For the Layer1 type of transaction content, the Layer1 type of transaction content in the blockchain transaction is executed according to the state data about the Layer1 node in the Layer2 node, and the state data of the Layer1 node and the Layer2 node are simultaneously updated according to the state information after execution; and for the Layer2 type of transaction content, the Layer2 type of transaction content in the blockchain transaction is executed according to the state data about the Layer2 node in the Layer2 node, and the state data of the Layer2 node is updated according to the state information after execution. In this way, the Layer2 node has a full amount of state data, and the execution of the Layer2 type of transaction content will not affect the change of the state data of Layer1. The change of the state data of Layer1 will be reflected in the state data sets of Layer1 and Layer2 in real time, thereby providing a safe and convenient way to share state data and avoid data isolation between Layer2 and Layer1. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] 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:

[0032] Figure 1 A flowchart of a blockchain transaction processing method for solving liquidity fragmentation provided in an embodiment of the present application;

[0033] Figure 2 This is a schematic diagram of the relationship between the state data changes of Layer 1 and Layer 2 in an embodiment of the present application;

[0034] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION

[0035] The present application is described in further detail below in conjunction with the accompanying drawings.

[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0037] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0038] In a typical configuration of the present application, the terminal and the equipment of the service network each include one or more processors (CPU), input / output interface, network interface and memory.

[0039] 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.

[0040] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer program instructions, data structures, modules of programs 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, read-only compact disk (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.

[0041] The embodiment of the present application provides a blockchain transaction processing method for solving liquidity fragmentation. The method is applied to a blockchain system composed of a Layer 1 node and a Layer 2 node. When processing transactions, the Layer 2 node can obtain the blockchain transactions to be processed and send the blockchain transactions to be processed to the Layer 1 node. The Layer 1 node sorts the blockchain transactions to be processed, and then the Layer 2 node executes the blockchain transactions in sequence according to the sorting results. Since the sorting is no longer performed by the Layer 2 sorter but by the decentralized Layer 1 node, MEV cannot be achieved and the problem of single point failure is avoided.

[0042] At the same time, the smart contract in the method is deployed in the Layer1 node, and the state data set of the Layer2 node is a superset of the state data set of the Layer1 node. When executing the blockchain transaction, the Layer2 node first determines the execution type of the transaction content in the blockchain transaction. For the Layer1 type of transaction content, the Layer1 type of transaction content in the blockchain transaction is executed according to the state data about the Layer1 node in the Layer2 node, and the state data of the Layer1 node and the Layer2 node are simultaneously updated according to the state information after execution; and for the Layer2 type of transaction content, the Layer2 type of transaction content in the blockchain transaction is executed according to the state data about the Layer2 node in the Layer2 node, and the state data of the Layer2 node is updated according to the state information after execution. In this way, the Layer2 node has a full amount of state data, and the execution of the Layer2 type of transaction content will not affect the change of the state data of Layer1. The change of the state data of Layer1 will be reflected in the state data sets of Layer1 and Layer2 in real time, thereby providing a safe and convenient way to share state data and avoid data isolation between Layer2 and Layer1.

[0043] In actual scenarios, each node in the system can be various types of network devices or network devices or devices formed by integrating user devices and network devices through a network, and can also be programs running in the above devices. The user devices include but are not limited to various types of terminal devices such as personal computers, mobile phones, and tablet computers; the network devices include but are not limited to network hosts, single network servers, multiple network server sets, or cloud computing-based computer sets. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing (Cloud Computing), where cloud computing is a type of distributed computing, a virtual computer composed of a group of loosely coupled computer sets.

[0044] Figure 1A blockchain transaction processing method for solving liquidity fragmentation provided by an embodiment of the present application is shown, and the method is applied to a blockchain system composed of Layer1 nodes and Layer2 nodes. The Layer1 node in this solution represents any one or more nodes in the Layer1 blockchain network, which serves as the data availability layer and settlement layer of the blockchain system, and the Layer2 represents any one or more nodes in the Layer2 blockchain network, which serves as the execution layer of the blockchain system. The state data set of the Layer2 node is a superset of the state data set of the Layer1 node. The smart contract can be deployed on the Layer1 node, and there is no need to repeatedly deploy the same smart contract on each Layer2, because each Layer2 node itself is a superset of the Layer1 node, so it can be deployed once and all Layer2 blockchains can be executed.

[0045] In actual scenarios, the Layer2 node may include two status databases, which are used to store status data of Layer1 type transaction content and status data of Layer2 type transaction content respectively, so that the status data set of the Layer2 node can become a superset of the status data set of the Layer1 node.

[0046] The solution of this embodiment may at least include the following processing steps when processing:

[0047] Step S101, the Layer 2 node obtains the blockchain transaction to be processed and sends the blockchain transaction to be processed to the Layer 1 node.

[0048] Step S102: Layer 1 nodes sort the blockchain transactions to be processed.

[0049] In actual scenarios, the blockchain transactions to be processed will first be sent to the Layer2 node, which will obtain the blockchain transactions to be processed, package them into Bundles, and send them to the Layer1 node. After the Layer1 node obtains these packaged Bundles, the Layer1 node sorts the blockchain transactions to be processed according to the packaged data and returns the sorting results to the Layer2 node.

[0050] Step S103: The Layer 2 node executes the blockchain transactions in sequence according to the sorting results.

[0051] In this way, the blockchain transactions are sorted by the decentralized Layer1 nodes instead of the Layer2 sequencer, making it impossible for the operator of the Layer2 sequencer to sort the transactions to be processed, and therefore impossible to obtain MEV. It is also difficult to review each transaction and control which transactions can be put on the chain. Since it no longer relies on a centralized sequencer, the problem of single point failure is avoided.

[0052] Furthermore, when executing the blockchain transaction according to the sorting result, the Layer2 node may first determine the execution type of the transaction content in the blockchain transaction. In the embodiment of this solution, the execution type may include Layer1 type and Layer2 type, wherein the transaction content of Layer1 type refers to the transaction whose state data and execution logic are both in Layer1, and the transaction content of Layer2 type refers to the transaction whose state data and execution logic are both in Layer2.

[0053] Therefore, based on the above definition, the transaction types of blockchain transactions can be classified, that is, divided into at least two categories of blockchain transactions, including Layer 1 transactions and hybrid transactions. Among them, the Layer 1 transaction is a blockchain transaction that only contains Layer 1 type transaction content. The status data and execution logic of all transaction contents in this type of blockchain transaction are in Layer 1. The hybrid transaction refers to a blockchain transaction that contains both Layer 1 type transaction content and Layer 2 type transaction content. The status data and execution logic of part of the transaction content in this type of blockchain transaction are in Layer 1, while the status data and execution logic of the other part of the transaction content are in Layer 2.

[0054] In an actual scenario, before the Layer2 node sequentially executes the blockchain transaction according to the sorting result, the function of the smart contract executed in Layer2 and the stored state data can be pre-defined. For example, in the solution of this embodiment, when defining the above content, it can be implemented in the manner represented by the following pseudo code:

[0055]

[0056] Therefore, when determining the execution type of the blockchain transaction, the Layer2 node can determine the execution type of the blockchain transaction by using the pre-defined functions of the smart contract executed in Layer2 and the stored status data.

[0057] For Layer1 type transaction content, the Layer2 node executes the Layer1 type transaction content in the blockchain transaction according to the status data about the Layer1 node in the Layer2 node, and simultaneously updates the status data of the Layer1 node and the Layer2 node according to the status information after execution.

[0058] As for the Layer2 type of transaction content, the Layer2 node executes the Layer2 type of transaction content in the blockchain transaction according to the status data about the Layer2 node in the Layer2 node, and the status data of the Layer2 node according to the status information after execution.

[0059] For example, the above judgment and execution processing logic can be implemented in the manner represented by the following pseudo code:

[0060]

[0061]

[0062] In this way, the Layer2 node can have full state data. The execution of Layer2 type transaction content will not affect the state data changes of Layer1. The state data changes of Layer1 will be reflected in the state data sets of Layer1 and Layer2 in real time, thereby providing a safe and convenient way to share state data and avoid data isolation between Layer2 and Layer1.

[0063] Among them, the Layer2 node determines the execution type of the transaction content in the blockchain transaction and executes the transaction content in the blockchain transaction through the precompiled contract method. For example, Layer2Call, Layer1DelegateCall and Layer1Call in the above pseudo code are precompiled contract methods used to implement corresponding functions. In actual scenarios, the nodes of the Layer1 blockchain can also implement these three precompiled contract methods. If in actual scenarios, the Layer1 blockchain does not implement these precompiled pre-contract methods, they can be simulated and implemented through smart contracts.

[0064] In some embodiments of the present application, when the Layer2 node executes the transaction content in the blockchain transaction through the precompiled contract method, for the Layer1 type transaction content, the Layer2 node calls the status data about the Layer1 node in the Layer2 node through the Layer1 calling method as the context of the method, executes the Layer1 type transaction content in the blockchain transaction, and simultaneously updates the status data of the Layer1 node and the Layer2 node according to the status information after execution.

[0065] For example, in the actual scenario, among the several precompiled contract methods mentioned in the pseudocode above, the Layer1Call method calls the state data of Layer1 as the context of the method, executes the corresponding transaction content, and updates the state data in Layer1 according to the state information after execution. The Layer1DelegateCall method also calls the state of Layer1 as the context of the method, but does not store the state information after execution to update the state data of Layer1, but directly discards it. The Layer2Call method calls the state data of Layer2 as the context of the method, executes the corresponding transaction content, and updates the state data in Layer2 according to the state information after execution. Therefore, through the above precompiled contract method, the Layer2 node can have the full amount of state data, and the execution of Layer2 type transaction content will not affect the change of Layer1 state data. The change of Layer1 state data will be reflected in the state data set of Layer1 and Layer2 in real time, thereby providing a safe and convenient way to share state data and avoid data isolation between Layer2 and Layer1.

[0066] by Figure 2 For example, the change process of the above state data is explained. For the Layer1 blockchain, the state data corresponding to the current block L1 Block H is State X. At this time, the state data corresponding to the current block L2 Block H of the Layer2 blockchain is L2 State T. The state data L2 State T is a superset of the state data State X, that is, the state data L2State T includes all the contents in the state data State X.

[0067] After the Layer2 type of transaction content is executed, the Layer2 blockchain generates a new block L2 Block H+1, and the state data L2 State T of the Layer2 blockchain will change to the state data L2State T+1, but the state data State X of the Layer1 blockchain will not change, that is, it will not affect the state data StateX of Layer1.

[0068] After that, when the Layer1 type transaction content is executed, the Layer1 blockchain generates a new block L1Block H+1, and the state data State X of the Layer1 blockchain will change to the state data State X+1. This change will also be synchronously reflected in the state data set of the Layer2 blockchain, so that the state data of the Layer2 blockchain will change from L2 State T+1 to L2 State T+2. At the same time, the Layer2 blockchain will also generate a new block L2 Block H+2.

[0069] Therefore, through the above method, Layer2 can access Layer1 data in a convenient and secure way, bringing good user experience and security to developers, and effectively solving the problem of data isolation between Layer2 and Layer1.

[0070] An embodiment of the present application also provides a blockchain system for solving liquidity fragmentation, wherein the system includes a Layer 1 node and a Layer 2 node, the smart contract is deployed in the Layer 1 node, and the state data set of the Layer 2 node is a superset of the state data set of the Layer 1 node.

[0071] The Layer2 node is used to obtain the blockchain transactions to be processed, and send the blockchain transactions to be processed to the Layer1 node. The Layer2 node executes the blockchain transactions in sequence according to the result of the Layer1 node sorting the blockchain transactions to be processed; wherein, executing the blockchain transaction includes: the Layer2 node determines the execution type of the transaction content in the blockchain transaction, and the execution type includes the Layer1 type and the Layer2 type; for the transaction content of the Layer1 type, the Layer2 node executes the transaction content of the Layer1 type in the blockchain transaction according to the status data of the Layer1 node in the Layer2 node, and updates the status data of the Layer1 node and the Layer2 node at the same time according to the status information after execution; for the transaction content of the Layer2 type, the Layer2 node executes the transaction content of the Layer2 type in the blockchain transaction according to the status data of the Layer2 node in the Layer2 node, and updates the status data of the Layer2 node according to the status information after execution;

[0072] The Layer 1 node is used to sort the blockchain transactions to be processed.

[0073] In addition, an embodiment of the present application provides another blockchain system for solving liquidity fragmentation. The system may include a memory for storing computer program instructions and a processor for executing computer program instructions, wherein when the computer program instructions are executed by the processor, the device is triggered to implement the methods and / or technical solutions of the aforementioned multiple embodiments of the present application.

[0074] In particular, the methods and / or embodiments in the embodiments of the present application may be implemented as computer software programs. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. When the computer program is executed by the processing unit, the above functions defined in the method of the present application are executed.

[0075] It should be noted that the computer-readable medium described in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0076] In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0077] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0078] The flow chart or block diagram in the accompanying drawings shows the possible architecture, function and operation of the equipment, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0079] As another aspect, the present application further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more computer program instructions, which may be executed by a processor to implement the methods and / or technical solutions of the above multiple embodiments of the present application.

[0080] 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 certain embodiments, the software program of the present application can be executed by a processor to implement the above steps or functions. Similarly, the software program of the present application (including related 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.

[0081] 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 the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, no matter from which 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 represent names, and do not represent any specific order. The numerical order of the serial numbers corresponding to the steps does not represent any specific execution order, and each step can be executed in any order combination under the premise of conforming to the execution logic.

Claims

1. A blockchain transaction processing method for solving liquidity fragmentation, characterized in that: The method is applied to a blockchain system composed of a Layer 1 node and a Layer 2 node, wherein a smart contract is deployed in the Layer 1 node, and a state data set of the Layer 2 node is a superset of a state data set of the Layer 1 node. The method includes: The Layer2 node obtains the pending blockchain transactions and sends them to the Layer1 node, which sorts the pending blockchain transactions. The Layer 2 node executes the blockchain transaction in sequence according to the sorting result; wherein executing the blockchain transaction includes: The Layer2 node determines the execution type of the transaction content in the blockchain transaction, where the execution type includes a Layer1 type and a Layer2 type; For the transaction content of Layer 1 type, the Layer 2 node executes the transaction content of Layer 1 type in the blockchain transaction according to the status data about the Layer 1 node in the Layer 2 node, and updates the status data of the Layer 1 node and the Layer 2 node at the same time according to the status information after execution; For Layer2 type transaction content, the Layer2 node executes the Layer2 type transaction content in the blockchain transaction according to the status data about the Layer2 node in the Layer2 node, and the status data of the Layer2 node according to the status information after execution.

2. The method according to claim 1, characterized in that The Layer2 node obtains the pending blockchain transactions and sends them to the Layer1 node, which sorts the pending blockchain transactions, including: The Layer2 node obtains the blockchain transactions to be processed, packages the blockchain transactions to be processed and sends them to the Layer1 node, so that the Layer1 node sorts the blockchain transactions to be processed according to the packaged data, and sends the sorting results to the Layer2 node.

3. The method according to claim 1, characterized in that Before the Layer2 node executes the blockchain transactions in sequence according to the sorting results, the method further includes: Predefine the functions of smart contracts executed in Layer 2; The Layer2 node determines the execution type of the blockchain transaction, including: The Layer2 node determines the execution type of the blockchain transaction according to a predefined function of the smart contract executed on Layer2.

4. The method according to claim 1, characterized in that: The blockchain transaction includes Layer 1 transactions and hybrid transactions, wherein the Layer 1 transaction is a blockchain transaction that only contains Layer 1 type transaction content, and the hybrid transaction is a blockchain transaction that contains both Layer 1 type transaction content and Layer 2 type transaction content.

5. The method according to claim 1, characterized in that The Layer2 node determines the execution type of the transaction content in the blockchain transaction and executes the transaction content in the blockchain transaction through a precompiled contract method.

6. The method according to claim 5, characterized in that The Layer2 node executes the transaction content in the blockchain transaction through a pre-compiled contract method, including: For Layer1 type transaction content, the Layer2 node calls the Layer2 node through the Layer1 calling method, using the status data about the Layer1 node as the context of the method, executes the Layer1 type transaction content in the blockchain transaction, and updates the status data of the Layer1 node and the Layer2 node at the same time according to the status information after execution.

7. The method according to claim 5, characterized in that The Layer2 node executes the transaction content in the blockchain transaction through a pre-compiled contract method, including: For Layer2 type transaction content, the Layer2 node calls the status data about the Layer2 node in the Layer2 node through the Layer2 calling method as the context of the method, executes the Layer2 type transaction content in the blockchain transaction, and updates the status data of the Layer2 node according to the status information after execution.

8. The method according to claim 1, characterized in that The Layer2 node includes two status databases, which are respectively used to store status data of Layer1 type transaction content and status data of Layer2 type transaction content.

9. A blockchain system for solving liquidity fragmentation, characterized in that: The system includes a Layer 1 node and a Layer 2 node, the smart contract is deployed in the Layer 1 node, and the state data set of the Layer 2 node is a superset of the state data set of the Layer 1 node; The Layer2 node is used to obtain the blockchain transaction to be processed and send the blockchain transaction to be processed to the Layer1 node. The Layer2 node executes the blockchain transaction in sequence according to the result of the Layer1 node sorting the blockchain transactions to be processed; wherein, executing the blockchain transaction includes: the Layer2 node determines the execution type of the transaction content in the blockchain transaction, and the execution type includes the Layer1 type and the Layer2 type; for the transaction content of the Layer1 type, the Layer2 node executes the transaction content of the Layer1 type in the blockchain transaction according to the status data of the Layer1 node in the Layer2 node, and updates the status data of the Layer1 node and the Layer2 node at the same time according to the status information after execution; for the transaction content of the Layer2 type, the Layer2 node executes the transaction content of the Layer2 type in the blockchain transaction according to the status data of the Layer2 node in the Layer2 node, and updates the status data of the Layer2 node according to the status information after execution; The Layer 1 node is used to sort the blockchain transactions to be processed.

10. A computer readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Product information block chain transaction storage method, server and readable medium

    CN114297304A

  • Transaction packaging method, sequencer, block chain node, two-layer network and main network

    CN118138243A

  • Data processing method and device of block chain system and block chain system

    CN119341725A

  • Data synchronization method and system based on blockchain, and related device

    US20240232223A1

  • Data processing method and apparatus based on blockchain, and device and medium

    WO2024244249A1