Third-party oracle-based verification method, computer device, and storage medium

By configuring oracle contracts and verification contracts on the main chain and monitoring deposit operation information through third-party oracles, asset information on the main chain is generated and verified, thus resolving the risk of asset loss, realizing the verification of the real existence of assets, and avoiding asset loss caused by the theft or cheating of private keys at the second layer.

CN115392919BActive Publication Date: 2025-11-28HANGZHOU FUZAMEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211066122.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-01
Publication Date
2025-11-28
Estimated Expiration
2042-09-01

AI Technical Summary

Technical Problem

In multiple main chain cross-chain solutions based on Layer 2 services, when users steal Layer 2 private keys or cheat at Layer 2, they cannot verify whether assets actually exist on the main chain, resulting in asset loss.

Method used

Configure oracle contracts and verification contracts on the main chain, and monitor deposit operation information through third-party oracles to generate and verify proof information to ensure the authenticity of assets and avoid asset losses caused by private key theft or Layer 2 fraud.

Benefits of technology

This enables verification of whether assets actually exist on the main chain when submitting asset proof at Layer 2, avoiding the risk of asset loss due to private key theft or Layer 2 cheating.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115392919B_ABST
    Figure CN115392919B_ABST
Patent Text Reader

Abstract

The application provides a third-party oracle-based verification method, a computer device and a storage medium. The method comprises the following steps: generating first proof information according to a first deposit transaction submitted to a second layer; wherein the first deposit transaction is used to request mapping of first digital assets deposited in a first main chain to the second layer; packaging a first verification transaction comprising the first proof information and sending it to a second main chain, so that a node of the second main chain executes the first verification transaction through a verification contract; the verification contract obtains a plurality of deposit operation information related to the first proof information from an oracle contract; the verification contract verifies the first proof information according to each obtained deposit operation information respectively; if all verifications fail, the first verification transaction fails, and an operation related to the mapping asset of the first digital asset in the second layer cannot be verified on the second main chain. The application avoids the risk of asset loss caused by theft of the private key of the second layer or cheating of the second layer.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of blockchains, in particular to a verification method based on a third-party oracle, a computer device and a storage medium. BACKGROUND

[0002] In the current multi-main-chain cross-chain solution based on a second layer service, assets on two main chains can be respectively mapped to the same second layer (Layer 2) and then exchanged.

[0003] For example, user A maps assets1 on main chain A to Layer 2, user B maps assets2 on main chain B to Layer 2, and user A and user B can exchange the mapped assets on Layer 2, user A extracts assets2 on main chain B according to the mapped assets obtained by the exchange, and user B extracts assets1 on main chain A according to the mapped assets obtained by the exchange.

[0004] The problem of the above solution is that when user A does not really have assets1 on main chain A, but illegally obtains the mapped assets of assets1 by stealing the private key of the second layer (or user A is a cheating second layer), main chain B can only allow user A to extract assets2 without verifying whether assets1 really exists on main chain A, thereby causing asset loss to user B. SUMMARY

[0005] In view of the above defects or deficiencies in the prior art, it is desirable to provide a verification method based on a third-party oracle to avoid the above asset loss risk, a computer device and a storage medium.

[0006] In a first aspect, the present application provides a verification method based on a third-party oracle suitable for a deposit verification node of a second layer;

[0007] The first main chain and the second main chain correspond to the same second layer;

[0008] The second main chain is configured with an oracle contract and a verification contract, and the oracle contract is configured to store deposit operation information of each deposit operation on the first main chain monitored by a third-party oracle;

[0009] The method comprises:

[0010] generating first proof information according to a first deposit transaction submitted to the second layer; wherein the first deposit transaction is used to request to map a first digital asset deposited in the first main chain to the second layer;

[0011] The first verification transaction including the first proof information is packaged and sent to the second main chain, so that a node of the second main chain executes the first verification transaction by verifying a contract:

[0012] The verification contract obtains, from the oracle contract, a plurality of deposit operation information related to the first proof information;

[0013] The verification contract verifies the first proof information according to the obtained deposit operation information respectively: if all the verifications fail, the first verification transaction fails, and an operation related to the mapping asset of the first digital asset in the second layer cannot be verified on the second main chain.

[0014] In a second aspect, the present application provides a third-party oracle-based verification method suitable for a node of a second main chain;

[0015] The first main chain and the second main chain correspond to the same second layer;

[0016] The second main chain is configured with an oracle contract and a verification contract, and the oracle contract is configured to store deposit operation information of each deposit operation monitored by a third-party oracle on the first main chain;

[0017] The method comprises:

[0018] The first verification transaction is executed by the verification contract:

[0019] The verification contract obtains, from the oracle contract, a plurality of deposit operation information related to the first proof information;

[0020] The verification contract verifies the first proof information according to the obtained deposit operation information respectively: if all the verifications fail, the first verification transaction fails, and an operation related to the mapping asset of the first digital asset in the second layer cannot be verified on the second main chain.

[0021] The first verification transaction is packaged and sent by a deposit verification node of the second layer according to the first deposit transaction submitted to the second layer to generate the first proof information, and the first deposit transaction is used to request to map the first digital asset deposited in the first main chain to the second layer.

[0022] In a third aspect, the present application further provides a computer device comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to execute the third-party oracle-based verification method provided by the embodiments of the present application.

[0023] In a fourth aspect, the present application further provides a storage medium storing a computer program, which causes a computer to execute the third-party oracle-based verification method provided by the embodiments of the present application.

[0024] The verification method based on the third-party oracle machine, the computer device and the storage medium provided by the embodiments of the present application can configure an oracle contract and a verification contract on a main chain that needs to be verified, and store deposit operation information of each deposit operation of another main chain in the oracle contract through a third-party oracle machine, so that the main chain can verify whether the asset is truly deposited on the another main chain when the second layer submits the proof information of the asset of the another main chain, thereby avoiding the risk of asset loss caused by theft of the private key of the second layer or cheating of the second layer. BRIEF DESCRIPTION OF DRAWINGS

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

[0026] Figure 1 A flowchart of a verification method based on a third-party oracle machine provided by an embodiment of the present application.

[0027] Figure 2 A flowchart of another verification method based on a third-party oracle machine provided by an embodiment of the present application.

[0028] Figure 3 A structural schematic diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0029] The present application will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related application, and not to limit the application. In addition, it should be noted that only the parts related to the application are shown in the drawings for ease of description.

[0030] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the drawings and embodiments.

[0031] Figure 1 A flowchart of a verification method based on a third-party oracle machine provided by an embodiment of the present application.

[0032] As shown in Figure 1 , in the present embodiment, the present application provides a verification method based on a third-party oracle machine suitable for a deposit verification node of a second layer;

[0033] The first main chain and the second main chain correspond to the same second layer;

[0034] The second main chain is configured with an oracle contract and a verification contract, and the oracle contract is configured to store deposit operation information of each deposit operation on the first main chain monitored by a third-party oracle machine;

[0035] The method comprises:

[0036] S11: generating first proof information according to a first deposit transaction submitted to the second layer; wherein the first deposit transaction is used to request mapping of a first digital asset deposited in the first main chain to the second layer;

[0037] S13: packaging the first verification transaction including the first proof information and sending it to the second main chain, so that the node of the second main chain executes the first verification transaction through the verification contract:

[0038] The verification contract obtains a plurality of deposit operation information related to the first proof information from the oracle contract;

[0039] The verification contract respectively verifies the first proof information according to each obtained deposit operation information: if all verifications fail, the first verification transaction fails, and the operation related to the mapped asset of the first digital asset in the second layer cannot be verified on the second main chain.

[0040] In the present application, the second layer (Layer2) can be configured to include a plurality of nodes, or can be configured to include only one node.

[0041] When the second layer is configured to include a plurality of nodes, one of the nodes can be fixedly configured as a deposit verification node, or a node can be dynamically determined as a deposit verification node through a preconfigured dynamic mechanism;

[0042] When the second layer is configured to include one node, the node is the deposit verification node.

[0043] The following takes the main chain A and the main chain B corresponding to the same second layer, and the main chain B being configured with the oracle contract and the verification contract as an example to exemplarily describe the above method.

[0044] The third-party oracle continuously monitors each deposit operation occurring on the main chain A, and submits deposit operation information of each monitored deposit operation to the oracle contract of the main chain B.

[0045] Specifically, in the present embodiment, the above deposit operation information includes the user address, the asset type and the asset quantity of the deposit operation. In more embodiments, the deposit operation information can also be configured to include a plurality of different information related to the deposit operation according to actual needs, for example, the corresponding transaction hash can also be included, etc., which can achieve the same technical effects.

[0046] For example, user A deposits an asset assets3 on the main chain A, and the third-party oracle can monitor the deposit operation and store the user address of assets3, the asset type of assets3 and the asset quantity of assets3 in the oracle contract of the main chain B.

[0047] For example, user A does not deposit assets4 on main chain A, but obtains the mapping asset of "assets4" by stealing the private key of the second layer, and the oracle contract of main chain B does not store the deposit operation information of "assets4".

[0048] When user A sends a deposit transaction tx1 to the second layer to request mapping of assets3 deposited on main chain A to the second layer:

[0049] In step S11, the deposit verification node of the second layer inputs the information of assets3 deposited on main chain A in deposit transaction tx1 into the proof algorithm of the zero-knowledge proof circuit to generate proof information prove1.

[0050] In step S13, the deposit verification node of the second layer generates a verification transaction tx2 according to proof information prove1 and sends it to main chain B.

[0051] The nodes of main chain B verify the execution of verification transaction tx2 through the verification contract:

[0052] The verification contract obtains some deposit operation information (for example, all deposit operation information in the corresponding time period, or all deposit operation information corresponding to the block height, etc.) related to proof information prove1 from the oracle contract.

[0053] The verification contract verifies proof information prove1 according to each deposit operation information respectively.

[0054] For example, after obtaining 10 deposit operation information s1-s10 from the oracle contract:

[0055] The verification algorithm outputs No and fails to verify when deposit operation information s1 and proof information prove1 are input into the verification algorithm of the zero-knowledge proof circuit.

[0056] The verification algorithm outputs No and fails to verify when deposit operation information s2 and proof information prove1 are input into the verification algorithm of the zero-knowledge proof circuit.

[0057] The verification algorithm outputs Yes and succeeds to verify when deposit operation information s7 and proof information prove1 are input into the verification algorithm of the zero-knowledge proof circuit (at this time, there is no need to verify prove1 according to s8-s10).

[0058] Then, verification transaction tx2 is successfully executed, and the operation related to the mapping asset of assets3 on the second layer can be verified on main chain B.

[0059] When user A sends a request to map "assets4" to the second layer to the second layer after sending deposit transaction tx3:

[0060] In step S11, the deposit verification node of the second layer inputs the "depositing several pieces of information of main chain A" of "assets4" in deposit transaction tx3 into the proof algorithm of the zero-knowledge proof circuit to generate proof information prove2;

[0061] In step S13, the deposit verification node of the second layer packs and generates verification transaction tx4 according to proof information prove2 and sends it to main chain B.

[0062] The node of main chain B verifies verification transaction tx4 through the verification contract:

[0063] The verification contract obtains several deposit operation information related to proof information prove2 from the oracle contract, for example, 15 pieces of deposit operation information s11-s25;

[0064] The verification contract verifies proof information prove2 according to each piece of deposit operation information respectively:

[0065] The deposit operation information s11 and the proof information prove2 are input into the verification algorithm of the zero-knowledge proof circuit for verification, and the verification algorithm outputs No, which means verification failure;

[0066] The deposit operation information s12 and the proof information prove2 are input into the verification algorithm of the zero-knowledge proof circuit for verification, and the verification algorithm outputs No, which means verification failure;

[0067] The deposit operation information s25 and the proof information prove2 are input into the verification algorithm of the zero-knowledge proof circuit for verification, and the verification algorithm outputs No, which means verification failure;

[0068] If all the verifications fail, the verification transaction tx4 fails to execute, and the operation related to the mapping asset of "assets4" in the second layer cannot be verified on main chain B.

[0069] It should be noted that the above embodiment takes the example of main chain B being configured with an oracle contract and a verification contract, and the deposit operation of main chain A being verified on main chain B for example;

[0070] In another embodiment, an oracle contract and a verification contract can also be configured on two main chains respectively, and the deposit operations on the other main chain can be verified, which can achieve the same technical effect.

[0071] The above embodiment configures a prediction contract and a verification contract on the main chain that needs to be verified, and stores deposit operation information of each deposit operation on another main chain into the prediction contract through a third-party prediction machine, so that the main chain can verify whether the asset is truly deposited on another main chain when the second layer submits the proof information of the asset of another main chain, thereby avoiding the risk of asset loss caused by theft of the private key of the second layer or cheating of the second layer.

[0072] Figure 2 The flowchart of another third-party prediction machine-based verification method provided by an embodiment of the present application is shown. Figure 2 The method shown can be performed in cooperation with Figure 1 The method shown is executed.

[0073] As shown in the method shown in the embodiment, the present application also provides a third-party prediction machine-based verification method suitable for a node of a second main chain; Figure 2 As shown in the embodiment, the present application also provides a third-party prediction machine-based verification method suitable for a node of a second main chain;

[0074] The first main chain and the second main chain correspond to the same second layer;

[0075] The second main chain is configured with a prediction contract and a verification contract, and the prediction contract is configured to store deposit operation information of each deposit operation on the first main chain monitored by a third-party prediction machine;

[0076] The method includes:

[0077] S21: Execute the first verification transaction through the verification contract:

[0078] S211: The verification contract obtains a plurality of deposit operation information related to the first proof information from the prediction contract;

[0079] S213: The verification contract respectively verifies the first proof information according to the obtained deposit operation information: if all the verifications fail, step S215 is executed: the first verification transaction fails, and the operation related to the mapped asset of the first digital asset on the second layer cannot be verified on the second main chain.

[0080] The first verification transaction is packaged and sent by a deposit verification node of the second layer according to the first proof information generated after the first deposit transaction submitted to the second layer, and the first deposit transaction is used to request to map the first digital asset deposited in the first main chain to the second layer.

[0081] Preferably, the deposit operation information of the deposit operation includes a user address, an asset type, and an asset quantity.

[0082] Figure 2 The verification principle of the method shown can refer to the method shown, which will not be described here. Figure 1 The method shown, which will not be described here.

[0083] Figure 3 A structural schematic diagram of a computer device is provided for an embodiment of the present application.

[0084] As shown in Figure 3 As another aspect, the present application provides a computer device, which includes one or more central processing units (CPUs) 301 that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 302 or programs loaded from a storage portion 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the device 300 are also stored. The CPU 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0085] The following components are connected to the I / O interface 305: an input portion 306 including a keyboard, a mouse, and the like; an output portion 307 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker, and the like; a storage portion 308 including a hard disk, and the like; and a communication portion 309 including a network interface card such as a LAN card, a modem, and the like. The communication portion 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as necessary. A removable media 311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is attached to the drive 310 as necessary, so that a computer program read therefrom is installed into the storage portion 308 as necessary.

[0086] In particular, according to embodiments of the present disclosure, the method described in any of the above embodiments can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for executing any of the above methods. In such embodiments, the computer program can be downloaded and installed from a network via the communication portion 309, and / or installed from the removable media 311.

[0087] As still another aspect, the present application provides a computer-readable storage medium, which can be the computer-readable storage medium included in the apparatus of the above embodiments; or can exist separately from the apparatus and not be assembled into the apparatus. The computer-readable storage medium stores one or more programs, which are executed by one or more processors to perform the method described in the present application.

[0088] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified function or operation, or by a combination of dedicated hardware and computer instructions.

[0089] The units or modules described in the embodiments of this application can be implemented in software or hardware. The described units or modules can also be located in a processor; for example, each unit can be a software program located in a computer or mobile smart device, or it can be a separately configured hardware device. The names of these units or modules do not, in certain circumstances, constitute a limitation on the unit or module itself.

[0090] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the concept of this application. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A verification method based on a third-party oracle, characterized in that, The first main chain and the second main chain correspond to the same second layer (Layer 2); The second main chain is configured with an oracle contract and a verification contract. The oracle contract is configured to store deposit operation information of each deposit operation on the first main chain as monitored by the third-party oracle. The method is applicable to the deposit verification node of the second layer, and the method includes: First proof information is generated based on the first deposit transaction submitted to the second layer; wherein, the first deposit transaction is used to request the mapping of the first digital asset deposited in the first main chain to the second layer; In this process, the deposit verification node of the second layer inputs several pieces of information about the assets deposited in the first deposit transaction into the proof algorithm of the zero-knowledge proof circuit to generate the first proof information. The first verification transaction, including the first proof information, is packaged and sent to the second main chain, so that nodes on the second main chain can execute the first verification transaction through the verification contract: In this process, the deposit verification node of the second layer packages and generates the first verification transaction based on the first proof information and sends it to the second main chain; The verification contract obtains several deposit operation information related to the first proof information from the oracle contract; The verification contract verifies the first proof information based on the obtained deposit operation information. If all verifications fail, the first verification transaction fails, and the operation related to the first digital asset's mapping asset in the second layer cannot be verified on the second main chain. Oracle contracts and verification contracts are configured on two main chains respectively, and they mutually verify deposit operations on the other main chain.

2. The method according to claim 1, characterized in that, The deposit operation information includes the user's address, asset type, and asset quantity.

3. A verification method based on a third-party oracle, characterized in that, The first main chain and the second main chain correspond to the same second layer (Layer 2); The method is applicable to nodes of the second main chain, and the method includes: Execute the first verification transaction through the verification contract: The verification contract verifies the first proof information based on the obtained deposit operation information. If all verifications fail, the first verification transaction fails, and the operation related to the mapping asset of the first digital asset in the second layer cannot be verified on the second main chain. The first verification transaction is generated and sent by the deposit verification node of the second layer after generating the first proof information based on the first deposit transaction submitted to the second layer. The first deposit transaction is used to request the mapping of the first digital asset deposited in the first main chain to the second layer.

4. The method according to claim 3, characterized in that, The deposit operation information includes the user's address, asset type, and asset quantity.

5. A computer device, characterized in that, The device includes: One or more processors; Memory, used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors perform the method as described in any one of claims 1-4.

6. A storage medium storing a computer program, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Cross-chain exchange method and system based on credible oracle machine and medium

    CN111145023A

  • Oracle machine multi-main-chain cross-chain method and device and storage medium

    CN114202425A