Data pushing method and device across blockchains

By connecting to multiple blockchains through a cross-blockchain data push device, it directly receives and processes data push requests, generates digital signatures, and sends data transactions. This solves the problem of needing to deploy smart contracts on the sending blockchain in existing technologies, and achieves more efficient cross-blockchain data transmission.

CN114387104BActive Publication Date: 2025-11-21ALIPAY (HANGZHOU) INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210036205.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-13
Publication Date
2025-11-21
Estimated Expiration
2042-01-13

AI Technical Summary

Technical Problem

In existing technologies, cross-blockchain data push requires deploying smart contracts and configuring application permissions on the data sender's blockchain, which makes the operation complex and inflexible.

Method used

A cross-blockchain data push method and apparatus are provided. The data push device connects to multiple blockchains, and without deploying smart contracts in the blockchain of the data sender, it directly receives data push requests, obtains transaction data, generates digital signatures in a trusted execution environment, and sends data transactions to the blockchain of the receiver.

Benefits of technology

It enables convenient and flexible cross-blockchain data push, avoids additional configuration on the sending blockchain, and improves the efficiency and flexibility of data push.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114387104B_ABST
    Figure CN114387104B_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present specification is a cross-blockchain data pushing method and device. The method is performed by a cross-blockchain data pushing device, the data pushing device is connected with a first blockchain and a second blockchain respectively, and the method comprises: receiving a data pushing request, the data pushing request comprising a transaction identifier of a first transaction in the first blockchain; acquiring the first transaction from the first blockchain, the first transaction comprising first data; and sending a second transaction to the second blockchain, wherein the second transaction comprises second data acquired based on the first data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] One or more embodiments of the present specification relate to the field of blockchain, and in particular, to a cross-blockchain data pushing method and device. BACKGROUND

[0002] Blockchain is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm and other computer technologies. Due to the characteristics of decentralization, information non-tamperability, autonomy and the like, blockchain has also attracted more and more attention and application.

[0003] In some business scenarios, it is necessary to push data stored in a certain blockchain to other blockchains. SUMMARY

[0004] A cross-blockchain data pushing method and device are provided in one or more embodiments of the present specification.

[0005] In a first aspect, a cross-blockchain data pushing method is provided. The method is performed by a data pushing device, and the data pushing device is connected to a first blockchain and a second blockchain respectively. The method comprises: receiving a data pushing request, the data pushing request comprising a transaction identifier of a first transaction in the first blockchain; obtaining the first transaction from the first blockchain, the first transaction comprising first data; and sending a second transaction to the second blockchain, wherein the second transaction comprises second data obtained based on the first data.

[0006] In a possible implementation, the second data is the first data.

[0007] In a possible implementation, the first data is a ciphertext generated by encrypting the second data using a first key. The method further comprises decrypting the first data using a second key corresponding to the first key to obtain the second data.

[0008] In a possible implementation, the method further comprises generating a digital signature corresponding to the second data in a trusted execution environment; and generating the second transaction, wherein the second transaction further comprises the digital signature.

[0009] In a possible implementation, the second transaction is used to call a first smart contract in the second blockchain, so that the first smart contract verifies the second data according to the digital signature.

[0010] In a possible implementation, the first smart contract is further configured to, in a case where the second data is verified, invoke a second smart contract in the second blockchain to pass the second data to the second smart contract.

[0011] In a possible implementation, the method further includes: obtaining, from the first blockchain, block headers of respective blocks generated by the first blockchain; obtaining, from the first blockchain, a merkle tree path corresponding to the first transaction; and performing a simple payment verification on the first transaction according to the merkle tree path and the respective block headers.

[0012] In a possible implementation, the method further includes: verifying the respective block headers.

[0013] In a possible implementation, the obtaining the first transaction from the first blockchain includes: sending, to the first blockchain, a third transaction, the third transaction including a transaction identifier of the first transaction, the third transaction being configured to invoke a third smart contract in the first blockchain to return the first transaction according to the transaction identifier of the first transaction.

[0014] In a possible implementation, the third transaction further includes a chain identifier of the second blockchain, and the third smart contract is further configured to record push information according to the transaction identifier and the chain identifier, the push information being configured to indicate that the second data has been pushed to the second blockchain.

[0015] In a second aspect, a data pushing apparatus across blockchains is provided, and the data pushing apparatus is connected to a first blockchain and a second blockchain respectively. The apparatus includes: a receiving unit configured to receive a data pushing request, the data pushing request including a transaction identifier of a first transaction in the first blockchain; a querying unit configured to obtain the first transaction from the first blockchain, the first transaction including first data; and a sending unit configured to send a second transaction to the second blockchain, the second transaction including second data obtained based on the first data.

[0016] In a possible implementation, the second data is the first data.

[0017] In a possible implementation, the first data is ciphertext of the second data encrypted by using a first key; and the apparatus further includes: a decryption processing unit configured to decrypt the first data by using a second key corresponding to the first key to obtain the second data.

[0018] In a possible implementation, the apparatus further includes: a signature processing unit, configured to generate a digital signature corresponding to the second data in a trusted execution environment; and a transaction generating unit, configured to generate the second transaction, wherein the second transaction further includes the digital signature.

[0019] In a possible implementation, the second transaction is used to invoke a first smart contract in the second blockchain, so that the first smart contract verifies the second data according to the digital signature.

[0020] In a possible implementation, the first smart contract is further used to invoke a second smart contract in the second blockchain to pass the second data to the second smart contract if the second data passes verification.

[0021] In a possible implementation, the receiving unit is further configured to receive, from the first blockchain, block headers of respective blocks generated by the first blockchain, and receive, from the first blockchain, a merkle tree path corresponding to the first transaction. The apparatus further includes a verification unit configured to perform simple payment verification on the first transaction according to the merkle tree path and the respective block headers.

[0022] In a possible implementation, the verification unit is further configured to verify the respective block headers.

[0023] In a possible implementation, the query unit is specifically configured to send, to the first blockchain, a third transaction including the transaction identifier, the third transaction being used to invoke a third smart contract in the first blockchain, so that the third smart contract returns the first transaction according to the transaction identifier.

[0024] In a possible implementation, the third transaction further includes a chain identifier of the second blockchain, and the third smart contract is further used to record push information according to the transaction identifier and the chain identifier, the push information being used to indicate that the second data has been pushed to the second blockchain.

[0025] In a third aspect, a computer-readable storage medium is provided, which stores computer programs / instructions, when the computer programs / instructions are executed in a computing device, the computing device implements the method in any one of the first aspect.

[0026] By the method and device provided in one or more embodiments of the present specification, the data push request from the application program is received and responded by the data push device across the blockchain, the corresponding transaction is queried from the first blockchain, and the data corresponding to the transaction is pushed to the second blockchain based on the data contained in the transaction. Without deploying a smart contract for supporting data push in the blockchain as the data sender, and without corresponding permission configuration of the application program in the blockchain as the sender, the cross-blockchain data push according to the application program can be more convenient and efficient. BRIEF DESCRIPTION OF DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present specification, the drawings needed in the embodiment description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present specification, and other drawings can be obtained by those skilled in the art without creative labor.

[0028] Figure 1 The schematic diagram of the application scenario of the technical solution provided in the embodiments of the present specification is shown.

[0029] Figure 2 The flowchart of the cross-blockchain data push method provided in the embodiments of the present specification is shown.

[0030] Figure 3 The flowchart of another cross-blockchain data push method provided in the embodiments of the present specification is shown.

[0031] Figure 4 The schematic diagram of the cross-blockchain data push device provided in the embodiments of the present specification is shown. DETAILED DESCRIPTION

[0032] The various non-limiting embodiments provided by the present specification will be described in detail below with reference to the accompanying drawings.

[0033] Figure 1 The schematic diagram of the application scenario of the technical solution provided in the embodiments of the present specification is shown. As Figure 1 shown, for the transaction TX_1 stored in the first blockchain, the Data field thereof can contain corresponding business data; other application programs can expect to push the business data in the transaction TX_1 to the second blockchain, for example, store the business data to the second blockchain, or pass the business data to the smart contract Contract_1 deployed to the second blockchain through the transaction TX_2.

[0034] In a possible implementation, a corresponding smart contract can be deployed in the first blockchain as the data sender, and the application can push the data stored in the first blockchain to the second blockchain as the data receiver by invoking the smart contract. However, in this implementation, the smart contract for supporting data pushing needs to be additionally written and deployed in the first blockchain, and the access permission of the application to the smart contract also needs to be configured in the first blockchain.

[0035] The embodiments of the present specification provide a cross-blockchain data pushing method and device, which do not need to deploy a smart contract for supporting data pushing in the blockchain as the data sender, and do not need to configure the corresponding permission of the application in the blockchain, and can more conveniently and quickly realize the cross-blockchain data pushing according to the expectation of the application.

[0036] Figure 2 A flowchart of a cross-blockchain data pushing method provided in the embodiments of the present specification is provided. The method can be executed by a cross-blockchain data pushing device, which is connected to a plurality of blockchains as an independent middleware, for example, connected to the first blockchain as the data sender and connected to the second blockchain as the data receiver. The cross-blockchain data pushing device can be implemented as any device, platform or device cluster with computing / processing capability. In addition, in terms of the hardware environment, the cross-blockchain data pushing device can include a trusted execution environment and a corresponding untrusted execution environment; in other words, for the software program used by the cross-blockchain data pushing device, it can include a trusted processing unit running in the trusted execution environment and an untrusted processing unit running in the untrusted execution environment. For each method step described below, unless it is specifically stated that it needs to be executed in the trusted execution environment, the method step can be executed in the trusted execution environment or in the untrusted execution environment; in other words, for each method step that is not specifically declared to need to be executed in the trusted execution environment, it can be executed by the untrusted processing unit or the trusted processing unit. As shown in the figure, the method can at least include the following steps 201 to 205. Figure 2

[0037] First, in step 201, a data pushing request is received, and the data pushing request includes a transaction identifier of a first transaction in the first blockchain.

[0038] ​The data push request received by the data push device comes from a corresponding application, which can be deployed in a terminal device, can be deployed in the data push device across blockchains, or can be deployed in a blockchain node of a certain blockchain connected to the data push device. The transaction identifier of the first transaction can include, but is not limited to, a hash value of the first transaction. In addition, if the first blockchain as the data sender is not predetermined in the data push device, the chain identifier of the first blockchain can also be included in the data push request; similarly, if the second blockchain as the data receiver is not predetermined in the data push device, the chain identifier of the second blockchain can also be included in the data push request.

[0039] Next, in step 203, the first transaction including the first data is obtained from the first blockchain.

[0040] The data push device can determine the first blockchain as the data sender in advance, or determine the first blockchain as the data sender based on the chain identifier of the first blockchain in the data push request, and then obtain the first transaction from the first blockchain according to the transaction identifier of the first transaction. In one example, the data push device can send a query request including the transaction identifier of the first transaction to the first blockchain, so that the first blockchain returns the first transaction based on the transaction identifier. In another example, the data push device can send a third transaction including the transaction identifier of the first transaction to the first blockchain, and the third transaction is used to call a third smart contract in the first blockchain, so that when the first blockchain executes the third smart contract based on the third transaction, the third smart contract can query the first transaction in the first blockchain according to the transaction identifier of the first transaction, and return the first transaction queried to the data push device.

[0041] In a more specific example, the third transaction described above can further include the chain identifier of the second blockchain as the data receiver, and when the first blockchain executes the third smart contract based on the third transaction, the third smart contract can also record the push information according to the transaction identifier of the first transaction and the chain identifier of the second blockchain, where the push information is used to indicate that the corresponding data has been pushed to the second blockchain, for example, to indicate that the first data in the first transaction or the second data obtained based on the first data has been pushed to the second blockchain. In this way, the application can know the data pushed to the second blockchain by initiating a query transaction for calling the third smart contract to the first blockchain.

[0042] In order to enable the data push device to perform simple payment verification on the first transaction from the first blockchain, the data push device can also obtain the block header of each block generated by the first blockchain. In other words, please refer to Figure 3The method can further include step 301, receiving the block header of each block generated by the first blockchain from the first blockchain. In this case, the data pushing device can periodically receive the block header of each block generated in the current period from the first blockchain; or the data pushing device can also obtain the block header of each block from the first blockchain after the first blockchain generates a new block.

[0043] On the basis of the foregoing step 301, the method can further include step 303, verifying each block header. In this case, verifying each block header refers to verifying whether the information in each block header satisfies a specific condition, such as verifying whether the block height in each block header is continuous. Correspondingly, the data pushing device can continue to execute the foregoing step 203 on the basis of the foregoing step 201 only when each block header received by the data pushing device passes the verification.

[0044] In order to enable the data pushing device to perform simple payment verification on the first transaction from the first blockchain, the first blockchain can return the merkle tree path corresponding to the first transaction to the data pushing device when returning the first transaction to the data pushing device. In other words, referring to Figure 3 The method can further include step 305, receiving the merkle tree path corresponding to the first transaction from the first blockchain.

[0045] Correspondingly, on the basis of the foregoing steps 301-305, the method can further include step 307, performing simple payment verification on the first transaction according to the merkle tree path corresponding to the first transaction and each block header. For example, the merkle root corresponding to the block to which the first transaction belongs can be calculated according to the first transaction and the merkle tree path corresponding to the first transaction, and if the merkle root is the same as the merkle root in any block header, the first transaction passes the simple payment verification. When the first transaction passes the simple payment verification, the subsequent steps can be continued to be executed, otherwise the subsequent steps can not be executed.

[0046] The foregoing first data can be, for example, the field value of the Data field in the first transaction. In this case, when the first transaction passes the simple payment verification and the first data is plaintext that has not been encrypted, the first data is the second data that needs to be pushed to the second blockchain. When the first transaction passes the simple payment verification and the first data is ciphertext generated by encrypting the second data by using the first key, the method can further include step 3091, decrypting the first data by using the second key corresponding to the first key to obtain the second data; and step 3093, generating the digital signature corresponding to the second data in the trusted execution environment.

[0047] To achieve pushing the second data to the second blockchain, the method can further include step 3095, generating a second transaction including at least the second data, and optionally including a digital signature corresponding to the second data.

[0048] Then, in step 205, the second transaction is sent to the second blockchain.

[0049] When the second data is included in the second transaction without the corresponding digital signature, the second transaction can be used to achieve storing the second data to the second blockchain, or the second transaction can also be used to invoke a second smart contract in the second blockchain to pass the second data to the second smart contract.

[0050] When the second data and the corresponding digital signature are included in the second transaction, the second transaction can be used to invoke a first smart contract in the second blockchain to verify the second data in the second transaction according to the digital signature. Correspondingly, when the second data passes the verification, the first smart contract can further invoke a second smart contract in the second blockchain to pass the second data in the second transaction to the second smart contract.

[0051] It needs to be particularly noted that when the second transaction directly or indirectly invokes the second smart contract in the second blockchain in the foregoing manner, the second transaction sent by the data pushing device can further include a contract address of the second smart contract, for example, the contract address of the second smart contract is included in the Data field of the second transaction. The contract address of the second smart contract is for example from the data pushing request received by the data pushing device, to achieve storing the second data in plain text or in encrypted form in the first blockchain according to the expectation of the application program, and pushing the second data to the second smart contract in the second blockchain.

[0052] Based on the same idea as the foregoing method embodiments, the present specification embodiments further provide a data pushing device across blockchains, which is connected with a first blockchain as a data sending side and a second blockchain as a data receiving side. As shown in Figure 4 The device can at least include that the data pushing device is connected with the first blockchain and the second blockchain respectively, and the device includes: a receiving unit 401 configured to receive a data pushing request, the data pushing request including a transaction identifier of a first transaction in the first blockchain; a querying unit 402 configured to acquire the first transaction from the first blockchain, the first transaction including first data; and a sending unit 403 configured to send a second transaction to the second blockchain, wherein the second transaction includes second data acquired based on the first data.

[0053] In a possible implementation, the second data is the first data.

[0054] In a possible implementation, the first data is ciphertext generated by encrypting the second data with a first key. The apparatus further includes a decryption processing unit 404, configured to decrypt the first data with a second key corresponding to the first key to obtain the second data.

[0055] In a possible implementation, the apparatus further includes a signature processing unit 405, configured to generate a digital signature corresponding to the second data in a trusted execution environment; and a transaction generation unit 406, configured to generate the second transaction, wherein the second transaction further includes the digital signature.

[0056] In a possible implementation, the second transaction is used to invoke a first smart contract in the second blockchain, so that the first smart contract verifies the second data according to the digital signature.

[0057] In a possible implementation, the first smart contract is further used to invoke a second smart contract in the second blockchain to pass the second data to the second smart contract if the second data passes verification.

[0058] In a possible implementation, the receiving unit 401 is further configured to receive, from the first blockchain, block headers of respective blocks generated by the first blockchain; and receive, from the first blockchain, a merkle tree path corresponding to the first transaction. The apparatus further includes a verification unit 407, configured to perform simple payment verification on the first transaction according to the merkle tree path and the respective block headers.

[0059] In a possible implementation, the verification unit 407 is further configured to verify the respective block headers.

[0060] In a possible implementation, the querying unit 402 is specifically configured to send, to the first blockchain, a third transaction including the transaction identifier, the third transaction being used to invoke a third smart contract in the first blockchain, so that the third smart contract returns the first transaction according to the transaction identifier.

[0061] In a possible implementation, the third transaction further includes a chain identifier of the second blockchain, and the third smart contract is further used to record push information according to the transaction identifier and the chain identifier, the push information being used to indicate that the second data has been pushed to the second blockchain.

[0062] Those skilled in the art should be able to understand that, in one or more of the above examples, the functions described in the specification can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, the computer program corresponding to the functions can be stored in a computer readable medium or transmitted as one or more instructions / code on a computer readable medium, so that when the computer program corresponding to the functions is executed by a computer, the method described in any one of the embodiments of the specification is implemented by the computer.

[0063] The embodiments of the specification also provide a computer readable storage medium, which stores a computer program / instruction, when the computer program / instruction is executed in a computing device, the computing device executes the cross-blockchain data pushing method provided in any one of the embodiments of the specification.

[0064] Each of the embodiments in the specification is described in a progressive manner, and the same and similar parts in each of the embodiments can be referred to each other. In each of the embodiments, the difference from other embodiments is mainly described. Especially, since the device embodiments are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiments.

[0065] The above describes specific embodiments of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be executed in an order different than the order in the embodiments and still achieve the desired result. In addition, the processes depicted in the figures do not necessarily require the particular order shown or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous or possible.

[0066] The above specific embodiments further explain the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical solutions of the present application should be included in the protection scope of the present application.

Claims

1. A method for cross-blockchain data pushing, the method being performed by a data pushing device, the data pushing device being connected to a first blockchain and a second blockchain respectively, the method comprising: receiving a data pushing request, the data pushing request comprising a transaction identifier of a first transaction in the first blockchain; obtaining the first transaction from the first blockchain, the first transaction comprising first data, the first data being a field value of a Data field in the first transaction; when the first data is a ciphertext generated by encrypting second data with a first key, decrypting the first data with a second key corresponding to the first key to obtain the second data; sending a second transaction to the second blockchain, wherein the second transaction comprises the second data.

2. The method of claim 1, wherein, The method further comprises: generating a digital signature corresponding to the second data in a trusted execution environment; generating the second transaction, wherein the second transaction further comprises the digital signature.

3. The method of claim 2, wherein, The second transaction is used to invoke a first smart contract in the second blockchain, so that the first smart contract verifies the second data according to the digital signature.

4. The method of claim 3, wherein, The first smart contract is further used to invoke a second smart contract in the second blockchain to pass the second data to the second smart contract when the second data passes the verification. 5.The method of any one of claims 1-4, the method further comprising: receiving block headers of respective blocks generated by the first blockchain from the first blockchain; receiving a merkle tree path corresponding to the first transaction from the first blockchain; performing a simple payment verification on the first transaction according to the merkle tree path and the respective block headers.

6. The method of claim 5, further comprising: verifying the respective block headers.

7. The method of any one of claims 1-4, wherein, The obtaining the first transaction from the first blockchain comprises: sending a third transaction to the first blockchain, the third transaction comprising the transaction identifier, the third transaction being used to invoke a third smart contract in the first blockchain, so that the third smart contract returns the first transaction according to the transaction identifier.

8. The method of claim 7, wherein, The third transaction further comprises a chain identifier of the second blockchain, and the third smart contract is further used to record pushing information according to the transaction identifier and the chain identifier, the pushing information being used to indicate that the second data has been pushed to the second blockchain. 9.A data pushing device for cross-blockchain data pushing, the data pushing device being connected to a first blockchain and a second blockchain respectively, the device comprising: a receiving unit configured to receive a data pushing request, the data pushing request comprising a transaction identifier of a first transaction in the first blockchain; a querying unit configured to obtain the first transaction from the first blockchain, the first transaction comprising first data, the first data being a field value of a Data field in the first transaction; a decryption processing unit configured to, when the first data is a ciphertext generated by encrypting second data with a first key, decrypt the first data with a second key corresponding to the first key to obtain the second data; and a sending unit configured to send a second transaction to the second blockchain, wherein the second transaction comprises the second data. The sending unit is configured to send a second transaction to the second blockchain, wherein the second transaction includes the second data.

10. The apparatus of claim 9, further comprising: The signature processing unit is configured to generate a digital signature corresponding to the second data in a trusted execution environment. The transaction generating unit is configured to generate the second transaction, wherein the second transaction further includes the digital signature.

11. The apparatus of claim 10, wherein, The second transaction is used to invoke a first smart contract in the second blockchain, so that the first smart contract verifies the second data according to the digital signature.

12. The apparatus of claim 11, wherein, The first smart contract is further used to invoke a second smart contract in the second blockchain to deliver the second data to the second smart contract if the second data is verified.

13. The apparatus of any of claims 9-12, wherein, The receiving unit is further configured to receive, from the first blockchain, block headers of respective blocks generated by the first blockchain, and a merkle tree path corresponding to the first transaction. The apparatus further comprises a verification unit configured to verify the first transaction according to the merkle tree path and the respective block headers.

14. The apparatus of claim 13, wherein, The verification unit is further configured to verify the respective block headers.

15. The apparatus of any of claims 9-12, wherein, The query unit is specifically configured to send a third transaction to the first blockchain, wherein the third transaction includes the transaction identifier, and the third transaction is used to invoke a third smart contract in the first blockchain, so that the third smart contract returns the first transaction according to the transaction identifier.

16. The apparatus of claim 15, wherein, The third transaction further includes a chain identifier of the second blockchain, and the third smart contract is further used to record push information according to the transaction identifier and the chain identifier, wherein the push information is used to indicate that the second data has been pushed to the second blockchain.

17. A computer-readable storage medium having stored thereon a computer program, which, when executed in a computing device, causes the computing device to perform the method of any one of claims 1-8.

Citation Information

Patent Citations

  • Cross-chain message transfer method and device based on relay equipment

    CN112804066A

  • Method and device for providing cross-chain private data

    CN112804360A