Asset transfer method, device and storage medium
By generating and confirming asset transfer transactions on the main chain, the problem of cumbersome and expensive asset transfer between multiple parachains in the prior art is solved, and efficient asset transfer and low-cost transaction processes are achieved.
Patent Information
- Application Number
- CN202011069529.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-30
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2040-09-30
AI Technical Summary
In existing blockchain technology, users need to execute multiple transactions on multiple parachains to transfer assets, resulting in cumbersome processes and high handling fees.
By generating asset transfer transactions, sending them to the main chain for consensus processing, and confirming the execution results based on the transaction hash, the cross-parallel chain assets can be frozen and thawed, simplifying the transaction process and reducing handling fees.
The asset transfer process across multiple parachains has been simplified, reducing the cost of handling fees and improving transaction efficiency.
Smart Images

Figure CN112184251B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of parallel chain technology, and specifically to an asset transfer method, device and storage medium. Background Art
[0002] In the existing blockchain technology, user A has accounts on multiple parachains (such as parachain1~parachain4) and holds a number of assets. If user A wants to transfer part of the assets on parachain1 to parachain2~parachain4, for each parachain, two transactions tx1 and tx2 need to be issued to complete the transfer. Taking parachain2 as an example, tx1 is to lock part of the assets to be transferred on parac hain1. After tx1 is successfully executed, tx2 is generated. tx2 is to generate assets on parachain2 that are equal to the locked assets. This is very inconvenient and requires a lot of handling fees. Summary of the invention
[0003] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide an asset transfer method, device and storage medium that can simultaneously execute related transaction contents and has low handling fee costs.
[0004] In a first aspect, the present invention provides an asset transfer method applicable to a client, the method comprising:
[0005] In response to the current user transferring assets held on a number of first parallel chains to a number of second parallel chains, a first asset transfer transaction is generated; wherein the first asset transfer transaction includes a first identifier of each first parallel chain and each second parallel chain, and each first transaction content executed on each first parallel chain and each second parallel chain respectively;
[0006] Send the first asset transfer transaction to the main chain for each parachain node of each parachain to:
[0007] Determine whether the first identifier in the first asset transfer transaction includes the second identifier of the corresponding parallel chain:
[0008] If yes, the corresponding first transaction content is executed:
[0009] If the corresponding first transaction content is to deduct certain assets, then freeze certain assets;
[0010] If the corresponding first transaction content is to generate a number of assets, then generate a number of assets and freeze the generated assets; and,
[0011] Generate a consensus transaction of the parachain block including the first asset transfer transaction and send it to the main chain;
[0012] When all the parachain blocks including the first asset transfer transaction have successfully reached consensus on the main chain, a first confirmation transaction including the transaction hash of the first asset transfer transaction is generated and sent to the main chain for each parachain node of each parachain to:
[0013] Determine whether the first asset transfer transaction is included on the parallel chain based on the transaction hash:
[0014] If yes, execute the first confirmation transaction: obtain the execution result of the first asset transfer transaction that succeeded in each consensus from the main chain;
[0015] Determine whether all execution results are successful:
[0016] If yes, the frozen assets will be deducted, or the frozen assets generated will be unfrozen;
[0017] If not, the frozen assets will be unfrozen, or the frozen assets generated will be deducted.
[0018] In a second aspect, the present invention provides an asset transfer method applicable to a main chain node, the method comprising:
[0019] Receive a first asset transfer transaction; wherein the first asset transfer transaction is generated by a first client of a first user in response to the first user transferring assets held on a plurality of first parallel chains to a plurality of second parallel chains, and the first asset transfer transaction includes a first identifier of each first parallel chain and each second parallel chain, and each first transaction content executed on each first parallel chain and each second parallel chain respectively; the first asset transfer transaction is also used for the parallel chain nodes of each parallel chain:
[0020] Determine whether the first identifier in the first asset transfer transaction includes the second identifier of the corresponding parallel chain:
[0021] If yes, the corresponding first transaction content is executed:
[0022] If the corresponding first transaction content is to deduct certain assets, then freeze certain assets;
[0023] If the corresponding first transaction content is to generate a number of assets, then generate a number of assets and freeze the generated assets; and,
[0024] Generate a consensus transaction of the parachain block including the first asset transfer transaction and send it to the main chain;
[0025] Receive a first confirmation transaction including a transaction hash of a first asset transfer transaction; wherein the first confirmation transaction is generated by the first client when each parachain block including the first asset transfer transaction is successfully agreed upon on the main chain; the first confirmation transaction is also used for the parachain nodes of each parachain:
[0026] Determine whether the first asset transfer transaction is included on the parallel chain based on the transaction hash:
[0027] If yes, execute the first confirmation transaction: obtain the execution result of the first asset transfer transaction that succeeded in each consensus from the main chain;
[0028] Determine whether all execution results are successful:
[0029] If yes, the frozen assets will be deducted, or the frozen assets generated will be unfrozen;
[0030] If not, the frozen assets will be unfrozen, or the frozen assets generated will be deducted.
[0031] In a third aspect, the present invention provides an asset transfer method applicable to a parachain node, the method comprising:
[0032] Obtaining a first asset transfer transaction from the main chain; wherein the first asset transfer transaction is generated by a first client of a first user in response to the first user transferring assets held on a plurality of first parallel chains to a plurality of second parallel chains, and the first asset transfer transaction includes a first identifier of each first parallel chain and each second parallel chain, and each first transaction content executed on each first parallel chain and each second parallel chain respectively;
[0033] Determine whether the first identifier in the first asset transfer transaction includes the second identifier of the current parallel chain:
[0034] If yes, the corresponding first transaction content is executed:
[0035] If the corresponding first transaction content is to deduct certain assets, then freeze certain assets;
[0036] If the corresponding first transaction content is to generate a number of assets, then generate a number of assets, freeze the generated assets, and,
[0037] Generate a consensus transaction of the parachain block including the first asset transfer transaction and send it to the main chain;
[0038] Obtaining a first confirmation transaction including a transaction hash of the first asset transfer transaction from the main chain; wherein the first confirmation transaction is generated by the first client when all parallel chain blocks including the first asset transfer transaction have successfully reached consensus on the main chain;
[0039] Determine whether the first asset transfer transaction is included on the parallel chain based on the transaction hash:
[0040] If yes, execute the first confirmation transaction: obtain the execution result of the first asset transfer transaction that succeeded in each consensus from the main chain;
[0041] Determine whether all execution results are successful:
[0042] If yes, the frozen assets will be deducted, or the frozen assets generated will be unfrozen;
[0043] If not, the frozen assets will be unfrozen, or the frozen assets generated will be deducted.
[0044] In a fourth aspect, the present invention also provides a device comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors so that the one or more processors execute the asset transfer method provided according to various embodiments of the present invention.
[0045] In a fifth aspect, the present invention further provides a storage medium storing a computer program, wherein the computer program enables a computer to execute the asset transfer method provided according to each embodiment of the present invention.
[0046] The asset transfer method, device and storage medium provided by many embodiments of the present invention generate a first asset transfer transaction in response to the current user transferring assets held on several first parallel chains to several second parallel chains; send the first asset transfer transaction to the main chain, so that each parallel chain node of each first parallel chain and the second parallel chain executes the corresponding first transaction content and generates corresponding consensus transactions respectively; when each parallel chain block including the first asset transfer transaction succeeds in consensus on the main chain, a first confirmation transaction including the transaction hash of the first asset transfer transaction is generated and sent to the main chain, so that each parallel chain node of each first parallel chain and the second parallel chain executes the first confirmation transaction: a method of unfreezing or deducting assets according to the execution results of each first asset transfer transaction that succeeds in consensus obtained by the main chain, so that related transaction contents can be executed simultaneously, and the handling fee cost is relatively low. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0048] Figure 1 A flowchart of an asset transfer method provided by one embodiment of the present invention.
[0049] Figure 2 A flowchart of another asset transfer method provided by an embodiment of the present invention.
[0050] Figure 3 A flowchart of another asset transfer method provided by an embodiment of the present invention.
[0051] Figure 4 A schematic diagram of the structure of a device provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0052] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.
[0053] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0054] Figure 1 A flowchart of an asset transfer method provided by an embodiment of the present invention. Figure 1 As shown, in this embodiment, the present invention provides an asset transfer method applicable to a client, the method comprising:
[0055] S12: In response to the current user transferring assets held on a number of first parallel chains to a number of second parallel chains, a first asset transfer transaction is generated; wherein the first asset transfer transaction includes a first identifier of each first parallel chain and each second parallel chain, and each first transaction content executed on each first parallel chain and each second parallel chain respectively;
[0056] S14: Send the first asset transfer transaction to the main chain for each parachain node of each parachain to:
[0057] Determine whether the first identifier in the first asset transfer transaction includes the second identifier of the corresponding parallel chain:
[0058] If yes, the corresponding first transaction content is executed:
[0059] If the corresponding first transaction content is to deduct certain assets, then freeze certain assets;
[0060] If the corresponding first transaction content is to generate a number of assets, then generate a number of assets and freeze the generated assets; and,
[0061] Generate a consensus transaction of the parachain block including the first asset transfer transaction and send it to the main chain;
[0062] S16: When all the parachain blocks including the first asset transfer transaction have successfully reached consensus on the main chain, a first confirmation transaction including the transaction hash of the first asset transfer transaction is generated and sent to the main chain for each parachain node of each parachain to:
[0063] Determine whether the first asset transfer transaction is included on the parallel chain based on the transaction hash:
[0064] If yes, execute the first confirmation transaction: obtain the execution result of the first asset transfer transaction that succeeded in each consensus from the main chain;
[0065] Determine whether all execution results are successful:
[0066] If yes, the frozen assets will be deducted, or the frozen assets generated will be unfrozen;
[0067] If not, the frozen assets will be unfrozen, or the frozen assets generated will be deducted.
[0068] Specifically, assume that there is a main chain mainchain and ten parallel chains parachain1 to parachain10 (whose names are pc1 to pc10) in the blockchain network; take the identifier (including the first identifier and the second identifier) as the name of the parallel chain, and user A wants to transfer the 10 coins held on parachain1 to parachain3, and the 20 coins held on parachain2 to parachain4 as an example;
[0069] User A's client executes step S12. In response to user A's intention to transfer the 10 coins held on parachain1 to parachain3 and the 20 coins held on parachain2 to parachain4, an asset transfer transaction tx1 is generated. tx1 includes pc1, pc2, pc3, pc4, and the transaction content (account(A)_pc1, -10coin) executed by each parachain node of parachain1, the transaction content (account(A)_pc2, -20coin) executed by each parachain node of parachain2, the transaction content (account(A)_pc3, +10coin) executed by each parachain node of parachain3, and the transaction content (account(A)_pc4, +20coin) executed by each parachain node of parachain4.
[0070] User A's client executes step S14 and sends tx1 to the main chain;
[0071] The main chain node stores tx1; in more embodiments, the main chain node may also execute tx1, and record the first identifier and each first transaction content on the main chain (that is, record pc1, pc2, pc3, pc4, and (account(A)_pc1, -10coin), (account(A)_pc2, -20coin), (accoun t(A)_pc3, +10coin), (account(A)_pc4, +20coin) on the main chain);
[0072] Each parachain node of parachain1 to parachain10 determines whether the identifiers pc1, pc2, pc3, and pc4 in tx1 include the identifier of the parachain to which they belong:
[0073] tx1 includes pc1, then each parachain node of parachain1 executes (account(A)_pc1,-10coin) to freeze 10coin of account(A) on parachain1;
[0074] If tx1 includes pc2, each parachain node of parachain2 executes (account(A)_pc2,-20coin) to freeze 20coin of account(A) on parachain2.
[0075] If tx1 includes pc3, each parachain node of parachain3 executes (account(A)_pc3,+10coin), generates 10coin in account(A) on parachain3, and freezes the generated 10coin;
[0076] If tx1 includes pc4, each parachain node of parachain4 executes (account(A)_pc4,+20coin), generates 20coin in account(A) on parachain4, and freezes the generated 20coin;
[0077] If tx1 does not include pc5~pc10, the parachain nodes of parachain5~parachain10 will not execute tx1;
[0078] User A's client executes step S16. When all the parallel chain blocks including tx1 have reached consensus successfully on the main chain, a confirmation transaction tx2 including hash(tx1) is generated and sent to the main chain.
[0079] The main chain node stores tx2; in more embodiments, the main chain node can also execute tx2 and record hash (tx1) on the main chain;
[0080] Each parachain node from parachain1 to parachain10 determines whether tx1 is included in the parachain to which it belongs based on hash(tx1):
[0081] Since parachain1 to parachain4 include tx1, each parallel chain node of parachain1 to parac hain4 executes tx2: obtain the execution results of each consensus-successful tx1 from the main chain;
[0082] If all execution results are successful, each parachain node on parachain1 will deduct the 10 coins frozen in account(A) on parachain1; each parachain node on parachain2 will deduct the 20 coins frozen in account(A) on parachain2; each parachain node on parachain3 will unfreeze the 10 coins generated by freezing in account(A) on parachain3, that is, at this time, there are 10 coins in account(A) on parachain3; each parachain node on parachain4 will unfreeze the 20 coins generated by freezing in account(A) on parachain4, that is, at this time, there are 20 coins in account(A) on parachain4;
[0083] If the execution results are not all successful, each parachain node on parachain1 will unfreeze the 10 coins frozen in account(A) on parachain1; each parachain node on parachain2 will unfreeze the 20 coins frozen in account(A) on parachain2; each parachain node on parachain3 will deduct the 10 coins frozen in account(A) on parachain3; each parachain node on parachain4 will deduct the 20 coins frozen in account(A) on parachain4.
[0084] The above embodiment uses the example of user A wanting to transfer 10 coins held on parachain1 to parachain3 and 20 coins held on parachain2 to parachain4, which is identified as the name of the parachain, to exemplarily illustrate the asset transfer principle of the present invention.
[0085] In more embodiments, the identifier can also be configured as other parameters according to actual needs. For example, assuming that the game-type parachain is configured with an identifier M, and parachain1 to parachain4 are all game-type parachains, then the first identifier in the first asset transfer transaction is M, and the second identifier of parachain1 to parachain4 is also M. Each parachain node of parachain1 to parachain4 will execute the corresponding transaction content in tx1, and the same technical effect can be achieved.
[0086] It should be noted that the parachain node of each parachain can first synchronize the first asset transfer transaction from the main chain, and then determine whether the first identifier in the first asset transfer transaction includes the second identifier of the parachain to which it belongs; or first determine whether the first identifier in the first asset transfer transaction includes the second identifier of the parachain to which it belongs: if yes, synchronize the first asset transfer transaction from the main chain and execute it. This is not limited here.
[0087] It should be noted that the parachain nodes of each parachain in the present application actively obtain the first asset transfer transaction from the main chain. Those skilled in the art should be able to imagine that, when the main chain node can execute the first asset transfer transaction and the first confirmation transaction, the main chain node can identify the parachains parachain1 to parachain4 included in the first asset transfer transaction and the first confirmation transaction, and push the first asset transfer transaction and the first confirmation transaction to the connected parachain nodes of parachain1 to parachain4.
[0088] It should be noted that those skilled in the art should understand that the coins frozen, generated, and deducted by executing tx1 and tx2 in the above embodiments are only references; the names of assets on different parallel chains should be different. For example, the asset name of parachain1 is aaa, the asset name of parachain2 is bbb, the asset name of parachain3 is ccc, and the asset name of parachain4 is ddd. Taking the transaction content (account(A)_pc1,-10aaa) executed by each parachain node of parachain1 as an example, when executing tx1, each parachain node on parachain3 should generate a number of bbbs corresponding to 10aaa in account(A) on parachain3, or generate a pseudo 10aaa in account(A) on parachain3; and, when executing tx2, each parachain node on parachain3, if all execution results are successful, each parachain node on parachain3 will unfreeze the corresponding number of bbbs or pseudo 10aaa generated frozen in account(A) on parachain3; if all execution results are not successful, each parachain node on parachain3 will deduct the corresponding number of bbbs or pseudo 10aaa generated frozen in account(A) on parachain3.
[0089] The above embodiment enables related transaction contents to be executed simultaneously with less handling fee.
[0090] Preferably, the above method further comprises:
[0091] Generate a first transfer transaction; wherein the first transfer transaction is a transfer transaction of the first parachain or the second parachain;
[0092] Send the first transfer transaction to the main chain for each main chain node to:
[0093] Determine whether all parallel chain blocks including the first asset transfer transaction have successfully reached consensus on the main chain:
[0094] If not, the first transfer transaction will not be packaged for the time being.
[0095] Specifically, user A's client generates a transfer transaction tx3 (account(A)_pc3,account(B)_pc3,10coin);
[0096] User A's client sends tx3 to the main chain;
[0097] Each main chain node determines whether the parallel chain blocks including tx1 have all reached consensus successfully on the main chain:
[0098] If not, tx3 will not be packaged for the time being.
[0099] The above embodiment ensures that different transactions of the same user are executed serially.
[0100] It should be noted that those skilled in the art should be able to imagine that, when the main chain node can execute the first asset transfer transaction and the first confirmation transaction, the first transfer transaction is not packaged temporarily, including:
[0101] Determine whether the corresponding first transaction content is to deduct certain assets:
[0102] If yes, the first transfer transaction will not be packaged yet.
[0103] Figure 2 A flowchart of another asset transfer method provided by an embodiment of the present invention. Figure 2 As shown, in this embodiment, the present invention provides an asset transfer method applicable to a main chain node, and the method includes:
[0104] S22: Receive a first asset transfer transaction; wherein the first asset transfer transaction is generated by the first client of the first user in response to the first user transferring assets held on a plurality of first parallel chains to a plurality of second parallel chains, and the first asset transfer transaction includes a first identifier of each first parallel chain and each second parallel chain, and each first transaction content executed on each first parallel chain and each second parallel chain respectively; the first asset transfer transaction is also used for the parallel chain nodes of each parallel chain:
[0105] Determine whether the first identifier in the first asset transfer transaction includes the second identifier of the corresponding parallel chain:
[0106] If yes, the corresponding first transaction content is executed:
[0107] If the corresponding first transaction content is to deduct certain assets, then freeze certain assets;
[0108] If the corresponding first transaction content is to generate a number of assets, then generate a number of assets and freeze the generated assets; and,
[0109] Generate a consensus transaction of the parachain block including the first asset transfer transaction and send it to the main chain;
[0110] S24: Receive a first confirmation transaction including a transaction hash of the first asset transfer transaction; wherein the first confirmation transaction is generated by the first client when each parachain block including the first asset transfer transaction successfully reaches consensus on the main chain; the first confirmation transaction is also used for the parachain nodes of each parachain:
[0111] Determine whether the first asset transfer transaction is included on the parallel chain based on the transaction hash:
[0112] If yes, execute the first confirmation transaction: obtain the execution result of the first asset transfer transaction that succeeded in each consensus from the main chain;
[0113] Determine whether all execution results are successful:
[0114] If yes, the frozen assets will be deducted, or the frozen assets generated will be unfrozen;
[0115] If not, the frozen assets will be unfrozen, or the frozen assets generated will be deducted.
[0116] The asset transfer principle of the above embodiment can be referred to Figure 1 The method shown will not be repeated here.
[0117] Preferably, the above method further comprises:
[0118] Receiving a first transfer transaction; wherein the first transfer transaction is generated by the first client, and the first transfer transaction is a transfer transaction of the first parachain or the second parachain;
[0119] Determine whether all parallel chain blocks including the first asset transfer transaction have successfully reached consensus on the main chain:
[0120] If not, the first transfer transaction will not be packaged for the time being.
[0121] The asset transfer principle of the above embodiment can be referred to Figure 1 The method of a preferred embodiment shown is not described in detail here.
[0122] Figure 3 A flowchart of another asset transfer method provided by an embodiment of the present invention. Figure 3 As shown, in this embodiment, the present invention provides an asset transfer method applicable to a parallel chain node, and the method includes:
[0123] S31: Obtain a first asset transfer transaction from the main chain; wherein the first asset transfer transaction is generated by a first client of a first user in response to the first user transferring assets held on a plurality of first parallel chains to a plurality of second parallel chains, and the first asset transfer transaction includes a first identifier of each first parallel chain and each second parallel chain, and each first transaction content executed on each first parallel chain and each second parallel chain respectively;
[0124] S331: Determine whether the first identifier in the first asset transfer transaction includes the second identifier of the current parallel chain:
[0125] If yes, then execute step S332: execute the corresponding first transaction content:
[0126] If the corresponding first transaction content is to deduct certain assets, then freeze certain assets;
[0127] If the corresponding first transaction content is to generate a number of assets, then generate a number of assets and freeze the generated assets; and,
[0128] S333: Generate a consensus transaction of the parachain block including the first asset transfer transaction and send it to the main chain;
[0129] S35: Obtaining a first confirmation transaction including a transaction hash of the first asset transfer transaction from the main chain; wherein the first confirmation transaction is generated by the first client when all parallel chain blocks including the first asset transfer transaction have successfully reached consensus on the main chain;
[0130] S371: Determine whether the first asset transfer transaction is included on the corresponding parallel chain according to the transaction hash:
[0131] If yes, then execute step S372: execute the first confirmation transaction: obtain the execution result of the first asset transfer transaction that succeeded in each consensus from the main chain;
[0132] S391: Determine whether all execution results are successful:
[0133] If yes, then execute step S392: deduct the frozen assets, or unfreeze the frozen assets;
[0134] If not, execute step S393: unfreeze the frozen assets, or deduct the frozen generated assets.
[0135] The asset transfer principle of the above embodiment can be referred to Figure 1 The method shown will not be repeated here.
[0136] Figure 4 A schematic diagram of the structure of a device provided by an embodiment of the present invention. Figure 4 As shown, as another aspect, the present application also provides a device, including one or more central processing units (CPU) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage part 408 to the random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 are also stored. The CPU 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0137] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.
[0138] In particular, according to an embodiment of the present disclosure, the method described in any of the above embodiments can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing any of the above methods. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 409, and / or installed from a removable medium 411.
[0139] As another aspect, the present application also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus of the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the method described in the present application.
[0140] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a dedicated hardware-based system that performs a specified function or operation, or can be realized by a combination of dedicated hardware and computer instructions.
[0141] The units or modules involved in the embodiments described in the present application may be implemented by software or by hardware. The units or modules described may also be arranged in a processor. For example, each of the units may be a software program arranged in a computer or a mobile smart device, or may be a separately configured hardware device. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.
[0142] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the concept of the present application. For example, the above features are replaced with the technical features with similar functions disclosed in the present application (but not limited to) to form a technical solution.
Claims
1. An asset transfer method, characterized in that: Applicable to a client, the method includes: in response to a current user transferring assets held on a plurality of first parallel chains to a plurality of second parallel chains, generating a first asset transfer transaction; wherein the first asset transfer transaction includes a first identifier of each of the first parallel chains and each of the second parallel chains, and first transaction contents executed on each of the first parallel chains and each of the second parallel chains respectively; Send the first asset transfer transaction to the main chain for each parachain node of each parachain: Determine whether the first identifier in the first asset transfer transaction includes the second identifier of the parachain to which it belongs: If yes, execute the corresponding first transaction content: If the corresponding first transaction content is to deduct certain assets, then freeze the certain assets; If the corresponding first transaction content is to generate a number of assets, then generate the several assets and freeze the generated several assets; and generate a consensus transaction of the parachain block including the first asset transfer transaction and send it to the main chain; wherein the second identifier is the unique identity identifier of each of the first parachains and each of the second parachains; When all the parachain blocks including the first asset transfer transaction have successfully reached consensus on the main chain, a first confirmation transaction including the transaction hash of the first asset transfer transaction is generated and sent to the main chain for each parachain node of each parachain: judging whether the first asset transfer transaction is included on the parachain to which it belongs according to the transaction hash: if yes, executing the first confirmation transaction: obtaining the execution results of each first asset transfer transaction that has successfully reached consensus from the main chain; Determine whether all the execution results are successful: If yes, the frozen assets shall be deducted, or the frozen assets generated shall be unfrozen; If not, the frozen assets will be unfrozen, or the frozen assets generated will be deducted.
2. The method according to claim 1, characterized in that: Also includes: Generate a first transfer transaction; wherein the first transfer transaction is a transfer transaction of the first parachain or the second parachain; The first transfer transaction is sent to the main chain for each main chain node to determine whether each parallel chain block including the first asset transfer transaction has successfully reached consensus on the main chain: if not, the first transfer transaction will not be packaged for the time being.
3. An asset transfer method, characterized in that: Applicable to main chain nodes, the method includes: receiving a first asset transfer transaction; wherein the first asset transfer transaction is generated by a first client of a first user in response to the first user transferring assets held on a number of first parallel chains to a number of second parallel chains, and the first asset transfer transaction includes a first identifier of each of the first parallel chains and each of the second parallel chains, and each first transaction content executed on each of the first parallel chains and each of the second parallel chains respectively; the first asset transfer transaction is also used for the parallel chain nodes of each parallel chain: judging whether the first identifier in the first asset transfer transaction includes the second identifier of the corresponding parallel chain: if yes, executing the corresponding first transaction content: If the corresponding first transaction content is to deduct certain assets, then freeze the certain assets; If the corresponding first transaction content is to generate a number of assets, then generate the several assets and freeze the generated several assets; and generate a consensus transaction of the parachain block including the first asset transfer transaction and send it to the main chain; wherein the second identifier is the unique identity identifier of each of the first parachains and each of the second parachains; Receive a first confirmation transaction including the transaction hash of the first asset transfer transaction; wherein the first confirmation transaction is generated by the first client when each parachain block including the first asset transfer transaction has successfully reached consensus on the main chain; the first confirmation transaction is also used for the parachain nodes of each parachain: determine whether the first asset transfer transaction is included on the parachain to which it belongs according to the transaction hash: if yes, execute the first confirmation transaction: obtain the execution results of each first asset transfer transaction that has successfully reached consensus from the main chain; Determine whether all the execution results are successful: If yes, the frozen assets shall be deducted, or the frozen assets generated shall be unfrozen; If not, the frozen assets will be unfrozen, or the frozen assets generated will be deducted.
4. The method according to claim 3, characterized in that Also includes: Receive a first transfer transaction; wherein the first transfer transaction is generated by the first client, and the first transfer transaction is a transfer transaction of the first parachain or the second parachain; Determine whether all parallel chain blocks including the first asset transfer transaction have successfully reached consensus on the main chain: if not, the first transfer transaction will not be packaged for the time being.
5. An asset transfer method, characterized in that: Applicable to a parachain node, the method comprises: obtaining a first asset transfer transaction from a main chain; wherein the first asset transfer transaction is generated by a first client of a first user in response to the first user transferring assets held on a plurality of first parachains to a plurality of second parachains, and the first asset transfer transaction comprises a first identifier of each of the first parachains and each of the second parachains, and first transaction contents respectively executed on each of the first parachains and each of the second parachains; Determine whether the first identifier in the first asset transfer transaction includes the second identifier of the current parallel chain: if yes, execute the corresponding first transaction content: If the corresponding first transaction content is to deduct certain assets, then freeze the certain assets; If the corresponding first transaction content is to generate a number of assets, then generate the several assets, freeze the generated several assets, and generate a consensus transaction of the parachain block including the first asset transfer transaction and send it to the main chain; wherein the second identifier is the unique identity identifier of each of the first parachains and each of the second parachains; Obtaining a first confirmation transaction including the transaction hash of the first asset transfer transaction from the main chain; wherein the first confirmation transaction is generated by the first client when all the parachain blocks including the first asset transfer transaction have successfully reached consensus on the main chain; Determine whether the first asset transfer transaction is included on the parallel chain according to the transaction hash: if yes, execute the first confirmation transaction: obtain the execution results of the first asset transfer transactions that have succeeded in consensus from the main chain; Determine whether all the execution results are successful: If yes, the frozen assets shall be deducted, or the frozen assets generated shall be unfrozen; If not, the frozen assets will be unfrozen, or the frozen assets generated will be deducted.
6. A device, characterized in that: The device comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the method according to any one of claims 1 to 5.
7. A storage medium storing a computer program, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
