Cross-chain system, method, device and storage medium

By establishing a cross-chain system between the relay chain, cross-chain gateway and application chain, the problem that the relay chain cannot be heterogeneous and cross-chain is solved, and effective verification and processing of cross-chain transactions are realized.

CN114443759BActive Publication Date: 2025-02-18HANGZHOU QULIAN TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111589440.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-23
Publication Date
2025-02-18
Estimated Expiration
2041-12-23

AI Technical Summary

Technical Problem

In the prior art, the relay chain itself cannot be heterogeneous cross-chain, and lacks a mechanism to verify cross-chain transactions, resulting in the inability to complete cross-chain transactions.

Method used

By establishing a cross-chain system between the relay chain, cross-chain gateway and application chain, the relay chain calls the target business contract to initiate cross-chain transaction events and generates cross-chain transaction proof data, the cross-chain gateway constructs cross-chain transaction data and sends it to 应用链,应用链验证跨链交易数据的有效性并处理数据。

Benefits of technology

The problem that the relay chain itself cannot heterogeneous cross-chain cross-chain is solved. By generating and verifying cross-chain transaction proof data, the validity and sequence of cross-chain transactions are ensured, and the effective processing of cross-chain transactions is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114443759B_ABST
    Figure CN114443759B_ABST
Patent Text Reader

Abstract

The present application relates to a cross-chain system, method, device and storage medium, wherein the system includes: a relay chain, a cross-chain gateway and an application chain; the relay chain is used to call the target business contract to initiate a cross-chain transaction event, generate cross-chain transaction proof data, and send the cross-chain transaction event and the cross-chain transaction proof data to the cross-chain gateway; the cross-chain gateway is used to generate cross-chain transaction data according to the cross-chain transaction event and the cross-chain transaction proof data, and send the cross-chain transaction data to the application chain; the application chain is used to verify the validity of the cross-chain transaction data, and when the cross-chain transaction data is verified to be valid, process the cross-chain transaction data. The present application is used to solve the problem in the prior art that the relay chain itself cannot be heterogeneous cross-chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain, and in particular to a cross-chain system, method, device and storage medium. Background Art

[0002] As blockchain technology continues to mature, more and more blockchains are using cross-chain technology for interoperable access and collaboration. Currently, cross-chain interoperability mainly uses relay chain technology. The main principles of this technology are as follows: The relay chain technology system contains three components: relay chain, cross-chain gateway and application chain. The cross-chain gateway of the source application chain collects the cross-chain transactions of the source application chain, and then submits the cross-chain transactions to the relay chain for verification and routing. After successful verification, the cross-chain gateway of the destination application chain will hand it over to the destination application chain to execute the cross-chain transaction.

[0003] In the existing technology, the relay chain is actually also a blockchain. As an important component of the cross-chain system, the relay chain has the problem that it cannot perform heterogeneous cross-chain. Summary of the invention

[0004] The present application provides a cross-chain system, method, device and storage medium to solve the problem in the prior art that the relay chain itself cannot perform heterogeneous cross-chain.

[0005] In a first aspect, an embodiment of the present application provides a cross-chain system, including: a relay chain, a cross-chain gateway, and an application chain;

[0006] The relay chain is used to call the target business contract to initiate a cross-chain transaction event, generate cross-chain transaction proof data, and send the cross-chain transaction event and the cross-chain transaction proof data to the cross-chain gateway;

[0007] The cross-chain gateway is used to generate cross-chain transaction data according to the cross-chain transaction event and the cross-chain transaction proof data, and send the cross-chain transaction data to the application chain;

[0008] The application chain is used to verify the validity of the cross-chain transaction data, and when the cross-chain transaction data is verified to be valid, process the cross-chain transaction data.

[0009] Optionally, the application chain is used to verify the cross-chain transaction data according to the multi-signature information. When the verification passes, the cross-chain number index is read from the cross-chain transaction data. When the difference between the cross-chain number index and the current latest cross-chain transaction index in the application chain is a preset value, the cross-chain transaction data is determined to be valid, and the current latest cross-chain transaction index is incremented by the preset value.

[0010] Optionally, the application chain is also used to call the business contract of the application chain to generate a receipt cross-chain transaction event after processing the cross-chain transaction data, and send the receipt cross-chain transaction event to the cross-chain gateway.

[0011] Optionally, the cross-chain gateway is also used to search for the cross-chain transaction event and the cross-chain transaction proof data corresponding to the receipt cross-chain transaction event according to the receipt cross-chain transaction event, and generate the receipt cross-chain transaction data according to the receipt cross-chain transaction event, the cross-chain transaction event and the cross-chain transaction proof data, and send the receipt cross-chain transaction data to the relay chain.

[0012] Optionally, the relay chain is also used to verify the validity of the receipt cross-chain transaction data. When verifying that the receipt cross-chain transaction data is valid, the current latest receipt cross-chain transaction index of the relay chain is incremented, and the target business contract is called to process the receipt cross-chain transaction data.

[0013] In a second aspect, an embodiment of the present application provides a cross-chain method, applicable to a relay chain, the method comprising:

[0014] Call the target business contract to initiate a cross-chain transaction event, generate cross-chain transaction proof data, and send the cross-chain transaction event and the cross-chain transaction proof data to the cross-chain gateway, so that the cross-chain gateway generates cross-chain transaction data according to the cross-chain transaction event and the cross-chain transaction proof data, and sends the cross-chain transaction data to the application chain.

[0015] Optionally, after sending the cross-chain transaction event and the cross-chain transaction proof data to the cross-chain gateway, the method further includes:

[0016] Obtaining the receipt cross-chain transaction data sent by the cross-chain gateway; wherein the receipt cross-chain transaction data is generated according to the receipt cross-chain transaction event, the cross-chain transaction event and the cross-chain transaction proof data; wherein the receipt cross-chain transaction event is generated by the application chain calling the business contract of the application chain after the application chain processes the cross-chain transaction data;

[0017] Verify the validity of the receipt cross-chain transaction data. When verifying that the receipt cross-chain transaction data is valid, increment the current latest receipt cross-chain transaction index of the relay chain, call the target business contract, and process the receipt cross-chain transaction data.

[0018] In a third aspect, an embodiment of the present application provides a cross-chain method, applicable to a cross-chain gateway, the method comprising:

[0019] Obtain cross-chain transaction events and cross-chain transaction proof data sent by the relay chain;

[0020] Generate cross-chain transaction data according to the cross-chain transaction event and the cross-chain transaction proof data, send the cross-chain transaction data to the application chain, so that the application chain can verify the validity of the cross-chain transaction data, and process the cross-chain transaction data when verifying that the cross-chain transaction data is valid.

[0021] Optionally, after sending the cross-chain transaction data to the application chain, the method further includes:

[0022] Obtain a receipt cross-chain transaction event; wherein the receipt cross-chain transaction event is generated by the application chain calling the business contract after the application chain processes the cross-chain transaction data;

[0023] According to the receipt cross-chain transaction event, the cross-chain transaction event and the cross-chain transaction proof data corresponding to the receipt cross-chain transaction event are searched, and the receipt cross-chain transaction data is generated according to the receipt cross-chain transaction event, the cross-chain transaction event and the cross-chain transaction proof data, and the receipt cross-chain transaction data is sent to the relay chain.

[0024] In a fourth aspect, an embodiment of the present application provides a cross-chain method applicable to application chains, the method comprising:

[0025] Obtain cross-chain transaction data sent by the cross-chain gateway; wherein the cross-chain transaction data is generated by the cross-chain gateway according to the cross-chain transaction event and cross-chain transaction proof data sent by the relay chain; verify the validity of the cross-chain transaction data, and when verifying that the cross-chain transaction data is valid, process the cross-chain transaction data.

[0026] Optionally, verifying the validity of the cross-chain transaction data includes:

[0027] Verify the cross-chain transaction data according to the multi-signature information. When the verification passes, read the cross-chain transaction number index from the cross-chain transaction data. When the difference between the cross-chain transaction number index and the current latest cross-chain transaction index in the application chain is a preset value, determine that the cross-chain transaction data is valid; otherwise, determine that the cross-chain transaction data is invalid;

[0028] After verifying that the cross-chain transaction data is valid, the method further includes:

[0029] Increment the current latest cross-chain transaction index by the preset value;

[0030] The business contract of the application chain is called to generate a receipt cross-chain transaction event, and the receipt cross-chain transaction event is sent to the cross-chain gateway.

[0031] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a communication bus, wherein the processor and the memory communicate with each other via the communication bus;

[0032] The memory is used to store computer programs;

[0033] The processor is used to execute the program stored in the memory to implement the cross-chain method described in the second aspect, the third aspect, or the fourth aspect.

[0034] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the cross-chain method described in the second aspect, the third aspect, or the fourth aspect.

[0035] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application generates corresponding cross-chain transaction proof data when the relay chain initiates a cross-chain transaction event, and the cross-chain transaction data constructed by the cross-chain gateway contains cross-chain transaction proof data, so that the application chain can verify the validity of the cross-chain transaction data and process the cross-chain transaction data. In the embodiment of the present application, corresponding transaction proof data is provided for the cross-chain transaction of the relay chain to verify the validity of the cross-chain transaction, solving the problem that the relay chain itself cannot perform heterogeneous cross-chain. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0038] Figure 1 A schematic diagram of the structure of a cross-chain system provided in an embodiment of the present application;

[0039] Figure 2 A schematic diagram of the process of an entire cross-chain transaction in a cross-chain system provided in an embodiment of the present application;

[0040] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0042] In the prior art, if the relay chain initiates a cross-chain transaction, it also lacks a corresponding verification mechanism and cannot complete the cross-chain transaction, resulting in the problem that the existing relay chain itself cannot be heterogeneous cross-chain. In order to solve the problem that the relay chain itself cannot be heterogeneous cross-chain in the prior art, the embodiment of the present application provides a cross-chain system, such as Figure 1 As shown, the cross-chain system mainly includes: a relay chain 101, a cross-chain gateway 102 and an application chain 103;

[0043] Among them, application chain 103 registers the address information (also called ID) of application chain 103 with relay chain 101 through cross-chain gateway 102, and application chain 103 has all node address information of relay chain 101. When the business contract is called on relay chain 101 to initiate a cross-chain transaction, the destination chain of the cross-chain transaction is application chain 103. Cross-chain gateway 102 is the adapter between application chain 103 and relay chain 101. Its function is to capture cross-chain transaction events from source relay chain 101 or application chain 103 and submit cross-chain transactions to the destination chain.

[0044] In the cross-chain system, the relay chain 101 is used to call the target business contract to initiate a cross-chain transaction event, generate cross-chain transaction proof data, and send the cross-chain transaction event and the cross-chain transaction proof data to the cross-chain gateway 102;

[0045] The cross-chain gateway 102 is used to generate cross-chain transaction data according to the cross-chain transaction event and the cross-chain transaction proof data, and send the cross-chain transaction data to the application chain 103;

[0046] The cross-chain transaction data includes the source chain ID, the destination chain ID, the cross-chain frequency index, the cross-chain call information, the cross-chain transaction proof data, etc. For the cross-chain transaction initiated by the relay chain 101, the source chain ID is the ID of the relay chain 101, the destination chain ID is the ID of the application chain 103, and the cross-chain frequency index is used to record the number of cross-chain transactions of the current cross-chain transaction. The cross-chain frequency index can ensure the order of cross-chain transactions.

[0047] The application chain 103 is used to verify the validity of the cross-chain transaction data, and when the cross-chain transaction data is verified to be valid, process the cross-chain transaction data.

[0048] In the embodiment of the present application, cross-chain transaction data refers to the data transmitted when the cross-chain performs interoperable access and collaboration. In the specific implementation, when verifying the validity of the cross-chain transaction data, the application chain 103 can verify the cross-chain transaction data according to the multi-signature information. Among them, in the specific implementation, the relay chain 101, the cross-chain gateway 102 and the application chain 103 pre-agree on the multi-signature information to verify the received data.

[0049] When the verification passes, the application chain 103 reads the cross-chain number index from the cross-chain transaction data. When the difference between the cross-chain number index and the current latest cross-chain transaction index in the application chain 103 is a preset value, the cross-chain transaction data is determined to be valid, and the current latest cross-chain transaction index is incremented by the preset value.

[0050] In specific implementation, the preset value is usually set to 1, and of course it can also be set to other values. For ease of understanding, an example is given here. Assuming that the preset value is 1, if the cross-chain number index read from the cross-chain transaction data is 6, and the current latest cross-chain transaction index of application chain 103 is 5, the difference is 1, which meets the conditions, indicating that the cross-chain transaction data with a cross-chain number index of 6 should be processed according to the order of cross-chain transactions, and the cross-chain transaction data is valid data. At this time, the current latest cross-chain transaction index of application chain 103 is updated and incremented by 1. If the difference is greater than 1 or less than 1, it means that this cross-chain transaction data is early data or expired data, and the cross-chain transaction data will not be processed.

[0051] In the embodiment of the present application, the orderliness of cross-chain transactions can be maintained through the cross-chain number index.

[0052] In a specific embodiment, after verifying that the cross-chain transaction data is valid and processing the cross-chain transaction data, the business contract of the application chain 103 is called to generate a receipt cross-chain transaction event, and the receipt cross-chain transaction event is sent to the cross-chain gateway 102.

[0053] Among them, the main function of the receipt cross-chain transaction event is that the application chain 103 notifies the relay chain 101 that the cross-chain transaction data sent by the relay chain 101 has been processed.

[0054] For the cross-chain gateway 102, the cross-chain gateway 102 searches for the cross-chain transaction event and the cross-chain transaction proof data corresponding to the receipt cross-chain transaction event according to the receipt cross-chain transaction event, generates the receipt cross-chain transaction data according to the receipt cross-chain transaction event, the cross-chain transaction event and the cross-chain transaction proof data, and sends the receipt cross-chain transaction data to the relay chain 101.

[0055] In specific implementation, the source chain ID, destination chain ID, receipt cross-chain number index, etc. can be carried in the receipt cross-chain transaction event. Specifically, in the embodiment of the present application, at this time, the source chain ID in the receipt cross-chain transaction event is the ID of the application chain 103, the destination chain ID is the ID of the relay chain 101, and the receipt cross-chain number index can be obtained according to the latest cross-chain transaction index of the application chain 103. When the cross-chain gateway 102 receives the receipt cross-chain transaction event, the matching cross-chain transaction event and the cross-chain transaction proof data are searched from the data stored in the cross-chain gateway 102 through the source chain ID, destination chain ID, receipt cross-chain transaction index, etc., and the receipt cross-chain transaction data is constructed. The cross-chain gateway 102 submits the receipt cross-chain transaction data to the relay chain 101.

[0056] In a specific embodiment, after receiving the receipt cross-chain transaction data, the relay chain 101 verifies the validity of the receipt cross-chain transaction data. When verifying that the receipt cross-chain transaction data is valid, the current latest receipt cross-chain transaction index of the relay chain 101 is incremented, and the target business contract is called to process the receipt cross-chain transaction data.

[0057] Among them, when verifying the validity of the receipt cross-chain transaction data, it is similar to the aforementioned method of verifying the validity of the cross-chain transaction. On the one hand, it is verified through multi-signature information, and on the other hand, the receipt cross-chain number index is read from the receipt cross-chain transaction data, and the current latest receipt cross-chain transaction index is read from the relay chain 101. If the difference between the receipt cross-chain number index and the current latest receipt cross-chain transaction index is a preset value, the receipt cross-chain transaction data is determined to be valid.

[0058] When the receipt cross-chain transaction data is determined to be valid, the current latest receipt cross-chain transaction index of the relay chain 101 is incremented, and the target business contract is called to process the receipt cross-chain transaction data. Specifically, the current latest receipt cross-chain transaction index is incremented by a preset value, for example, the preset value is 1.

[0059] In a specific embodiment, a cross-chain management module can be separately set up for the relay chain 101 to provide services such as business contract review, cross-chain transaction sorting, and cross-chain transaction verification.

[0060] In the embodiment of the present application, when the relay chain initiates a cross-chain transaction event, the corresponding cross-chain transaction proof data is generated, and the cross-chain transaction data constructed by the cross-chain gateway contains the cross-chain transaction proof data, so that the application chain can verify the validity of the cross-chain transaction data and process the cross-chain transaction data. In the embodiment of the present application, the corresponding transaction proof data is provided for the cross-chain transaction of the relay chain to verify the validity of the cross-chain transaction, which solves the problem that the relay chain itself cannot perform heterogeneous cross-chain.

[0061] like Figure 2 As shown, Figure 2 The entire cross-chain transaction process of the cross-chain system is shown, which specifically includes the following steps:

[0062] 1. The relay chain calls the business contract to initiate a cross-chain transaction. The relay chain cross-chain management module executes the transaction and constructs proof data that the transaction is valid. After the execution is completed, the block is confirmed.

[0063] 2. The cross-chain gateway captures the cross-chain transaction events and corresponding cross-chain transaction proof data of the relay chain and constructs them into cross-chain transaction data.

[0064] 3. The cross-chain gateway submits cross-chain transaction data from the relay chain to the application chain.

[0065] 4. The application chain verifies the validity of cross-chain transaction data.

[0066] 5. After the application chain is verified, the cross-chain transaction index is automatically incremented, and the business contract of the application chain is called to throw a receipt cross-chain transaction event.

[0067] 6. The cross-chain gateway captures the receipt cross-chain transaction events and corresponding cross-chain transaction proof data of the application chain, and constructs the receipt cross-chain transaction data.

[0068] 7. The cross-chain gateway submits the receipt cross-chain transaction data from the application chain to the relay chain.

[0069] 8. The relay chain verifies the validity of the receipt cross-chain transaction data.

[0070] 9. After the cross-chain management module is verified, the receipt cross-chain transaction index will be automatically increased.

[0071] 10. Call the business contract of the relay chain to process the specific content of the receipt cross-chain transaction data.

[0072] Based on the same technical concept, a cross-chain method is provided in an embodiment of the present application, which is applicable to the relay chain, and the method includes:

[0073] Call the target business contract to initiate a cross-chain transaction event, generate cross-chain transaction proof data, and send the cross-chain transaction event and the cross-chain transaction proof data to the cross-chain gateway, so that the cross-chain gateway generates cross-chain transaction data according to the cross-chain transaction event and the cross-chain transaction proof data, and sends the cross-chain transaction data to the application chain.

[0074] In a specific embodiment, after sending the cross-chain transaction event and the cross-chain transaction proof data to the cross-chain gateway, it also includes:

[0075] Obtaining the receipt cross-chain transaction data sent by the cross-chain gateway; wherein the receipt cross-chain transaction data is generated according to the receipt cross-chain transaction event, the cross-chain transaction event and the cross-chain transaction proof data; wherein the receipt cross-chain transaction event is generated by the application chain calling the business contract of the application chain after the application chain processes the cross-chain transaction data;

[0076] Verify the validity of the receipt cross-chain transaction data. When verifying that the receipt cross-chain transaction data is valid, increment the current latest receipt cross-chain transaction index of the relay chain, call the target business contract, and process the receipt cross-chain transaction data.

[0077] Based on the same technical concept, a cross-chain method is provided in an embodiment of the present application, which is applicable to a cross-chain gateway, and the method includes:

[0078] Obtain cross-chain transaction events and cross-chain transaction proof data sent by the relay chain;

[0079] Generate cross-chain transaction data according to the cross-chain transaction event and the cross-chain transaction proof data, send the cross-chain transaction data to the application chain, so that the application chain can verify the validity of the cross-chain transaction data, and process the cross-chain transaction data when verifying that the cross-chain transaction data is valid.

[0080] In a specific embodiment, after sending the cross-chain transaction data to the application chain, it also includes:

[0081] Obtain a receipt cross-chain transaction event; wherein the receipt cross-chain transaction event is generated by the application chain calling the business contract after the application chain processes the cross-chain transaction data;

[0082] According to the receipt cross-chain transaction event, the cross-chain transaction event and the cross-chain transaction proof data corresponding to the receipt cross-chain transaction event are searched, and the receipt cross-chain transaction data is generated according to the receipt cross-chain transaction event, the cross-chain transaction event and the cross-chain transaction proof data, and the receipt cross-chain transaction data is sent to the relay chain.

[0083] Based on the same technical concept, a cross-chain method is provided in an embodiment of the present application, which is applicable to application chains, and the method includes:

[0084] Obtain cross-chain transaction data sent by the cross-chain gateway; wherein the cross-chain transaction data is generated by the cross-chain gateway according to the cross-chain transaction event and cross-chain transaction proof data sent by the relay chain; verify the validity of the cross-chain transaction data, and when verifying that the cross-chain transaction data is valid, process the cross-chain transaction data.

[0085] In a specific embodiment, verifying the validity of the cross-chain transaction data includes:

[0086] Verify the cross-chain transaction data according to the multi-signature information. When the verification passes, read the cross-chain transaction number index from the cross-chain transaction data. When the difference between the cross-chain transaction number index and the current latest cross-chain transaction index in the application chain is a preset value, determine that the cross-chain transaction data is valid; otherwise, determine that the cross-chain transaction data is invalid;

[0087] After verifying that the cross-chain transaction data is valid, the method further includes:

[0088] Increment the current latest cross-chain transaction index by the preset value;

[0089] The business contract of the application chain is called to generate a receipt cross-chain transaction event, and the receipt cross-chain transaction event is sent to the cross-chain gateway.

[0090] For an understanding of the above cross-chain method, please refer to the description of the above cross-chain system, and the repeated parts will not be repeated here.

[0091] Based on the same concept, a cross-chain device is provided in the embodiment of the present application, which is applicable to the relay chain. The specific implementation of the device can be found in the description of the system embodiment part, and the repeated parts will not be repeated. The device mainly includes:

[0092] The calling module is used to call the target business contract to initiate a cross-chain transaction event and generate cross-chain transaction proof data.

[0093] A sending module is used to send the cross-chain transaction event and the cross-chain transaction proof data to the cross-chain gateway, so that the cross-chain gateway generates cross-chain transaction data according to the cross-chain transaction event and the cross-chain transaction proof data, and sends the cross-chain transaction data to the application chain.

[0094] In a specific embodiment, a cross-chain device is provided in the embodiment of the present application, further comprising:

[0095] A first acquisition module is used to acquire the receipt cross-chain transaction data sent by the cross-chain gateway; wherein the receipt cross-chain transaction data is generated according to the receipt cross-chain transaction event, the cross-chain transaction event and the cross-chain transaction proof data; wherein the receipt cross-chain transaction event is generated by the application chain calling the business contract of the application chain after the application chain processes the cross-chain transaction data;

[0096] The first verification module is used to verify the validity of the receipt cross-chain transaction data. When verifying that the receipt cross-chain transaction data is valid, the current latest receipt cross-chain transaction index of the relay chain is incremented, and the target business contract is called to process the receipt cross-chain transaction data.

[0097] Based on the same concept, a cross-chain device is provided in the embodiment of the present application, which is applicable to a cross-chain gateway. The specific implementation of the device can be found in the description of the system embodiment part, and the repeated parts will not be repeated. The device mainly includes:

[0098] The second acquisition module is used to obtain the cross-chain transaction events and cross-chain transaction proof data sent by the relay chain;

[0099] A generation module is used to generate cross-chain transaction data according to the cross-chain transaction event and the cross-chain transaction proof data, send the cross-chain transaction data to the application chain for the application chain to verify the validity of the cross-chain transaction data, and process the cross-chain transaction data when verifying that the cross-chain transaction data is valid.

[0100] In a specific embodiment, a cross-chain device is provided in the embodiment of the present application, further comprising:

[0101] A third acquisition module is used to acquire a receipt cross-chain transaction event; wherein the receipt cross-chain transaction event is generated by the application chain calling the business contract after the application chain processes the cross-chain transaction data;

[0102] A receipt module is used to search for the cross-chain transaction event and the cross-chain transaction proof data corresponding to the receipt cross-chain transaction event according to the receipt cross-chain transaction event, and generate receipt cross-chain transaction data according to the receipt cross-chain transaction event, the cross-chain transaction event and the cross-chain transaction proof data, and send the receipt cross-chain transaction data to the relay chain.

[0103] Based on the same concept, a cross-chain device is provided in the embodiment of the present application, which is applicable to the application chain. The specific implementation of the device can refer to the description of the system embodiment part, and the repeated parts will not be repeated. The device mainly includes:

[0104] A fifth acquisition module is used to acquire cross-chain transaction data sent by the cross-chain gateway; wherein the cross-chain transaction data is generated by the cross-chain gateway according to the cross-chain transaction event and cross-chain transaction proof data sent by the relay chain;

[0105] The second verification module is used to verify the validity of the cross-chain transaction data, and when the cross-chain transaction data is verified to be valid, process the cross-chain transaction data.

[0106] In a specific embodiment, the second verification module is used to verify the cross-chain transaction data according to the multi-signature information. When the verification passes, the cross-chain number index is read from the cross-chain transaction data. When the difference between the cross-chain number index and the current latest cross-chain transaction index in the application chain is a preset value, the cross-chain transaction data is determined to be valid; otherwise, the cross-chain transaction data is determined to be invalid.

[0107] In a specific embodiment, a cross-chain device is provided in the embodiment of the present application, which also includes: an auto-increment module, used to auto-increment the current latest cross-chain transaction index by the preset value; calling the business contract of the application chain to generate a receipt cross-chain transaction event, and sending the receipt cross-chain transaction event to the cross-chain gateway.

[0108] Based on the same concept, an electronic device is also provided in the embodiment of the present application, such as Figure 3 As shown, the electronic device mainly includes: a processor 301, a memory 302 and a communication bus 303, wherein the processor 301 and the memory 302 communicate with each other through the communication bus 303. The memory 302 stores a program executable by the processor 301, and the processor 301 executes the program stored in the memory 302 to implement the following steps:

[0109] Call the target business contract to initiate a cross-chain transaction event, generate cross-chain transaction proof data, and send the cross-chain transaction event and the cross-chain transaction proof data to the cross-chain gateway, so that the cross-chain gateway generates cross-chain transaction data according to the cross-chain transaction event and the cross-chain transaction proof data, and sends the cross-chain transaction data to the application chain;

[0110] or,

[0111] Obtain cross-chain transaction events and cross-chain transaction proof data sent by the relay chain;

[0112] Generate cross-chain transaction data according to the cross-chain transaction event and the cross-chain transaction proof data, send the cross-chain transaction data to the application chain, so that the application chain can verify the validity of the cross-chain transaction data, and process the cross-chain transaction data when verifying that the cross-chain transaction data is valid.

[0113] or,

[0114] Obtain cross-chain transaction data sent by the cross-chain gateway; wherein the cross-chain transaction data is generated by the cross-chain gateway according to the cross-chain transaction event and cross-chain transaction proof data sent by the relay chain; verify the validity of the cross-chain transaction data, and when verifying that the cross-chain transaction data is valid, process the cross-chain transaction data.

[0115] The communication bus 303 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 303 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0116] The memory 302 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Alternatively, the memory may also be at least one storage device located away from the processor 301 .

[0117] The above-mentioned processor 301 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., and can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0118] In another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program runs on a computer, the computer executes a cross-chain method described in the above embodiment.

[0119] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instruction is transmitted from a website site, a computer, a server or a data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integration. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk), etc.

[0120] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0121] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A cross-chain system, characterized in that: include: Relay chain, cross-chain gateway and application chain; The relay chain is used to call the target business contract to initiate a cross-chain transaction event, generate cross-chain transaction proof data, and send the cross-chain transaction event and the cross-chain transaction proof data to the cross-chain gateway; The cross-chain gateway is used to generate cross-chain transaction data according to the cross-chain transaction event and the cross-chain transaction proof data, and send the cross-chain transaction data to the application chain; The application chain is used to verify the validity of the cross-chain transaction data, and when the cross-chain transaction data is verified to be valid, process the cross-chain transaction data.

2. The cross-chain system according to claim 1, characterized in that: The application chain is used to verify the cross-chain transaction data according to the multi-signature information. When the verification passes, the cross-chain number index is read from the cross-chain transaction data. When the difference between the cross-chain number index and the current latest cross-chain transaction index in the application chain is a preset value, the cross-chain transaction data is determined to be valid, and the current latest cross-chain transaction index is incremented by the preset value.

3. The cross-chain system according to claim 2, characterized in that: The application chain is also used to call the business contract of the application chain to generate a receipt cross-chain transaction event after processing the cross-chain transaction data, and send the receipt cross-chain transaction event to the cross-chain gateway.

4. The cross-chain system according to claim 3, characterized in that: The cross-chain gateway is also used to search for the cross-chain transaction event and the cross-chain transaction proof data corresponding to the receipt cross-chain transaction event according to the receipt cross-chain transaction event, and generate the receipt cross-chain transaction data according to the receipt cross-chain transaction event, the cross-chain transaction event and the cross-chain transaction proof data, and send the receipt cross-chain transaction data to the relay chain.

5. The cross-chain system according to claim 4, characterized in that: The relay chain is also used to verify the validity of the receipt cross-chain transaction data. When verifying that the receipt cross-chain transaction data is valid, the current latest receipt cross-chain transaction index of the relay chain is incremented, and the target business contract is called to process the receipt cross-chain transaction data.

6. A cross-chain method, characterized in that: The cross-chain system according to any one of claims 1 to 5 comprises: a relay chain, a cross-chain gateway and an application chain; and the method comprises: The relay chain is used to call the target business contract to initiate a cross-chain transaction event, generate cross-chain transaction proof data, and send the cross-chain transaction event and the cross-chain transaction proof data to the cross-chain gateway; The cross-chain gateway is used to obtain the cross-chain transaction events and cross-chain transaction proof data sent by the relay chain; generate cross-chain transaction data according to the cross-chain transaction events and the cross-chain transaction proof data, and send the cross-chain transaction data to the application chain; The application chain is used to obtain the cross-chain transaction data sent by the cross-chain gateway; verify the validity of the cross-chain transaction data, and process the cross-chain transaction data when the cross-chain transaction data is verified to be valid.

7. An electronic device, characterized in that: include: A processor, a memory and a communication bus, wherein the processor and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to execute the program stored in the memory to implement the cross-chain method described in claim 6.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the cross-chain method of claim 6 is implemented.

Citation Information

Patent Citations

  • Data cross-chain sharing method and system, computer equipment and storage medium

    CN111200641A

  • Cross-chain transaction method, system and device, equipment and storage medium

    CN112446785A