Blockchain transaction processing method and system for resolving liquidity fragmentation

By deploying smart contracts in Layer2 nodes and utilizing decentralized Layer1 nodes to sort and execute blockchain transactions, the MEV and single point of failure issues in blockchain systems are resolved, enabling secure sharing of state data between Layer1 and Layer2 and improving the user experience.

CN120013667BActive Publication Date: 2026-01-02SHANGHAI KUNYAO NETWORK SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing blockchain systems suffer from MEV and single point of failure issues, as well as data isolation between Layer 1 and Layer 2, resulting in a poor user experience.

Method used

Deploy smart contracts in Layer2 nodes and send pending blockchain transactions to decentralized Layer1 nodes for sorting and execution. Layer2 nodes execute Layer1 type transactions based on the state data of Layer1 nodes and execute Layer2 type transactions based on the state data of Layer2 nodes, ensuring that the state data set of Layer2 nodes is a superset of the state data set of Layer1 nodes.

Benefits of technology

It avoids the MEV behavior of Layer2's sorter, solves the single point of failure problem, and enables secure and convenient sharing of state data between Layer1 and Layer2, thus improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013667B_ABST
    Figure CN120013667B_ABST
Patent Text Reader

Abstract

The application provides a blockchain transaction processing method and system for solving liquidity fragmentation. The scheme is applied to a blockchain system composed of Layer1 nodes and Layer2 nodes. When performing transaction processing, the Layer2 sequencer no longer performs sequencing, but is handed over to a decentralized Layer1 node, so that MEV cannot be achieved, and the problem of single point failure is avoided. At the same time, the smart 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 state data, and the execution of the transaction content of the Layer2 type does not affect the state data change of the Layer1, and the state data change of the Layer1 is reflected in the state data set of the Layer1 and the Layer2 in real time, thereby providing a safe and convenient sharing method of state data, and avoiding data isolation between the Layer2 and the Layer1.
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

[0002] The "impossible triangle" in blockchain refers to the difficulty of simultaneously achieving decentralization, security, and scalability in the design of a blockchain system.

[0003] To solve this problem, we introduce a two-layer blockchain system based on a single-layer blockchain system, where the first layer blockchain system is Layer1, which can be referred to as the base blockchain or main chain, and is the core level of blockchain technology. It is responsible for handling basic transactions in the blockchain network, such as final settlement of transactions, data storage, consensus mechanism, etc. Layer1 is highly decentralized and has no single point of control, providing 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 referred to as the expansion layer, and is an additional protocol or solution built on top 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, in the current blockchain scheme composed of Layer1 and Layer2, there are still the following problems. First, after a user sends a transaction to the Layer2 blockchain network, the Layer2 blockchain network will sort and package the transactions through a centralized sequencer (Sequencer), and then execute these transactions based on the sorting results. In this process, the operator of the Layer2 Sequencer can easily achieve MEV (Maximal Extractable Value) when sorting transactions, and can also review each transaction to control which transactions can be on-chain, and because it is centrally operated, it also has the problem of single point of failure. In addition, a DApp (Decentralized Application) wants users from different blockchains to be able to use it, and must deploy the smart contract of the DApp on different blockchains, and the state data of the smart contract is completely isolated and cannot share data and smart contract code logic, which will cause data isolation between Layer2 and Layer1, resulting in poor user experience. SUMMARY

[0005] An object of the present application is to provide a blockchain transaction processing method and system for solving liquidity fragmentation, to solve the problems of MEV and single point failure in Layer2 and data isolation between Layer1 and Layer2 in the prior art.

[0006] To achieve the above object, the embodiments of the present application provide a blockchain transaction processing method for solving liquidity fragmentation, which is applied to a blockchain system composed of Layer1 nodes and Layer2 nodes, a smart contract is deployed in the Layer1 nodes, and a state data set of the Layer2 nodes is a superset of a state data set of the Layer1 nodes, the method comprising:

[0007] The Layer2 nodes obtain a blockchain transaction to be processed, and send the blockchain transaction to be processed to the Layer1 nodes, and the Layer1 nodes sort the blockchain transaction to be processed;

[0008] The Layer2 nodes execute the blockchain transaction in turn according to the sorting result; wherein, executing the blockchain transaction comprises:

[0009] The Layer2 nodes determine the execution type of the transaction content in the blockchain transaction, and the execution type comprises Layer1 type and Layer2 type;

[0010] For the Layer1 type transaction content, the Layer2 nodes execute the Layer1 type transaction content in the blockchain transaction according to the state data about the Layer1 nodes in the Layer2 nodes, and update the state data of the Layer1 nodes and Layer2 nodes simultaneously according to the executed state information;

[0011] For the Layer2 type transaction content, the Layer2 nodes execute the Layer2 type transaction content in the blockchain transaction according to the state data about the Layer2 nodes in the Layer2 nodes, and update the state data of the Layer2 nodes according to the executed state information.

[0012] Further, the Layer2 nodes obtain a blockchain transaction to be processed, and send the blockchain transaction to be processed to the Layer1 nodes, and the Layer1 nodes sort the blockchain transaction to be processed, comprising:

[0013] The Layer 2 node obtains a to-be-processed blockchain transaction, packs the to-be-processed blockchain transaction, and sends the packed to-be-processed blockchain transaction to the Layer 1 node, so that the Layer 1 node sorts the to-be-processed blockchain transaction according to the packed data, and sends the sorting result to the Layer 2 node.

[0014] Further, before the Layer 2 node executes the blockchain transaction according to the sorting result, the method further comprises:

[0015] predefining a function of a smart contract executed on the Layer 2;

[0016] The Layer 2 node determines the execution type of the blockchain transaction, comprising:

[0017] The Layer 2 node determines the execution type of the blockchain transaction according to the pre-defined function of the smart contract executed on the Layer 2.

[0018] Further, the blockchain transaction includes a Layer 1 transaction and a mixed transaction, wherein the Layer 1 transaction is a blockchain transaction containing only Layer 1 type transaction content, and the mixed transaction is a blockchain transaction containing Layer 1 type transaction content and Layer 2 type transaction content.

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

[0020] Further, the Layer 2 node executes the transaction content in the blockchain transaction through a pre-compiled contract method, comprising:

[0021] For Layer 1 type transaction content, the Layer 2 node calls the state data of the Layer 1 node in the Layer 2 node as the context of the method through a Layer 1 call method, executes the Layer 1 type transaction content in the blockchain transaction, and updates the state data of the Layer 1 node and the Layer 2 node according to the executed state information.

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

[0023] For the Layer2 type transaction content, the Layer2 node executes the Layer2 type transaction content in the blockchain transaction by calling a method of Layer2, calling state data about the Layer2 node in the Layer2 node as a context of the method, and updating the state data of the Layer2 node according to the executed state information.

[0024] Further, the Layer2 node includes two state databases for storing state data of Layer1 type transaction content and state data of Layer2 type transaction content, respectively.

[0025] Embodiments of the present application also provide a blockchain system for solving liquidity fragmentation, the system including a Layer1 node and a Layer2 node, a smart contract deployed in the Layer1 node, and a state data set of the Layer2 node being a superset of a state data set of the Layer1 node.

[0026] The Layer2 node is configured to obtain a blockchain transaction to be processed, and send the blockchain transaction to be processed to the Layer1 node, execute the blockchain transaction in sequence according to a result of the Layer1 node sorting the blockchain transaction to be processed, wherein executing the blockchain transaction includes: determining an execution type of transaction content in the blockchain transaction by the Layer2 node, the execution type including Layer1 type and Layer2 type; for the Layer1 type transaction content, executing the Layer1 type transaction content in the blockchain transaction according to state data about the Layer1 node in the Layer2 node, and updating the state data of the Layer1 node and the Layer2 node according to the executed state information; for the Layer2 type transaction content, executing the Layer2 type transaction content in the blockchain transaction according to state data about the Layer2 node in the Layer2 node, and updating the state data of the Layer2 node according to the executed state information.

[0027] The Layer1 node is configured to sort the blockchain transaction to be processed.

[0028] Embodiments of the present application also provide a computer readable medium having computer program instructions stored thereon, the computer program instructions being executable by a processor to implement the blockchain transaction processing method for solving liquidity fragmentation.

[0029] The blockchain transaction processing scheme for solving liquidity fragmentation provided by the embodiment of the application is applied to a blockchain system composed of Layer1 nodes and Layer2 nodes. When a transaction is processed, the Layer2 node can obtain a blockchain transaction to be processed and send the blockchain transaction to be processed to the Layer1 node. The Layer1 node sorts the blockchain transaction to be processed, and then the Layer2 node executes the blockchain transaction in sequence according to the sorting result. Since the sorting is no longer performed by the Layer2 sorter but by the decentralized Layer1 node, MEV cannot be achieved, and the single-point failure problem is avoided.

[0030] Meanwhile, the smart 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. When the Layer2 node executes the blockchain transaction, it first determines the execution type of the transaction content in the blockchain transaction. For Layer1 type transaction content, the Layer1 type 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 is updated according to the executed state information. For Layer2 type transaction content, the Layer2 type 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 executed state information. In this way, the Layer2 node has full state data, the execution of the Layer2 type transaction content does not affect the change of the Layer1 state data, and the change of the Layer1 state data is reflected in the state data set of the Layer1 and the Layer2 in real time, thereby providing a safe and convenient sharing method of state data, and avoiding data isolation between the Layer2 and the Layer1. BRIEF DESCRIPTION OF DRAWINGS

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

[0032] Figure 1 A flowchart of a blockchain transaction processing method for solving liquidity fragmentation provided by the embodiment of the application is shown in the figure;

[0033] Figure 2 A state data change relationship diagram of Layer1 and Layer2 in the embodiment of the application is shown in the figure;

[0034] The same or similar reference signs in the drawings represent the same or similar elements. DETAILED DESCRIPTION

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

[0036] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0037] Those of ordinary skill in the art can understand that the singular forms "a," "an," and "the" used in this application include plural forms unless specifically stated otherwise. It should be further understood that the use of the term "include" in the specification of the present application means that the stated features, integers, steps, operations, elements, and / or components are present, 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 say an element is "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, or there can be an intermediate element. In addition, "connected" or "coupled" used herein can include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any single unit and all combinations of the associated listed items.

[0038] In a typical configuration of the present application, the devices of the terminal and the service network each include one or more processors (CPUs), input / output interfaces, network interfaces, and memories.

[0039] The memory can include non-persistent memory in computer readable media, 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 computer readable media.

[0040] Computer-readable media includes permanent and non-permanent, removable and non-removable media, which can be implemented by any method or technology to store information. Information can be computer program 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.

[0041] The block chain transaction processing method provided by the embodiment of the application is used in a block chain system composed of Layer1 nodes and Layer2 nodes. When a transaction is processed, the Layer2 node can obtain a block chain transaction to be processed, and send the block chain transaction to be processed to the Layer1 node. The Layer1 node sorts the block chain transaction to be processed, and then the Layer2 node executes the block chain transaction in sequence according to the sorting result. Since the sorting is no longer performed by the Layer2 sorter, but by the decentralized Layer1 node, MEV cannot be achieved, and the single-point failure problem is avoided.

[0042] Meanwhile, the smart contract in the method 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. When the Layer 2 node executes the blockchain transaction, it first determines the execution type of the transaction content in the blockchain transaction. For Layer 1 type transaction content, the Layer 1 type transaction content in the blockchain transaction is executed according to the state data about the Layer 1 node in the Layer 2 node, and the state data of the Layer 1 node and the Layer 2 node is updated according to the executed state information. For Layer 2 type transaction content, the Layer 2 type transaction content in the blockchain transaction is executed according to the state data about the Layer 2 node in the Layer 2 node, and the state data of the Layer 2 node is updated according to the executed state information. In this way, the Layer 2 node has full state data, the execution of the Layer 2 type transaction content does not affect the change of the Layer 1 state data, and the change of the Layer 1 state data is reflected in the state data set of the Layer 1 and the Layer 2 in real time. Thus, a safe and convenient sharing method of state data is provided, and data isolation between Layer 2 and Layer 1 is avoided.

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

[0044] Figure 1A blockchain transaction processing method for solving liquidity fragmentation is provided in the embodiments of the present application, and the method is applied to a blockchain system composed of Layer1 nodes and Layer2 nodes. The Layer1 node in the present scheme represents any one or more nodes in the Layer1 blockchain network, and serves as the data availability layer and settlement layer of the blockchain system. The Layer2 represents any one or more nodes in the Layer2 blockchain network, and 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 is deployed on the Layer1 node, and there is no need to repeatedly deploy the same smart contract on each Layer2. Since each Layer2 node is a superset of the Layer1 node, the smart contract can be deployed once, and all Layer2 blockchains can execute it.

[0045] In actual scenarios, the Layer2 node can include two state databases for storing state data of Layer1 type transaction content and state data of Layer2 type transaction content, respectively, so that the state data set of the Layer2 node can be a superset of the state data set of the Layer1 node.

[0046] The scheme of the present embodiment can include at least the following processing steps when processing:

[0047] In step S101, the Layer2 node obtains the blockchain transaction to be processed, and sends the blockchain transaction to be processed to the Layer1 node.

[0048] In step S102, the Layer1 node sorts the blockchain transaction to be processed.

[0049] In actual scenarios, the blockchain transaction to be processed is first sent to the Layer2 node, and the Layer2 node obtains the blockchain transaction to be processed. After the Layer2 node packages the blockchain transaction to be processed into a Bundle, the Layer1 node is sent. After the Layer1 node obtains the packaged Bundle, the Layer1 node sorts the blockchain transaction to be processed according to the packaged data, and returns the sorting result to the Layer2 node.

[0050] In step S103, the Layer2 node executes the blockchain transaction in sequence according to the sorting result.

[0051] In this way, instead of being sorted by the Layer 2 sequencer, the blockchain transactions are sorted by the decentralized Layer 1 nodes, so that the operator of the Layer 2 sequencer cannot sort the transactions to be processed, and thus cannot obtain MEV, and it is also difficult to review each transaction and control which transactions can be on the chain. In addition, since it no longer relies on a centralized sequencer, the problem of single point failure is also avoided.

[0052] Further, when the Layer 2 node executes the blockchain transaction according to the sorting result, it can first determine the execution type of the transaction content in the blockchain transaction. In an embodiment of the present scheme, the execution type can include Layer 1 type and Layer 2 type, wherein the transaction content of Layer 1 type refers to a transaction in which both state data and execution logic are in Layer 1, and the transaction content of Layer 2 type refers to a transaction in which both state data and execution logic are in Layer 2.

[0053] Thus, based on the above definition, the transaction type of the blockchain transaction can be classified, i.e. at least two categories of blockchain transactions, including Layer 1 transaction and mixed transaction. Among them, the Layer 1 transaction is a blockchain transaction containing only Layer 1 type transaction content, and all transaction contents in this type of blockchain transaction have state data and execution logic in Layer 1. The mixed transaction refers to a blockchain transaction containing both Layer 1 type transaction content and Layer 2 type transaction content, and part of the transaction content in this type of blockchain transaction has state data and execution logic in Layer 1, and another part of the transaction content has state data and execution logic in Layer 2.

[0054] In actual scenarios, before the Layer 2 node executes the blockchain transaction according to the sorting result, the function of the smart contract executed in Layer 2 and the stored state data can be defined in advance, for example, in the present embodiment, the above-mentioned content can be defined in the following pseudo code:

[0055] function canRunAt(sig funcSig, id layer2ID) bool{

[0056] if sig == total&&id = "layer2A"{

[0057] retrun false;

[0058] }else if sig == transfer&&id = "layer2A"{

[0059] return true;

[0060] }

[0061] }

[0062] function total(){}

[0063] function transfer(from, to){}

[0064] Thus, 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 function of the smart contract executed at Layer2 and the stored state data.

[0065] For the Layer1 type of transaction content, the Layer2 node executes the Layer1 type of transaction content in the blockchain transaction according to the state data about the Layer1 node in the Layer2 node, and simultaneously updates the state data of the Layer1 node and the Layer2 node according to the executed state information.

[0066] And for the Layer2 type of transaction content, the Layer2 node executes the Layer2 type of transaction content in the blockchain transaction according to the state data about the Layer2 node in the Layer2 node, and updates the state data of the Layer2 node according to the executed state information.

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

[0068] func Layer2AProxy(contractAddress, msg) {

[0069] if Layer1DelegateCall(contractAddress, canRunAt(msg.sig,Layer2AID )){

[0070] address(this).Layer2Call(msg.data);

[0071] } else {

[0072] address(this).Layer1Call(msg.data);

[0073] In this way, the Layer 2 node can have full amount of state data, and the execution of the Layer 2 type transaction content does not affect the change of the Layer 1 state data, and the change of the Layer 1 state data is reflected in the state data set of the Layer 1 and the Layer 2 in real time, thereby providing a safe and convenient sharing way of state data, avoiding data isolation between Layer 2 and Layer 1.

[0074] The Layer 2 node determines the execution type of the transaction content in the blockchain transaction and executes the transaction content in the blockchain transaction through the pre-compiled contract method. For example, Layer2Call, Layer1DelegateCall and Layer1Call in the foregoing pseudo code are pre-compiled contract methods for realizing corresponding functions. In an actual scenario, the nodes of the Layer 1 blockchain can also realize the three pre-compiled contract methods. If the Layer 1 blockchain does not realize these pre-compiled contract methods in an actual scenario, the pre-compiled contract methods can be realized in a simulated manner through a smart contract.

[0075] In some embodiments of the present application, when the Layer 2 node executes the transaction content in the blockchain transaction through the pre-compiled contract method, for the Layer 1 type transaction content, the Layer 2 node calls the state data about the Layer 1 node in the Layer 2 node as the context of the method through the Layer 1 call method, executes the Layer 1 type transaction content in the blockchain transaction, and simultaneously updates the state data of the Layer 1 node and the Layer 2 node according to the executed state information.

[0076] For example, in a real-world scenario, among the pre-compiled contract methods mentioned in the pseudocode, the `Layer1Call` method uses the state data of Layer1 as its context, executes the corresponding transaction, and updates the state data of Layer1 based on the executed state information. The `Layer1DelegateCall` method also uses the state of Layer1 as its context, but it does not store the executed state information to update the Layer1 state data; instead, it discards it directly. The `Layer2Call` method uses the state data of Layer2 as its context, executes the corresponding transaction, and updates the state data of Layer2 based on the executed state information. Therefore, through these pre-compiled contract methods, the Layer2 node can possess all the state data. The execution of Layer2 type transactions will not affect changes in the state data of Layer1. Changes in the state data of Layer1 will be reflected in the state data sets of Layer1 and Layer2 in real time, thus providing a secure and convenient way to share state data and avoiding data isolation between Layer2 and Layer1.

[0077] by Figure 2 Taking the above example, we will explain the process of state data change. 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 L2 State T includes all the contents of the state data State X.

[0078] After a Layer2 type transaction is executed, the Layer2 blockchain generates a new block L2 Block H+1. The state data L2 State T of the Layer2 blockchain will change to state data L2 State 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.

[0079] After 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 changes to state data State X+1, which is also synchronized to the state data set of the Layer2 blockchain, so that the state data of the Layer2 blockchain changes from L2 State T+1 to L2 State T+2, and the Layer2 blockchain also generates a new block L2 Block H+2.

[0080] Thus, by the above method, Layer2 can access Layer1 data in a convenient and secure manner, providing developers with good user experience and security, and effectively solving the problem of data isolation between Layer2 and Layer1.

[0081] The embodiments of the present application also provide a blockchain system for solving liquidity fragmentation, the system comprising a Layer1 node and a Layer2 node, a smart contract being deployed in the Layer1 node, and a state data set of the Layer2 node being a superset of a state data set of the Layer1 node.

[0082] The Layer2 node is configured to obtain a to-be-processed blockchain transaction and send the to-be-processed blockchain transaction to the Layer1 node, and the Layer2 node executes the blockchain transaction in sequence according to a result of the Layer1 node sorting the to-be-processed blockchain transaction; wherein the execution of the blockchain transaction comprises: the Layer2 node determining an execution type of transaction content in the blockchain transaction, the execution type comprising a Layer1 type and a Layer2 type; for the Layer1 type transaction content, the Layer2 node executes the Layer1 type transaction content in the blockchain transaction according to state data about the Layer1 node in the Layer2 node, and simultaneously updates the state data of the Layer1 node and the Layer2 node according to the executed state information; for the Layer2 type transaction content, the Layer2 node executes the Layer2 type transaction content in the blockchain transaction according to state data about the Layer2 node in the Layer2 node, and updates the state data of the Layer2 node according to the executed state information.

[0083] The Layer1 node is configured to sort the to-be-processed blockchain transaction.

[0084] In addition, another blockchain system for solving liquidity fragmentation is provided in the embodiments of the present application, and the system can include a memory for storing computer program instructions and a processor for executing the computer program instructions, wherein when the computer program instructions are executed by the processor, the device triggers the implementation of the method and / or technical solutions of the aforementioned embodiments of the present application.

[0085] In particular, the methods and / or embodiments in the embodiments of the present application can be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program comprising program code for executing the methods shown in the flowcharts. When the computer program is executed by a processing unit, the above-mentioned functions defined in the methods of the present application are executed.

[0086] It should be noted that the computer readable medium described in the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples of computer readable storage media can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, 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, the computer readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus.

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

[0088] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can 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 the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0089] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0090] As another aspect, the present application also provides a computer readable medium, which can be contained in the apparatus described in the above embodiments, or can exist separately without being assembled into the apparatus. The above computer readable medium carries one or more computer program instructions, which can be executed by a processor to implement the methods and / or technical solutions of the above embodiments of the present application.

[0091] It is noted that the present application can be implemented in software and / or in a combination of software and hardware, e.g., using application specific integrated circuits (ASIC), a general purpose computer or any other similar hardware devices. In some embodiments, software programs implementing the present application can be executed by a processor to perform the steps or functions described herein. Also, software programs (including related data structures) of the present application can be stored in computer-readable recording media, e.g., RAM memory, magnetic or optical drives or disks, and the like. Furthermore, some of the steps or functions can be implemented in hardware, e.g., as circuitry that cooperates with the processor in performing the various steps or functions.

[0092] It will be apparent to those skilled in the art that the present application is not limited to the details of the foregoing exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the present application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. No feature of the claims, whether positional or otherwise, should be construed as limiting the claims to the precise configuration recited. Also, it should be apparent that the "comprising" or "including" language used herein should not be construed to limit the claims to the precise elements recited. The singular should not be construed as limiting the claims to only one of the possibilities of the singular or plural. Multiple units or devices recited in an apparatus claim can also be implemented by one unit or device through software or hardware. The use of first, second, etc., words in the claims are used to denote names and not to indicate any particular order. The numerical order of the steps corresponding to the numbers does not indicate any particular order of execution, and the various steps can be executed in any order that is consistent with the execution logic.

Claims

1. A blockchain transaction processing method for resolving liquidity fragmentation, characterized in that, The method is applied to a blockchain system composed of Layer1 nodes and Layer2 nodes, a smart contract is deployed in the Layer1 nodes, a state data set of the Layer2 nodes is a superset of a state data set of the Layer1 nodes, and the method comprises: The Layer2 node obtains a to-be-processed blockchain transaction and sends the to-be-processed blockchain transaction to the Layer1 node, and the Layer1 node sorts the to-be-processed blockchain transaction; The Layer2 node executes the blockchain transaction in sequence according to the sorting result; wherein executing the blockchain transaction comprises: The Layer2 node determines the execution type of the transaction content in the blockchain transaction, and the execution type comprises a Layer1 type and a Layer2 type; For the Layer1 type transaction content, the Layer2 node executes the Layer1 type transaction content in the blockchain transaction according to the state data about the Layer1 node in the Layer2 node, and simultaneously updates the state data of the Layer1 node and the Layer2 node according to the executed state information; For the Layer2 type transaction content, the Layer2 node executes the Layer2 type transaction content in the blockchain transaction according to the state data about the Layer2 node in the Layer2 node, and updates the state data of the Layer2 node according to the executed state information.

2. The method of claim 1, wherein, The Layer2 node obtains a to-be-processed blockchain transaction and sends the to-be-processed blockchain transaction to the Layer1 node, and the Layer1 node sorts the to-be-processed blockchain transaction, comprising: The Layer2 node obtains a to-be-processed blockchain transaction, packs the to-be-processed blockchain transaction and sends it to the Layer1 node, so that the Layer1 node sorts the to-be-processed blockchain transaction according to the packed data, and sends the sorting result to the Layer2 node.

3. The method of claim 1, wherein, Before the Layer2 node executes the blockchain transaction in sequence according to the sorting result, it further comprises: Defining a function of a smart contract executed in Layer2 in advance; The Layer2 node determines the execution type of the blockchain transaction, comprising: The Layer2 node determines the execution type of the blockchain transaction according to the pre-defined function of the smart contract executed in Layer2.

4. The method of claim 1, wherein, The blockchain transaction comprises a Layer1 transaction and a mixed transaction, wherein the Layer1 transaction is a blockchain transaction containing only Layer1 type transaction content, and the mixed transaction is a blockchain transaction containing Layer1 type transaction content and Layer2 type transaction content.

5. The method of claim 1, wherein, 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.

6. The method of claim 5, wherein, The Layer2 node executes the transaction content in the blockchain transaction through a pre-compiled contract method, comprising: For Layer1 type transaction content, the Layer2 node executes the Layer1 type transaction content in the blockchain transaction by calling the Layer1 method, calling the state data about the Layer1 node in the Layer2 node as the context of the method, and simultaneously updating the state data of the Layer1 node and the Layer2 node according to the executed state information.

7. The method of claim 5, wherein, The Layer2 node executes the transaction content in the blockchain transaction by a pre-compiled contract method, including: For Layer2 type transaction content, the Layer2 node executes the Layer2 type transaction content in the blockchain transaction by calling the Layer2 method, calling the state data about the Layer2 node in the Layer2 node as the context of the method, and updating the state data of the Layer2 node according to the executed state information.

8. The method of claim 1, wherein, The Layer2 node includes two state databases for storing state data of Layer1 type transaction content and state data of Layer2 type transaction content, respectively.

9. A blockchain system for resolving liquidity fragmentation, the system comprising: The system includes a Layer1 node and a Layer2 node, and a smart contract 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. The Layer2 node is configured to obtain a blockchain transaction to be processed, and send the blockchain transaction to be processed to a Layer1 node, and sequentially execute the blockchain transaction according to a result of sorting the blockchain transaction to be processed by the Layer1 node, wherein the execution of the blockchain transaction includes: determining an execution type of transaction content in the blockchain transaction by the Layer2 node, the execution type including Layer1 type and Layer2 type; for Layer1 type transaction content, executing the Layer1 type transaction content in the blockchain transaction according to state data about the Layer1 node in the Layer2 node, and simultaneously updating the state data of the Layer1 node and the Layer2 node according to the executed state information; for Layer2 type transaction content, executing the Layer2 type transaction content in the blockchain transaction according to state data about the Layer2 node in the Layer2 node, and updating the state data of the Layer2 node according to the executed state information. The Layer1 node is configured to sort the blockchain transaction to be processed.

10. A computer readable medium having stored thereon computer program instructions executable by a processor to implement the method of 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