Blockchain transaction execution method, apparatus, program product, device, and medium

By configuring virtual machines and proxy components on the first blockchain, flexible execution of cross-blockchain transactions is achieved, solving the problem of high difficulty in cross-blockchain transaction execution and improving the flexibility and efficiency of transaction execution.

CN117807157BActive Publication Date: 2026-08-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211174267.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-26
Publication Date
2026-08-25
Estimated Expiration
2042-09-26

AI Technical Summary

Technical Problem

In blockchain systems, cross-blockchain transaction execution is difficult, and existing technologies require complex modifications to applications to adapt to the transaction structures of different blockchains.

Method used

By configuring virtual machines and proxy components on the first blockchain, receiving and assembling transactions from the second blockchain from the application, executing the second blockchain transactions using proxy contracts and virtual machines, and returning the execution results, flexible execution of cross-blockchain transactions is achieved.

Benefits of technology

Transactions on the first blockchain can be executed without modifying the application, improving the flexibility and efficiency of transaction execution and reducing the difficulty of cross-blockchain transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117807157B_ABST
    Figure CN117807157B_ABST
Patent Text Reader

Abstract

The application discloses a transaction execution method and device of a blockchain, a program product, equipment and a medium. The method is applied to a blockchain node on a first blockchain, and a virtual machine for executing a transaction on a second blockchain is configured on the first blockchain. The structure of the transaction on the first blockchain is different from the structure of the transaction on the second blockchain. The method comprises the following steps: receiving a first transaction based on an agent component; the first transaction is obtained by assembling a second transaction initiated by the agent component to an application program, the application program is built based on the second blockchain, the first transaction is a transaction on the first blockchain, and the second transaction is a transaction on the second blockchain; extracting the second transaction from the first transaction and calling the virtual machine to execute the second transaction; and returning an execution result of the second transaction to the application program based on the agent component. By adopting the application, the flexibility of transaction execution can be improved, and the difficulty of executing the transaction on the second blockchain on the first blockchain can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of blockchain, and more particularly to a blockchain transaction execution method, apparatus, program product, device, and medium. Background Technology

[0002] In the application of blockchain, the structure of transactions on different blockchains is usually different. If an application is built on blockchain a, then the transactions initiated by the application belong to the transactions on blockchain a.

[0003] When you want to execute a transaction initiated by this application on blockchain b, you need to modify the application so that the transactions initiated by the modified application can meet the transaction structure of blockchain b. However, modifying the application involves many technical aspects and is very difficult, making it not easy to execute transactions from blockchain a on blockchain b. Summary of the Invention

[0004] This application provides a blockchain transaction execution method, apparatus, program product, device, and medium that can improve the flexibility of transaction execution and reduce the difficulty of executing transactions on a second blockchain on a first blockchain.

[0005] This application provides a blockchain transaction execution method, which is applied to a blockchain node on a first blockchain, wherein the first blockchain is configured with a virtual machine for executing transactions on a second blockchain; the structure of transactions on the first blockchain differs from the structure of transactions on the second blockchain, and the method includes:

[0006] The first transaction is received based on the proxy component; the first transaction is obtained by the proxy component assembling the second transaction initiated by the application. The application is built on the second blockchain. The first transaction belongs to the transaction on the first blockchain, and the second transaction belongs to the transaction on the second blockchain.

[0007] Extract the second transaction from the first transaction and invoke the virtual machine to execute the second transaction;

[0008] The proxy component returns the execution result of the second transaction to the application.

[0009] This application provides a blockchain transaction execution device, which is applied to a blockchain node on a first blockchain. The first blockchain is configured with a virtual machine for executing transactions on a second blockchain. The structure of transactions on the first blockchain differs from the structure of transactions on the second blockchain. The device includes:

[0010] The receiving module is used to receive the first transaction based on the proxy component. The first transaction is obtained by the proxy component assembling the second transaction initiated by the application. The application is built on the second blockchain. The first transaction belongs to the transaction on the first blockchain, and the second transaction belongs to the transaction on the second blockchain.

[0011] The execution module is used to extract the second transaction from the first transaction and call the virtual machine to execute the second transaction;

[0012] The return module is used to return the execution result of the second transaction to the application based on the proxy component.

[0013] Optionally, the first transaction may include identification information of the proxy contract that needs to be invoked on the first blockchain;

[0014] The execution module extracts the second transaction from the first transaction and calls the virtual machine to execute the second transaction in the following ways:

[0015] Extract the identification information from the first transaction;

[0016] Based on the identification information, the proxy contract is invoked to extract the second transaction from the first transaction;

[0017] The second transaction is executed by calling the virtual machine based on the proxy contract.

[0018] Optionally, if the second transaction is executed on the basis of a virtual machine, the transaction hash of the second transaction is stored in the proxy contract;

[0019] The execution module executes the extracted second transaction by calling the virtual machine based on the proxy contract, including:

[0020] If it is detected that the transaction hash is not stored in the proxy contract, the virtual machine is invoked based on the proxy contract to execute the extracted second transaction.

[0021] Optionally, the return module may return the execution result of the second transaction to the application based on the proxy component in the following ways:

[0022] After the virtual machine completes the execution of the second transaction, a transaction receipt for the second transaction is generated; the transaction receipt is used to indicate the execution result of the second transaction.

[0023] The transaction receipt is associated with the transaction hash of the second transaction and stored, and the transaction hash is returned to the application based on the proxy component;

[0024] If a receipt query message for an application is received based on the proxy component, the transaction hash is extracted from the receipt query message.

[0025] The transaction receipt is retrieved based on the extracted transaction hash, and the retrieved transaction receipt is returned to the application based on the proxy component.

[0026] Optionally, the above-mentioned device is also used for:

[0027] After the virtual machine executes the second transaction, the second transaction is associated with and stored with the transaction hash.

[0028] If the proxy component receives transaction query information for the application, then extract the transaction hash from the transaction query information;

[0029] The second transaction is retrieved based on the extracted transaction hash, and the retrieved second transaction is returned to the application based on the proxy component.

[0030] Optionally, the proxy component refers to any of the following:

[0031] The proxy component is based on the target process, which does not belong to the first or second blockchain; or,

[0032] The proxy component is a component embedded in the first blockchain.

[0033] Optionally, the proxy component is used to interface with the transaction interface of the second blockchain. The application initiates a second transaction to the proxy component by calling the transaction interface of the second blockchain.

[0034] Optionally, the second transaction has the application's transaction signature; the execution module may invoke the virtual machine to execute the second transaction in the following ways:

[0035] The virtual machine is invoked to verify the second transaction based on the transaction signature;

[0036] If the verification is successful, the virtual machine is invoked to execute the second transaction.

[0037] Optionally, the second transaction may include the number of transactions historically initiated by the application; the execution module may invoke the virtual machine to execute the second transaction in the following ways:

[0038] The virtual machine is invoked to obtain the application's account information, and the number of transactions initiated by the application in the past is determined based on the account information;

[0039] If the number of transactions assembled in the second transaction is the same as the number of transactions determined based on the account information, then the virtual machine is invoked to execute the second transaction.

[0040] Optionally, the second transaction is a transaction in which the first object to which the application belongs transfers the target asset to the second object; the execution module calls the virtual machine to execute the second transaction in the following ways:

[0041] Obtain the incentive assets required to execute the second transaction;

[0042] Obtain the account information of the first target and determine the remaining assets in the first target's account based on the account information;

[0043] If the sum of the incentive assets and the target assets is less than or equal to the remaining assets in the account, the virtual machine is invoked to execute the second transaction.

[0044] Optionally, a transaction contract for executing transactions on a second blockchain is created in the virtual machine;

[0045] The execution module calls the virtual machine to execute the second transaction in the following ways:

[0046] The second transaction is executed by calling the transaction contract based on the virtual machine.

[0047] This application provides a computer device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the method of this application.

[0048] This application provides a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method described above.

[0049] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative embodiments described above.

[0050] In this application, a virtual machine for executing transactions on a second blockchain can be configured on the first blockchain; the structure of transactions on the first blockchain is different from that on the second blockchain; blockchain nodes on the first blockchain can receive a first transaction based on a proxy component; this first transaction is assembled by the proxy component from a second transaction initiated by an application, which is built on the second blockchain, and the first transaction belongs to the first blockchain while the second transaction belongs to the second blockchain; blockchain nodes on the first blockchain can also extract the second transaction from the first transaction, call the virtual machine to execute the second transaction, and return the execution result of the second transaction to the application based on the proxy component. Therefore, the method proposed in this application can realize the conversion of related transactions and data interaction between the application and the first blockchain through a proxy component. Furthermore, the first blockchain can also be configured with a virtual machine for executing transactions on the second blockchain. Thus, even if the structures of transactions on the first and second blockchains are different, the execution of transactions on the second blockchain can still be achieved on the first blockchain, improving the flexibility of the blockchain in executing transactions that do not belong to it and reducing the difficulty of the blockchain executing transactions that do not belong to it. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is a schematic diagram of a network architecture provided in this application;

[0053] Figure 2 This is a schematic diagram illustrating a scenario for executing a transaction, as provided in this application.

[0054] Figure 3 This is a flowchart illustrating a blockchain transaction execution method provided in this application;

[0055] Figure 4 This is a schematic diagram illustrating a scenario for initiating a transaction, as provided in this application.

[0056] Figure 5 This is a schematic diagram of another network architecture provided in this application;

[0057] Figure 6 This is a schematic diagram illustrating a scenario for querying transaction receipts provided in this application;

[0058] Figure 7This is a schematic diagram of a transaction execution process provided in this application;

[0059] Figure 8 This is a schematic diagram of another transaction execution process provided in this application;

[0060] Figure 9 This is a schematic diagram of the structure of a blockchain transaction execution device provided in this application;

[0061] Figure 10 This is a schematic diagram of the structure of a computer device provided in this application. Detailed Implementation

[0062] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0063] This application relates to blockchain-related technologies. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer. A blockchain consists of a series of blocks sequentially generated in chronological order. Once a new block is added to the blockchain, it cannot be removed. Each block records the data submitted by nodes in the blockchain system.

[0064] In this application, transactions initiated by a blockchain application can be executed through another blockchain without modifying the application itself. This reduces the cost of modifying the application and lowers the difficulty of executing transactions that do not belong to the blockchain.

[0065] This application relates to cloud technology. Cloud technology refers to a managed technology that unifies hardware, software, network, and other resources within a wide area network (WAN) or local area network (LAN) to enable data computation, storage, processing, and sharing.

[0066] Cloud technology is a collective term for network technology, information technology, integration technology, management platform technology, and application technology applied to the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will all require robust system support, which can only be achieved through cloud computing.

[0067] The cloud technology mentioned in this application may refer to the ability of applications, agent components, or blockchain nodes on a first blockchain to interact with each other via the "cloud".

[0068] First, it should be noted that all data collected in this application (such as data related to transactions initiated by the application, account information of the object, etc.) can be collected with the consent and authorization of the object to which the data belongs (such as the user), and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0069] Please see Figure 1 , Figure 1 This is a schematic diagram of a network architecture provided in this application. The network architecture may include two blockchains (such as the first and second blockchains described here), an application, and a proxy layer (which may be a proxy component).

[0070] The first blockchain and the second blockchain can be any type of blockchain. The first blockchain and the second blockchain are two different blockchains. The transaction structure on the first blockchain is different from the transaction structure on the second blockchain.

[0071] A first blockchain can have multiple blockchain nodes, and a second blockchain can also have multiple blockchain nodes. A blockchain node can be composed of one or more computer devices, which can be servers or other devices.

[0072] This application can be built on a second blockchain, and transactions initiated through this application also belong to the second blockchain. The application can run on terminal devices, which can include: smartphones, tablets, laptops, desktop computers, smart TVs, in-vehicle terminals, and other smart terminals.

[0073] In this application, a proxy layer can be used to execute transactions initiated by the application on the first blockchain, as described below.

[0074] Please see also Figure 2 , Figure 2 This is a schematic diagram illustrating a scenario for executing a transaction, as provided in this application. Figure 2 As shown, the application can initiate a transaction (such as a second transaction) to the proxy layer. This second transaction can be any transaction initiated by the application that belongs to the second blockchain. The application can send the second transaction to the proxy layer.

[0075] More specifically, the proxy layer can be a pre-configured layer that can interface with the standard interface (such as the transaction interface) of the second blockchain. That is, the proxy layer can be compatible with the standard interface of the second blockchain, and the application can directly call the standard interface of the second blockchain to initiate a second transaction to the proxy layer.

[0076] Furthermore, the proxy layer can reassemble the second transaction to obtain the first transaction belonging to the first blockchain. The first transaction can contain the second transaction. The business logic of how the proxy layer assembles the first transaction through the second transaction can be pre-configured.

[0077] The proxy layer can send the assembled first transaction to any blockchain node on the first blockchain (that is, any blockchain node on the first blockchain can perform subsequent operations to execute the second transaction). The blockchain node can be configured with a proxy contract (a smart contract used to implement the relevant business processing for executing the second transaction). Therefore, after obtaining the first transaction, the blockchain node can call the proxy contract to extract the second transaction from the first transaction.

[0078] Optionally, if the proxy layer is not a layer belonging to the first blockchain, the proxy layer can also be configured to be compatible with the standard interface of the first blockchain. The proxy layer can deliver the first transaction to the blockchain node on the first blockchain through the standard interface of the first blockchain (such as the transaction interface).

[0079] Furthermore, blockchain nodes (hereinafter, any blockchain node can refer to a blockchain node on the first blockchain) can also be configured with a virtual machine for executing transactions on the second blockchain. Therefore, the blockchain node can also invoke this virtual machine to execute the extracted second transaction through a proxy contract. After the virtual machine completes the execution of the second transaction, the business data related to the execution of the second transaction (such as transaction receipts) can be stored in the proxy contract.

[0080] Subsequently, the blockchain node can also return the execution result of the second transaction to the application through the proxy layer (such as a transaction receipt for the second transaction). This process can be detailed below. Figure 3 The relevant content in the corresponding embodiments.

[0081] Using the method provided in this application embodiment, without arbitrarily modifying the application built on the second blockchain, the application can initiate a transaction (such as a second transaction) to the proxy layer through the standard interface of the second blockchain according to the original business logic. Then, the proxy layer can assemble the transaction into the structure of a transaction on the first blockchain, and can give the assembled transaction (such as the first transaction) to the proxy contract to execute the second transaction according to the corresponding business logic (such as extracting the second transaction from the first transaction and then calling the virtual machine to execute the relevant business logic of the second transaction). This improves the flexibility and efficiency of executing transactions on the second blockchain on the first blockchain and reduces the difficulty of executing transactions on the second blockchain on the first blockchain.

[0082] Please see Figure 3 , Figure 3 This is a flowchart illustrating a blockchain transaction execution method provided in this application. The execution entity in this embodiment can be any blockchain node on the first blockchain (e.g., each blockchain node on the first blockchain can execute the following process). A blockchain node can be a single computer device or a cluster of multiple computer devices. The computer device can be a server, a terminal device, or other devices, etc., without limitation. In the following description, the execution entity in this embodiment will be collectively referred to as a blockchain node (i.e., a blockchain node on the first blockchain). Figure 3 As shown, the method may include:

[0083] Step S101: Receive the first transaction based on the proxy component; the first transaction is obtained by the proxy component assembling the second transaction initiated by the application. The application is built on the second blockchain. The first transaction belongs to the transaction on the first blockchain, and the second transaction belongs to the transaction on the second blockchain.

[0084] Optionally, the application (which can be a DApp, a decentralized application) can be built on a second blockchain, which can be any type of blockchain. Transactions initiated by the application belong to the transactions on the second blockchain, and the format of the transactions initiated by the application is the same as the format of the transactions on the second blockchain.

[0085] Optionally, the application can be any form of program, such as a web page, a software program, or a mini-program.

[0086] Among them, the proxy component is a pre-configured component that can connect to, be compatible with and adapt to the relevant interfaces of the second blockchain (such as the transaction interface, which can be used to initiate relevant transactions of the second blockchain).

[0087] The application can call the relevant interfaces of the second blockchain. Therefore, the application can initiate a second transaction to the proxy component by calling the transaction interface of the second blockchain. This second transaction can be any transaction on the second blockchain initiated by the application, such as a transaction for transferring assets.

[0088] Optionally, the proxy component can be composed of a separate process (which can be called the target process), and the proxy component can also contain a configured interface for calling the target process (which can be called the proxy interface). That is, the proxy component can be composed of the proxy interface and the target process. In this case, the proxy component belongs to neither the first blockchain nor the second blockchain.

[0089] Alternatively, the proxy component can also be a component embedded in the first blockchain (or it can contain the relevant interfaces configured on the first blockchain and the relevant processes that the interfaces can call). In this case, the proxy component belongs to the first blockchain.

[0090] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating a scenario for initiating a transaction, as provided in this application. Figure 4 As shown, for method 1, the proxy component may include a proxy interface and a proxy process (i.e., the target process mentioned above). The proxy process can be called through the proxy interface. In this case, the proxy component does not belong to the components on the first blockchain.

[0091] At this point, the application built on the second blockchain can call the proxy process through the proxy interface to initiate a second transaction to the proxy process. Then, the proxy process can reassemble the second transaction to obtain the first transaction. The proxy process can send the assembled first transaction to the first blockchain (such as to any blockchain node on the first blockchain) to complete the process of initiating the first transaction to the first blockchain.

[0092] For method 2, the proxy component is a component embedded in the first blockchain. Therefore, after the application initiates the second transaction to the proxy component, the blockchain nodes on the first blockchain can directly assemble the second transaction based on the proxy component to obtain the initiated first transaction.

[0093] In this application, the second transaction needs to be executed on a first blockchain, which can be any blockchain different from the second blockchain. Since the first blockchain and the second blockchain are different blockchains, the structure of transactions on the first blockchain is also different from the structure of transactions on the second blockchain. Therefore, the second transaction cannot be directly executed on the first blockchain.

[0094] Therefore, when the proxy component receives a second transaction initiated by the application, it can reassemble the second transaction to obtain a transaction on the first blockchain (which can be called the first transaction). The structure of the first transaction belongs to the structure of the transaction on the first blockchain.

[0095] Optionally, the structure of the first transaction can be as shown in Table 1 below:

[0096]

[0097]

[0098] Table 1

[0099] In this application, the execution of the second transaction on the first blockchain can be achieved through a proxy contract (a smart contract pre-configured on the first blockchain for executing transactions not on this blockchain). Therefore, the first transaction can be a transaction that calls the proxy contract. The first transaction can be assembled with the identification information of the proxy contract to be called. Since the proxy contract can contain multiple proxy methods (different proxy methods can correspond to different business processing logic of the proxy contract), the identification information can contain the ID (identifier) ​​of the proxy contract and the proxy method specified under the proxy contract.

[0100] Therefore, the second transaction can be assembled into the first transaction as an input parameter for calling the proxy contract, meaning that the first transaction can contain a complete second transaction.

[0101] Therefore, the blockchain node can receive the first transaction based on the proxy component. If the proxy component consists of a separate target process and proxy interface, the first transaction can be sent to the blockchain node after the proxy component reassembles the received second transaction; if the proxy component is a component embedded in the first blockchain, the first transaction can be obtained by the blockchain node reassembling the received second transaction based on the proxy component.

[0102] In this case, the relevant business logic of assembling the proxy contract's relevant identification information and the second transaction together with the second transaction into the first transaction after receiving the second transaction initiated by the application can be pre-configured on the proxy component.

[0103] The aforementioned proxy contract is configured on the first blockchain, and each blockchain node on the first blockchain can be configured with this proxy contract. The method described above for executing transactions not on this blockchain (such as the first blockchain) through a proxy contract is a preferred approach. Proxy contracts can elegantly and flexibly adapt to the business logic related to executing transactions on one or more other blockchains on this blockchain, requiring only the corresponding configuration of the proxy contract.

[0104] Alternatively, instead of using a proxy contract to execute transactions not on this blockchain, the execution of transactions not on this blockchain can be achieved by configuring a relevant transaction execution interface on the first blockchain. In this case, the first transaction can be used to call the transaction execution interface, and a second transaction can also be assembled in the first transaction.

[0105] Optionally, the second transaction can be a transfer transaction, and the structure (or format) of the second transaction can be as shown in Table 2 below:

[0106]

[0107] Table 2

[0108] The number of transactions sent by the sender is the same as the number of transactions sent by the object to which the application belongs.

[0109] Step S102: Extract the second transaction from the first transaction and call the virtual machine to execute the second transaction.

[0110] Optionally, if the execution of the second transaction is achieved through a proxy contract, the blockchain node can extract the aforementioned identification information of the proxy contract to be invoked from the first transaction. Through this identification information, the corresponding proxy contract can be identified and invoked to extract the second transaction from the first transaction (the second transaction can be represented as binary data).

[0111] Furthermore, the first blockchain can be configured with a virtual machine for executing transactions on the second blockchain. This virtual machine can be understood as a complete computer system with full hardware system functions, running in an isolated environment, simulated by software, capable of executing transactions on the second blockchain. The virtual machine can recognize and execute the relevant code language of the second blockchain.

[0112] After the proxy contract is invoked to extract the second transaction from the first transaction, the blockchain node can use the proxy contract to invoke the virtual machine to execute the extracted second transaction.

[0113] Alternatively, if the execution of the second transaction is achieved through the transaction execution interface configured above, the blockchain node can call the transaction execution interface through the first transaction, extract the second transaction from the first transaction by calling the transaction execution interface, and then call the virtual machine again through the transaction execution interface to parse and execute the extracted second transaction.

[0114] Optionally, before calling the virtual machine to execute the second transaction, the second transaction needs to be verified. Once the verification is successful, the virtual machine can be called to execute the extracted second transaction, as described below.

[0115] The first verification process may include: It should be noted that if the second transaction is successfully executed based on the virtual machine, the transaction hash (i.e., the hash value of the second transaction) of the second transaction can be stored in the proxy contract. Therefore, the proxy contract can perform transaction deduplication, including: before calling the virtual machine to execute the second transaction, the proxy contract can check (i.e. query) whether the transaction hash of the second transaction is stored in the proxy contract. If it is detected that the transaction hash of the second transaction is not stored, it indicates that the second transaction has not been executed before, and the virtual machine can be called to execute the extracted second transaction.

[0116] The second verification process may include: the second transaction may have an application transaction signature, which may be given to the proxy component along with the second transaction, and then the proxy component gives it to the blockchain node. Before the blockchain node calls the virtual machine (e.g., through the proxy contract) to execute the second transaction, it may call the virtual machine (e.g., through the proxy contract) to verify the second transaction using the transaction signature (i.e., signature verification). If the second signature is successfully verified, the virtual machine can be called to execute the second transaction.

[0117] The process of verifying the second transaction through transaction signature may include: the transaction signature may be obtained by the application encrypting the transaction hash of the second transaction using a private key (which may be the private key of the object to which the application belongs on the second blockchain, and the public key of the object may be carried in the second transaction, which may be any user, institution or enterprise with an object account on the second blockchain).

[0118] Therefore, the virtual machine can perform hash calculations on the extracted second transaction to obtain the calculated hash value. The virtual machine can also use the application's public key in the second transaction (which can be the public key of the object to which the application belongs on the second blockchain, and the public key and the object's private key are a key pair) to decrypt the transaction signature of the second transaction to obtain the decrypted hash value.

[0119] Then, the virtual machine can compare the calculated hash value with the decrypted hash value. If they match, the verification of the second transaction can be confirmed as successful. Otherwise, if they do not match, the verification of the second transaction can be confirmed as failed.

[0120] The third verification process may include: when generating the second transaction, the application may encapsulate the total number of transactions initiated by the application in the past (i.e., the transaction number nonce) in the second transaction. The total number of transactions initiated by the application in the past may refer to the total number of transactions initiated by the object to which the application belongs in the application in the past, that is, the total number of transactions initiated in total before the second transaction was initiated.

[0121] Therefore, before the blockchain node calls the virtual machine to execute the second transaction, the blockchain node can call the virtual machine (e.g., through a proxy contract; if a proxy contract exists, all operations performed by the virtual machine can be called and executed by the proxy contract) to obtain the application's account information (which can be the account information of the object account to which the application belongs). This account information can contain the number of transactions initiated by the application in the past. Therefore, the virtual machine can determine the number of transactions initiated by the application in the past through this account information.

[0122] Furthermore, the virtual machine can verify whether the number of transactions initiated by the application encapsulated in the second transaction is the same as the number of transactions initiated by the application in the past as determined by the account information. If the two transaction numbers are the same, the virtual machine can be invoked to execute the second transaction. If the two transaction numbers are different, it indicates that the second transaction is untrustworthy and will not be executed.

[0123] In this process, the second blockchain can transfer the account information related to the object's account to the first blockchain, that is, transfer the relevant account information of the object on the second blockchain to the first blockchain. This allows the application's objects to be easily and quickly migrated from the second blockchain to the first blockchain using the method described in this application.

[0124] The fourth verification process may include: Optionally, the second transaction may be a transaction in which an object belonging to the application (which may be referred to as the first object) transfers the target asset (the specific asset type or quantity can be determined according to the actual application scenario) to a second object (an object that has an object account on the second blockchain and is different from the first object). Therefore, the virtual machine can obtain the incentive assets (gas) required to execute the second transaction, that is, the incentive assets for the blockchain node to call the virtual machine to execute the second transaction (such as the incentive assets for calling the relevant transaction contract in the virtual machine to execute the second transaction).

[0125] The virtual machine can also obtain the account information of the first object and use this account information to determine the remaining assets of the first object on the first blockchain (which can be called the account's remaining assets). It is understandable that the assets of the first object could originally be on the second blockchain, but the second blockchain can transfer the assets of the first object to the first blockchain through cross-chain technology.

[0126] Therefore, when executing the second transaction, it is necessary to ensure that the sum of the incentive assets required to execute the second transaction (including the incentive assets required to call the virtual machine to execute the second transaction) and the target assets is less than or equal to the remaining assets of the first object's account. Therefore, when the virtual machine determines that the sum of the incentive assets required to execute the second transaction and the target assets is less than or equal to the remaining assets of the account, it indicates that the verification of the remaining assets of the first object's account has been successful, and the second transaction can be executed.

[0127] Optionally, the virtual machine can be invoked to execute the second transaction only after all or part of the above four verification processes have met the conditions and passed the verification.

[0128] Furthermore, smart contracts (which can be called transaction contracts) for executing transactions on a second blockchain can be created in the virtual machine. Therefore, when the virtual machine is invoked to execute a second transaction, the transaction contract can be invoked through the virtual machine to execute the second transaction.

[0129] Please see Figure 5 , Figure 5 This is a schematic diagram of a network architecture provided in this application. For example... Figure 5 As shown, in this application, the network architecture may include an application layer (such as an application built on a second blockchain, which may be built using the SDK (Software Development Kit) of the second blockchain), a proxy layer (such as a proxy component that can interface with the second blockchain), and a core chain layer (such as a first blockchain, which may be configured with proxy contracts and virtual machines).

[0130] In this process, the application layer can initiate a transaction (such as the second transaction) to the proxy layer. The proxy layer can then reassemble the transaction initiated by the application layer and send the reassembled transaction (such as the first transaction) to the core chain layer. The core chain layer can then execute the second transaction through the first transaction by configuring the proxy contract and virtual machine.

[0131] Step S103: The execution result of the second transaction is returned to the application based on the proxy component.

[0132] Optionally, the blockchain node can return the execution result of the second transaction to the application based on the proxy component, as described below.

[0133] After the virtual machine executes the second transaction, it can generate a transaction receipt for the second transaction. The transaction receipt can be a receipt in the second blockchain format (i.e., the structure of the receipt on the second blockchain). The transaction receipt is used to indicate the execution result of the second transaction (such as the result of successful execution or the result of execution failure). The transaction receipt can also record the amount of incentive assets (such as gas) consumed by calling the virtual machine to execute the second transaction.

[0134] The incentive assets required to execute the second transaction are equal to the amount of gas (oil) required to execute the second transaction multiplied by the gas price per unit.

[0135] The virtual machine can send the transaction receipt of the second transaction to the proxy contract for storage. The proxy contract can save the second transaction and its transaction receipt. After the virtual machine executes the second transaction, the proxy contract can also associate the transaction receipt of the second transaction with the transaction hash of the second transaction (i.e., record the mapping 1 from the transaction hash of the second transaction to the transaction receipt of the second transaction), and can also associate the second transaction with its transaction hash (i.e., record the mapping 2 from the transaction hash of the second transaction to the second transaction). These two mappings can be two state variables contained in the proxy contract.

[0136] Furthermore, after the virtual machine completes the execution of the second transaction, the proxy contract can also return the completion of the first transaction to the blockchain's interface layer (RPC), enabling the blockchain node to generate a transaction receipt for the first transaction. This transaction receipt indicates the execution result of the first transaction (such as a successful execution result or a failure result). The transaction receipt for the first transaction can also include the amount of incentive assets (such as gas) spent by the blockchain node to execute the first transaction.

[0137] The incentive assets required to execute the first transaction are equal to the amount of gas (oil volume) needed to execute the first transaction multiplied by the gas price per unit. The assets required to execute the first transaction may include the incentive assets needed to invoke the proxy contract to execute the first transaction (including invoking the proxy contract to extract the second transaction from the first transaction and invoking related processes of the virtual machine through the proxy contract). The incentive assets required to execute the first transaction can be managed (paid) by the administrator of the proxy layer (such as the proxy component).

[0138] It is understandable that contract execution can be performed by running the contract through blockchain nodes.

[0139] Optionally, the structure of the transaction receipt for the first transaction can be as shown in Table 3 below:

[0140]

[0141] Table 3

[0142] Optionally, the structure of the transaction receipt for the second transaction can be as shown in Table 4 below:

[0143]

[0144] Table 4

[0145] Furthermore, blockchain nodes can send the transaction receipt of the first transaction to the proxy component. The proxy component confirms the completion of the first transaction using this receipt, and can then confirm the completion of the second transaction. The proxy component can calculate the transaction hash of the second transaction and return it to the application. Subsequent applications can then query the transaction receipt of the second transaction using its transaction hash, as described below.

[0146] After receiving the transaction hash of the second transaction, the application can send a request to the proxy component to query the transaction receipt of the second transaction using the transaction hash. When the proxy component receives the request from the application, it can provide the receipt query information (including the transaction hash of the second transaction) to the blockchain node. The blockchain node can extract the transaction hash of the second transaction from the receipt query information and query the transaction receipt (i.e., the transaction receipt of the second transaction) that is associated with it in the proxy contract based on the extracted transaction hash.

[0147] Furthermore, the blockchain node can send the queried transaction receipt to the proxy component, which can then return the obtained transaction receipt to the application. The application can determine the execution result of the second transaction by receiving the transaction receipt, and can display relevant prompts about the execution result of the second transaction on the application interface (or directly display the transaction receipt of the second transaction).

[0148] The proxy component can directly call the receipt query interface related to the first blockchain through the aforementioned receipt query information, so as to query the transaction receipt of the second transaction from the proxy contract of the blockchain node through the called receipt query interface.

[0149] Please see Figure 6 , Figure 6 This is a schematic diagram illustrating a scenario for querying transaction receipts provided in this application. For example... Figure 6 As shown, after the virtual machine executes the second transaction, the proxy contract can record the mapping from the transaction hash of the second transaction to the transaction receipt of the second transaction, and can also record the mapping from the transaction hash of the second transaction to the second transaction itself. Furthermore, after the virtual machine executes the second transaction, the application can also obtain the transaction hash of the second transaction returned by the proxy component.

[0150] Therefore, the application can send a request to the proxy component to query the transaction receipt of the second transaction using the transaction hash of the second transaction. After receiving the request, the proxy component can also query the transaction receipt of the second transaction from the proxy contract using the transaction hash of the second transaction.

[0151] The proxy contract can query the transaction receipt mapped to the second transaction (i.e., the transaction receipt of the second transaction) based on the transaction hash of the second transaction provided by the proxy component. Then, the proxy contract can return the queryed transaction receipt of the second transaction to the proxy component.

[0152] Next, the proxy component can also return the transaction receipt provided by the proxy contract to the application, so that the application can obtain the transaction receipt of the second transaction. Through this transaction receipt, the result of the second transaction can also be determined. The application can also display the received transaction receipt of the second transaction to the object on the front end.

[0153] Furthermore, the application can also send a query request for the second transaction to the proxy component. After receiving the query request, the proxy component can provide the transaction query information (including the transaction hash of the second transaction) to the blockchain node. The blockchain node can extract the transaction hash of the second transaction from the transaction query information. Then, the blockchain node can query the transaction (i.e. the second transaction) that is associated with it in the proxy contract based on the extracted transaction hash.

[0154] Next, the blockchain node can pass the retrieved second transaction to the proxy component, which can then return the retrieved second transaction to the application. The application can then display the received second transaction on the application interface.

[0155] Similarly, the proxy component can directly call the transaction query interface related to the first blockchain through the aforementioned transaction query information, so as to query the second transaction from the proxy contract of the blockchain node through the called transaction query interface.

[0156] The method described in this application can serve any application within the second blockchain ecosystem (i.e., applications built using the second blockchain). Developers can leverage tools within the existing second blockchain ecosystem to quickly build a DApp (decentralized application, i.e., the aforementioned application). Transactions initiated by this DApp can also be executed on other blockchains (such as the first blockchain), enabling users of this DApp to be quickly migrated to other blockchains (such as the first blockchain).

[0157] Furthermore, the new chain (such as the first blockchain) can be compatible with the standard interface (such as the transaction interface) of the second blockchain, and can receive and execute transactions in the format of the second blockchain (such as the second transaction). Developers of the second blockchain do not need to understand the API (Application Programming Interface) of the new chain (such as the first blockchain), so they do not need to make any modifications to the application. Instead, they can directly use the original business logic of the application, which facilitates the rapid migration of applications and users in the second blockchain ecosystem.

[0158] In this application, a virtual machine for executing transactions on a second blockchain can be configured on the first blockchain; the structure of transactions on the first blockchain is different from that on the second blockchain; blockchain nodes on the first blockchain can receive a first transaction based on a proxy component; this first transaction is assembled by the proxy component from a second transaction initiated by an application, which is built on the second blockchain, and the first transaction belongs to the first blockchain while the second transaction belongs to the second blockchain; blockchain nodes on the first blockchain can also extract the second transaction from the first transaction, call the virtual machine to execute the second transaction, and return the execution result of the second transaction to the application based on the proxy component. Therefore, the method proposed in this application can realize the conversion of related transactions and data interaction between the application and the first blockchain through a proxy component. Furthermore, the first blockchain can also be configured with a virtual machine for executing transactions on the second blockchain. Thus, even if the structures of transactions on the first and second blockchains are different, the execution of transactions on the second blockchain can still be achieved on the first blockchain, improving the flexibility of the blockchain in executing transactions that do not belong to it and reducing the difficulty of the blockchain executing transactions that do not belong to it.

[0159] The following example uses a wallet application to illustrate the transaction execution process. Please see below. Figure 7 , Figure 7 This is a schematic diagram of a transaction execution process provided in this application. Figure 7 As shown, the process may include:

[0160] 1. Here, the wallet application can be the application built using the second blockchain mentioned above, through which transfer transactions can be implemented. The user can be the object to which the wallet application belongs, and the wallet application can be running on the user's terminal device. The user can click on the transfer button on the wallet application's interface (e.g., click the transfer control) and enter the contract address related to the transaction execution. This contract address can be entered by the user or automatically filled in by the wallet application based on the contract call operation performed by the user. This contract address can be the address of the smart contract that needs to be called when executing the transfer transaction in the virtual machine. The user can initiate a transfer transaction (i.e., the second transaction mentioned above) in the wallet application by clicking on the transfer button. Optionally, if it is not necessary to call the corresponding smart contract during the transfer, the account address of the recipient can also be entered.

[0161] 2. After the wallet application receives the user's click to transfer funds, it can call the relevant interface of the second blockchain (such as the interface for obtaining contract information, which can be denoted as getCode) to obtain the information of the smart contract (such as the transaction contract) indicated by the above contract address from the proxy layer (i.e. the above proxy component).

[0162] 3. The proxy layer can obtain information about the smart contract (such as the transaction contract mentioned above) indicated by the above contract address from the core chain layer (i.e., the first blockchain mentioned above).

[0163] 4. The core chain layer can query the contract information of the corresponding smart contract based on the contract address, and can return the queried contract information to the proxy layer. The contract information can contain the contract code of the corresponding smart contract.

[0164] 5. The proxy layer can return contract code to the wallet application.

[0165] 6. After obtaining the contract code, the wallet application can verify whether the input in step 1 above is a contract address. If the contract code is not empty, it can be confirmed that the input in step 1 above is indeed a contract address. The wallet application can display the verification result on the application interface (such as the result of calling the corresponding smart contract).

[0166] 7. Steps 1-6 above are primarily to confirm whether the address entered in step 1 is a contract address or an external account address (such as the account address of the second object). If it is confirmed to be a contract address, the wallet application can display relevant information about the contract corresponding to that contract address on the application interface. If it is confirmed to be an account address, the wallet application can display relevant information about transferring funds to that account address on the application interface. After confirmation, the wallet application can call the relevant interfaces of the second blockchain (such as the interface for obtaining estimated gas, which can be denoted as estimateGas) to obtain the estimated gas quantity from the proxy layer.

[0167] 8. The proxy layer can estimate the gas amount required for a transfer transaction initiated by the wallet application based on the pre-configured relevant algorithms, and can return the calculated gas amount to the wallet application.

[0168] 9. Next, the wallet application can call the relevant interfaces of the second blockchain (such as the interface for obtaining gas price, which can be denoted as gasPrice) to obtain the estimated gas price (which can be understood as the unit price of gas) from the proxy layer.

[0169] 10. The proxy layer can return the estimated gas price to the wallet application.

[0170] 11. Users can set a default upper limit on the incentive assets required for this transfer transaction in the wallet application.

[0171] 12. Wallet apps can display a transfer page to show to users.

[0172] 13. Users can enter the transfer amount (such as the quantity of the target asset mentioned above), related gas information (such as the quantity of incentive assets to be spent) on the transfer page, and then click Next.

[0173] 14. Wallet applications can display confirmation information for the transfer transactions currently initiated by the user on the application page, allowing the user to confirm them.

[0174] 15. The user clicks to confirm the confirmation message displayed in the wallet application.

[0175] 16. The wallet application can call the relevant interfaces of the second blockchain (such as the interface for obtaining account information, which can be denoted as getTransactionCount) to obtain the number of transactions that the user (i.e. the object to which the wallet application belongs) has sent before the proxy layer.

[0176] 17. The proxy layer can obtain the number of transactions that the user (i.e., the object to which the wallet application belongs) has sent before from the core chain layer (such as from the blockchain nodes in the core chain layer).

[0177] 18. The core chain layer can return to the proxy layer the number of transactions that the user (i.e., the object to which the wallet application belongs) has sent before.

[0178] 19. The proxy layer can return the number of transactions sent to the address (which can be understood as the user's account address) to the wallet application, that is, the number of transactions that the user (i.e., the object to which the wallet application belongs) has sent before.

[0179] 20. The wallet application can call the relevant interfaces of the second blockchain (such as the interface for initiating a transaction, which can be denoted as sendRawTransaction) to initiate a raw transaction (i.e. the second transaction mentioned above) to the proxy layer. The raw transaction can encapsulate the total number of transactions that the user has already sent (nonce).

[0180] 21. The proxy layer can call the proxy contract to send a raw transaction. The method can be: the proxy layer can assemble the identification information of the proxy contract to be called together with the raw transaction and other relevant information to obtain the above-mentioned first transaction, and send the first transaction to the core chain layer.

[0181] 22. After the core chain layer receives the first transaction, it can call the proxy contract to execute the first transaction. Executing the first transaction includes calling the virtual machine to execute the second transaction encapsulated in the first transaction.

[0182] 23. After the second transaction is executed by calling the virtual machine, the first transaction is also executed. The core chain layer can return a message indicating that the first transaction was successfully executed to the proxy layer, such as returning the transaction receipt of the first transaction.

[0183] 24. When the proxy layer receives a notification from the core chain layer that the first transaction has been successfully executed, it can return the transaction hash of the raw transaction to the wallet application.

[0184] 25. The wallet application can call the relevant interfaces of the second blockchain (such as the receipt query interface, which can be denoted as getTransactionReceipt) to query the transaction receipt of the raw transaction from the proxy layer through the transaction hash of the raw transaction.

[0185] 26. The proxy layer can call the proxy contract to read the corresponding transaction receipt from the core chain layer through the transaction hash of the raw transaction (there is a mapping relationship between the transaction receipt and the transaction hash).

[0186] 27. The core chain layer can return the transaction receipts it reads to the proxy layer.

[0187] 28. The proxy layer can return the received transaction receipts to the wallet application.

[0188] 29. Wallet applications can notify users of transaction results via pop-ups (or other means). The transaction result is the execution result of the raw transaction indicated by the transaction receipt, such as a failed transaction or a successful transaction, i.e., a failed transfer or a successful transfer.

[0189] The method proposed in this application can realize the conversion of related transactions and data interaction between the application and the first blockchain through a proxy component. Furthermore, the first blockchain can also be configured with a virtual machine for executing transactions on the second blockchain. Therefore, even if the structure of transactions on the first blockchain is different from that on the second blockchain, it is possible to execute transactions on the second blockchain on the first blockchain. This improves the flexibility of the blockchain in executing transactions that do not belong to it and reduces the difficulty of the blockchain in executing transactions that do not belong to it.

[0190] Please see Figure 8 , Figure 8 This is a schematic diagram of another transaction execution process provided in this application. For example... Figure 8 As shown, the process may include:

[0191] 1. Here, "Actor" can refer to an application that can be operated by a user. This application can be built on a second blockchain. The application can call the relevant interfaces of the second blockchain to initiate rawTx transactions (i.e., second transactions) to the proxy layer (i.e., proxy components).

[0192] 2. The proxy layer can send transactions to the core chain RPC (the interface layer of the core chain). The transaction sent here can refer to the first transaction, which can include the ID (identifier) ​​of the proxy contract, the proxy method (i.e., the contract method) to be called under the proxy contract, and the transaction rawTx.

[0193] 3. After receiving the first transaction, the core chain RPC can call the proxy method under the proxy contract according to the ID (identifier) ​​of the proxy contract in the first transaction, the proxy method (i.e., contract method) to be called under the proxy contract, and the transaction rawTx. The input parameter for calling the proxy method of the proxy contract is the transaction rawTx.

[0194] 4. The proxy contract can perform deduplication on the rawTx transaction, that is, determine whether the rawTx transaction has been executed before. If it has not been executed, the following operations can be performed.

[0195] 5. The proxy contract can call the virtual machine to execute the transaction rawTx extracted from the first transaction.

[0196] 6. Before executing the transaction rawTx, the virtual machine can verify the transaction rawTx. If the verification is successful, the following step 7 can be executed.

[0197] 7. The virtual machine can also verify the transaction quantity nonce in the rawTx of the transaction, as well as the account balance (i.e., the remaining assets of the account) of the object to which the application belongs. If both verifications are successful, the following step 8 can be executed.

[0198] 8. The virtual machine can execute rawTx transactions.

[0199] 9. After the virtual machine completes the execution of the transaction rawTx, it can return a transaction receipt of the transaction rawTx to the proxy contract.

[0200] 10. The agency contract can save the transaction rawTx and the transaction receipt of the rawTx.

[0201] 11. The proxy contract can return the completion of the first and second transactions to the core chain RPC.

[0202] 12. Core chain RPC can return native transaction receipts (i.e., transaction receipts for the first transaction) to the proxy layer.

[0203] 13. After the proxy layer confirms the completion of the first transaction, the second transaction can also be confirmed as completed (the first transaction can be a transaction that calls the proxy contract to execute the second transaction through the corresponding business logic). The proxy layer can return the transaction hash of the raw transaction (i.e. the second transaction) to the application, so that the subsequent application can use the transaction hash to query the transaction receipt of the second transaction and the second transaction. The transaction hash of the second transaction can be mapped to the transaction receipt of the second transaction or to the second transaction itself in the proxy contract.

[0204] The method proposed in this application can realize the conversion of related transactions and data interaction between the application and the first blockchain through a proxy component. Furthermore, the first blockchain can also be configured with a virtual machine for executing transactions on the second blockchain. Therefore, even if the structure of transactions on the first blockchain is different from that on the second blockchain, it is possible to execute transactions on the second blockchain on the first blockchain. This improves the flexibility of the blockchain in executing transactions that do not belong to it and reduces the difficulty of the blockchain in executing transactions that do not belong to it.

[0205] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of a blockchain transaction execution device provided in this application. The blockchain transaction execution device can be a computer program (including program code) running on a computer device; for example, the blockchain transaction execution device is an application software. This blockchain transaction execution device can be used to execute the corresponding steps in the methods provided in the embodiments of this application. This device can be applied to blockchain nodes on a first blockchain, where a virtual machine for executing transactions on a second blockchain is configured; the structure of transactions on the first blockchain differs from the structure of transactions on the second blockchain. For example… Figure 9 As shown, the transaction execution device 1 of the blockchain may include: a receiving module 11, an execution module 12, and a return module 13.

[0206] The receiving module 11 is used to receive the first transaction based on the proxy component; the first transaction is obtained by the proxy component assembling the second transaction initiated by the application, the application is built on the second blockchain, the first transaction belongs to the transaction on the first blockchain, and the second transaction belongs to the transaction on the second blockchain;

[0207] Execution module 12 is used to extract the second transaction from the first transaction and call the virtual machine to execute the second transaction;

[0208] Return module 13 is used to return the execution result of the second transaction to the application based on the proxy component.

[0209] Optionally, the first transaction may include identification information of the proxy contract that needs to be invoked on the first blockchain;

[0210] The execution module 12 extracts the second transaction from the first transaction and calls the virtual machine to execute the second transaction in the following ways:

[0211] Extract the identification information from the first transaction;

[0212] Based on the identification information, the proxy contract is invoked to extract the second transaction from the first transaction;

[0213] The second transaction is executed by calling the virtual machine based on the proxy contract.

[0214] Optionally, if the second transaction is executed on the basis of a virtual machine, the transaction hash of the second transaction is stored in the proxy contract;

[0215] The execution module 12 executes the extracted second transaction by calling the virtual machine based on the proxy contract, including:

[0216] If it is detected that the transaction hash is not stored in the proxy contract, the virtual machine is invoked based on the proxy contract to execute the extracted second transaction.

[0217] Optionally, the return module 13 may return the execution result of the second transaction to the application based on the proxy component in the following ways:

[0218] After the virtual machine completes the execution of the second transaction, a transaction receipt for the second transaction is generated; the transaction receipt is used to indicate the execution result of the second transaction.

[0219] The transaction receipt is associated with the transaction hash of the second transaction and stored, and the transaction hash is returned to the application based on the proxy component;

[0220] If a receipt query message for an application is received based on the proxy component, the transaction hash is extracted from the receipt query message.

[0221] The transaction receipt is retrieved based on the extracted transaction hash, and the retrieved transaction receipt is returned to the application based on the proxy component.

[0222] Optionally, the above-mentioned device 1 is also used for:

[0223] After the virtual machine executes the second transaction, the second transaction is associated with and stored with the transaction hash.

[0224] If the proxy component receives transaction query information for the application, then extract the transaction hash from the transaction query information;

[0225] The second transaction is retrieved based on the extracted transaction hash, and the retrieved second transaction is returned to the application based on the proxy component.

[0226] Optionally, the proxy component refers to any of the following:

[0227] The proxy component is based on the target process, which does not belong to the first or second blockchain; or,

[0228] The proxy component is a component embedded in the first blockchain.

[0229] Optionally, the proxy component is used to interface with the transaction interface of the second blockchain. The application initiates a second transaction to the proxy component by calling the transaction interface of the second blockchain.

[0230] Optionally, the second transaction has the application's transaction signature; the execution module 12 calls the virtual machine to execute the second transaction in the following ways:

[0231] The virtual machine is invoked to verify the second transaction based on the transaction signature;

[0232] If the verification is successful, the virtual machine is invoked to execute the second transaction.

[0233] Optionally, the second transaction includes the number of transactions initiated historically by the application; the execution module 12 calls the virtual machine to execute the second transaction in the following ways:

[0234] The virtual machine is invoked to obtain the application's account information, and the number of transactions initiated by the application in the past is determined based on the account information;

[0235] If the number of transactions assembled in the second transaction is the same as the number of transactions determined based on the account information, then the virtual machine is invoked to execute the second transaction.

[0236] Optionally, the second transaction is a transaction in which the first object to which the application belongs transfers the target asset to the second object; the execution module 12 calls the virtual machine to execute the second transaction in the following ways:

[0237] Obtain the incentive assets required to execute the second transaction;

[0238] Obtain the account information of the first target and determine the remaining assets in the first target's account based on the account information;

[0239] If the sum of the incentive assets and the target assets is less than or equal to the remaining assets in the account, the virtual machine is invoked to execute the second transaction.

[0240] Optionally, a transaction contract for executing transactions on a second blockchain is created in the virtual machine;

[0241] The execution module 12 calls the virtual machine to execute the second transaction in the following ways:

[0242] The second transaction is executed by calling the transaction contract based on the virtual machine.

[0243] According to one embodiment of this application, Figure 3The steps involved in the blockchain transaction execution method shown can be derived from... Figure 9 The various modules in the blockchain transaction execution device 1 shown are used to execute the transactions. For example, Figure 3 Step S101 shown can be performed by Figure 9 The receiving module 11 in the middle is used to perform the operation. Figure 3 Step S102 shown can be performed by Figure 9 The execution module 12 in the middle is used to execute; Figure 3 Step S103 shown can be performed by Figure 9 The return module 13 in the middle is used for execution.

[0244] In this application, a virtual machine for executing transactions on a second blockchain can be configured on the first blockchain; the structure of transactions on the first blockchain is different from that on the second blockchain; blockchain nodes on the first blockchain can receive a first transaction based on a proxy component; this first transaction is assembled by the proxy component from a second transaction initiated by an application, which is built on the second blockchain, and the first transaction belongs to the first blockchain, while the second transaction belongs to the second blockchain; blockchain nodes on the first blockchain can also extract the second transaction from the first transaction, call the virtual machine to execute the second transaction, and return the execution result of the second transaction to the application based on the proxy component. Therefore, the device proposed in this application can realize the conversion of related transactions and data interaction between the application and the first blockchain through a proxy component. Furthermore, the first blockchain can also be configured with a virtual machine for executing transactions on the second blockchain. Thus, even if the structures of transactions on the first and second blockchains are different, the execution of transactions on the second blockchain can still be achieved on the first blockchain, improving the flexibility of the blockchain in executing transactions that do not belong to it and reducing the difficulty of the blockchain executing transactions that do not belong to it.

[0245] According to one embodiment of this application, Figure 9 The various modules in the blockchain transaction execution device 1 shown can be individually or entirely merged into one or more units, or one or more of these units can be further divided into multiple functionally smaller sub-units to achieve the same operation without affecting the technical effects of the embodiments of this application. The above modules are based on logical functional division; in practical applications, the function of one module can be implemented by multiple units, or the function of multiple modules can be implemented by one unit. In other embodiments of this application, the blockchain transaction execution device 1 may also include other units; in practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0246] According to one embodiment of this application, a general-purpose computer device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), can perform operations such as... Figure 3 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 9 The diagram shows a blockchain transaction execution device 1 and a blockchain transaction execution method for implementing embodiments of this application. The aforementioned computer program can be recorded on, for example, a computer-readable recording medium, loaded onto the aforementioned computing device via the computer-readable recording medium, and run therein.

[0247] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a computer device provided in this application. For example... Figure 10 As shown, the computer device 1000 may include a processor 1001, a network interface 1004, and a memory 1005. Furthermore, the computer device 1000 may also include a user interface 1003 and at least one communication bus 1002. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as at least one disk storage device. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 10 As shown, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a device control application program.

[0248] exist Figure 10 In the computer device 1000 shown, the network interface 1004 provides network communication functionality; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:

[0249] The first transaction is received based on the proxy component; a virtual machine for executing transactions on the second blockchain is configured on the first blockchain; the structure of transactions on the first blockchain is different from that on the second blockchain; the first transaction is obtained by the proxy component assembling the second transaction initiated by the application, the application is built on the second blockchain, the first transaction belongs to the transactions on the first blockchain, and the second transaction belongs to the transactions on the second blockchain;

[0250] Extract the second transaction from the first transaction and invoke the virtual machine to execute the second transaction;

[0251] The proxy component returns the execution result of the second transaction to the application.

[0252] It should be understood that the computer device 1000 described in the embodiments of this application can perform the foregoing... Figure 3 The description of the blockchain transaction execution method in the corresponding embodiments can also be executed as described above. Figure 9 The description of the blockchain transaction execution device 1 in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated here.

[0253] Furthermore, it should be noted that this application also provides a computer-readable storage medium storing a computer program executed by the aforementioned blockchain transaction execution device 1. The computer program includes program instructions, which, when executed by a processor, enable the execution of the aforementioned... Figure 3 The description of the blockchain transaction execution method in the corresponding embodiments is already provided and will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer storage medium embodiments related to this application, please refer to the description of the method embodiments of this application.

[0254] As an example, the above program instructions can be deployed and executed on a single computer device, or deployed and executed on multiple computer devices located in one location, or executed on multiple computer devices distributed across multiple locations and interconnected via a communication network. Multiple computer devices distributed across multiple locations and interconnected via a communication network can form a blockchain network.

[0255] The aforementioned computer-readable storage medium can be a blockchain transaction execution device provided in any of the foregoing embodiments or an internal storage unit of the aforementioned computer device, such as a hard drive or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium can include both internal storage units and external storage devices of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0256] This application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned... Figure 3 The description of the blockchain transaction execution method in the corresponding embodiments is already provided and will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application.

[0257] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0258] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.

[0259] The methods and related apparatuses provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to create a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.

[0260] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A blockchain transaction execution method, characterized in that, The method is applied to blockchain nodes on a first blockchain, which is configured with a virtual machine for executing transactions on a second blockchain. The structure of transactions on the first blockchain differs from the structure of transactions on the second blockchain; the method includes: The proxy component receives a first transaction; the first transaction is assembled by the proxy component from a second transaction initiated by the application, the application is built on the second blockchain, the first transaction belongs to the first blockchain, and the second transaction belongs to the second blockchain; the proxy component is used to interface with the transaction interface of the second blockchain, and the application initiates the second transaction to the proxy component by calling the transaction interface of the second blockchain; Extract the second transaction from the first transaction and invoke the virtual machine to execute the second transaction; The proxy component returns the execution result of the second transaction to the application.

2. The method according to claim 1, characterized in that, The first transaction contains the identification information of the proxy contract that needs to be invoked on the first blockchain; The step of extracting the second transaction from the first transaction and invoking the virtual machine to execute the second transaction includes: Extract the identification information from the first transaction; Based on the identification information, the proxy contract is invoked to extract the second transaction from the first transaction; The second transaction extracted is executed by calling the virtual machine based on the proxy contract.

3. The method according to claim 2, characterized in that, If the second transaction is executed and completed based on the virtual machine, the transaction hash of the second transaction is stored in the proxy contract; The step of invoking the virtual machine to execute the extracted second transaction based on the proxy contract includes: If it is detected that the transaction hash is not stored in the proxy contract, the virtual machine is invoked based on the proxy contract to execute the extracted second transaction.

4. The method according to claim 1, characterized in that, The step of returning the execution result of the second transaction to the application based on the proxy component includes: After the virtual machine completes the execution of the second transaction, a transaction receipt for the second transaction is generated; the transaction receipt is used to indicate the execution result of the second transaction. The transaction receipt is associated with the transaction hash of the second transaction and stored, and the transaction hash is returned to the application based on the proxy component; If the proxy component receives a receipt query for the application, the transaction hash is extracted from the receipt query. The transaction receipt is queried based on the extracted transaction hash, and the queried transaction receipt is returned to the application based on the proxy component.

5. The method according to claim 4, characterized in that, The method further includes: After the virtual machine executes the second transaction, the second transaction is associated with and stored with the transaction hash. If the proxy component receives transaction query information for the application, then the transaction hash is extracted from the transaction query information; The second transaction is queried based on the extracted transaction hash, and the queried second transaction is returned to the application based on the proxy component.

6. The method according to claim 1, characterized in that, The proxy component refers to any of the following: The proxy component is constructed based on a target process, which does not belong to either the first blockchain or the second blockchain; or... The proxy component is a component embedded in the first blockchain.

7. The method according to claim 1, characterized in that, The second transaction has the transaction signature of the application; the invocation of the virtual machine to execute the second transaction includes: The virtual machine is invoked to verify the second transaction based on the transaction signature; If the verification is successful, the virtual machine is invoked to execute the second transaction.

8. The method according to claim 1, characterized in that, The second transaction comprises the number of transactions historically initiated by the application; the step of invoking the virtual machine to execute the second transaction includes: The virtual machine is invoked to obtain the application's account information, and the number of transactions initiated by the application in the past is determined based on the account information; If the number of transactions assembled in the second transaction is the same as the number of transactions determined based on the account information, then the virtual machine is invoked to execute the second transaction.

9. The method according to claim 1, characterized in that, The second transaction is a transaction in which a first object to which the application belongs transfers the target asset to a second object; the invocation of the virtual machine to execute the second transaction includes: Obtain the incentive assets required to execute the second transaction; Obtain the account information of the first object, and determine the remaining assets of the first object's account based on the account information; If the sum of the incentive assets and the target assets is less than or equal to the remaining assets in the account, then the virtual machine is invoked to execute the second transaction.

10. The method according to claim 1, characterized in that, The virtual machine contains transaction contracts for executing transactions on the second blockchain; The invocation of the virtual machine to execute the second transaction includes: The second transaction is executed by calling the transaction contract based on the virtual machine.

11. A blockchain transaction execution device, characterized in that, The device is applied to a blockchain node on a first blockchain, which is configured with a virtual machine for executing transactions on a second blockchain. The structure of transactions on the first blockchain is different from the structure of transactions on the second blockchain; the device includes: A receiving module is used to receive a first transaction based on a proxy component; the first transaction is obtained by the proxy component assembling a second transaction initiated by an application, the application is built on the second blockchain, the first transaction belongs to the first blockchain, and the second transaction belongs to the second blockchain; the proxy component is used to interface with the transaction interface of the second blockchain, and the application initiates the second transaction to the proxy component by calling the transaction interface of the second blockchain; An execution module is used to extract the second transaction from the first transaction and call the virtual machine to execute the second transaction; The return module is used to return the execution result of the second transaction to the application based on the proxy component.

12. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1-10.

13. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1-10.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and executed as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Smart contract operation method based on micro-service block chain

    CN114358936A