WO2022095244A1 - Cross-chain transaction method, system and apparatus, device, and storage medium - Google Patents

Cross-chain transaction method, system and apparatus, device, and storage medium Download PDF

Info

Publication number
WO2022095244A1
WO2022095244A1 PCT/CN2020/138062 CN2020138062W WO2022095244A1 WO 2022095244 A1 WO2022095244 A1 WO 2022095244A1 CN 2020138062 W CN2020138062 W CN 2020138062W WO 2022095244 A1 WO2022095244 A1 WO 2022095244A1
Authority
WO
WIPO (PCT)
Prior art keywords
chain
cross
transaction
target
gateway
Prior art date
Application number
PCT/CN2020/138062
Other languages
French (fr)
Chinese (zh)
Inventor
邱炜伟
李伟
汪小益
匡立中
张帅
Original Assignee
杭州趣链科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州趣链科技有限公司 filed Critical 杭州趣链科技有限公司
Publication of WO2022095244A1 publication Critical patent/WO2022095244A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/604Tools and structures for managing or administering access control systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • the present application relates to the field of cross-chain technology, and in particular, to a method, system, device, device and storage medium for cross-chain transactions.
  • Cross-chain technology refers to connecting homogeneous or heterogeneous blockchain systems to achieve information exchange between blockchains.
  • the relay chain technology is used to achieve cross-chain.
  • the source application chain system sends the cross-chain transaction data to the relay chain system, and the cross-chain transaction data includes call information and transaction certification information; the relay chain system verifies the cross-chain transaction data, and after the verification is passed, The cross-chain transaction data is stored in the configured blockchain, and then the cross-chain transaction data is sent to the destination application chain system.
  • the calling information and transaction certification information in the cross-chain transaction data are stored in the blockchain configured by the relay chain system, which results in a large storage pressure on the relay chain system.
  • the third party who maintains the relay chain system can obtain the call information, which may easily lead to the leakage of the privacy of both parties across the chain.
  • the present application provides a cross-chain transaction method, system, device, device and storage medium, which can reduce the storage pressure of the relay chain system and prevent the leakage of privacy of both parties in the cross-chain.
  • a cross-chain transaction method includes: a first cross-chain gateway obtains a target cross-chain transaction and corresponding transaction certification information from a first application chain system; and sends a cross-chain verification to the relay chain system request, the cross-chain verification request carries the target cross-chain transaction and the transaction certification information.
  • the relay chain system After receiving the cross-chain verification request, the relay chain system verifies the target cross-chain transaction according to the transaction proof information; when the target cross-chain transaction is verified, the target cross-chain transaction is generated.
  • the digital signature of the identification information; the identification information and the digital signature are stored in the blockchain configured by the relay chain system as a cross-chain certificate; a block confirmation notification is returned to the first cross-chain gateway.
  • the first cross-chain gateway After receiving the block confirmation notification, the first cross-chain gateway sends a cross-chain transaction request to the second cross-chain gateway, where the cross-chain transaction request carries the target cross-chain transaction.
  • the second cross-chain gateway After receiving the cross-chain transaction request, the second cross-chain gateway obtains the digital signature from the relay chain system according to the identification information; and verifies the target cross-chain transaction according to the digital signature; When the target cross-chain transaction is verified and passed, the target cross-chain transaction is sent to the second application chain system.
  • a cross-chain transaction system in a second aspect, includes: a first cross-chain gateway, a relay chain system and a second cross-chain gateway.
  • the first cross-chain gateway is used to obtain the target cross-chain transaction and corresponding transaction certification information from the first application chain system; send a cross-chain verification request to the relay chain system, and the cross-chain verification request carries the The target cross-chain transaction and the transaction proof information.
  • the relay chain system is configured to verify the target cross-chain transaction according to the transaction proof information after receiving the cross-chain verification request; when the target cross-chain transaction is verified, generate the target cross-chain transaction
  • the digital signature of the identification information of the cross-chain transaction; the identification information and the digital signature are stored as the cross-chain certificate in the blockchain configured by the relay chain system; the block chain is returned to the first cross-chain gateway Confirm the notification.
  • the first cross-chain gateway is further configured to send a cross-chain transaction request to the second cross-chain gateway after receiving the block confirmation notification, where the cross-chain transaction request carries the target cross-chain transaction.
  • the second cross-chain gateway is configured to obtain the digital signature from the relay chain system according to the identification information after receiving the cross-chain transaction request; Perform verification; when the target cross-chain transaction is verified, send the target cross-chain transaction to the second application chain system.
  • a cross-chain transaction method is provided, which is applied to a relay chain system.
  • the method includes: receiving a cross-chain verification request sent by a first cross-chain gateway, where the cross-chain verification request carries the first cross-chain verification request.
  • the target cross-chain transaction and the corresponding transaction proof information obtained by the chain gateway from the first application chain system.
  • the target cross-chain transaction is verified according to the transaction proof information.
  • a digital signature of the identification information of the target cross-chain transaction is generated.
  • the identification information and the digital signature are stored in the blockchain configured by the relay chain system as a cross-chain certificate, and the cross-chain certificate is used to verify the target cross-chain transaction at the second cross-chain gateway when used.
  • a cross-chain transaction device which is applied to a relay chain system, and the device includes:
  • a receiving module configured to receive a cross-chain verification request sent by the first cross-chain gateway, where the cross-chain verification request carries the target cross-chain transaction and corresponding transaction certification information obtained by the first cross-chain gateway from the first application chain system .
  • a verification module configured to verify the target cross-chain transaction according to the transaction certification information.
  • the generating module is configured to generate a digital signature of the identification information of the target cross-chain transaction when the target cross-chain transaction is verified.
  • the storage module is used to store the identification information and the digital signature in the blockchain configured by the relay chain system as a cross-chain deposit certificate, and the cross-chain deposit certificate is used for verifying at the second cross-chain gateway. It is used when the target cross-chain transaction is mentioned.
  • a sending module configured to send a block confirmation notification to the first cross-chain gateway to instruct the first cross-chain gateway to send a cross-chain transaction request to the second cross-chain gateway, and the cross-chain transaction request carries the Describe the target cross-chain transaction.
  • a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being executed by the processor
  • a computer-readable storage medium where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the cross-chain transaction method described in the third aspect above is implemented.
  • a computer program product containing instructions which, when run on a computer, causes the computer to execute the steps of the cross-chain transaction method described in the third aspect above.
  • the relay chain system stores the cross-chain certificate of the target cross-chain transaction, and the cross-chain certificate includes identification information and digital signature.
  • the identification information is only some simple information used to identify the target cross-chain transaction. It does not include the calling information in the target cross-chain transaction, nor does it include transaction proof information. This can greatly reduce the storage pressure of the relay chain system, and can prevent Privacy disclosure of both parties across the chain.
  • the first cross-chain gateway can directly send the target cross-chain transaction to the second cross-chain gateway, and the second cross-chain gateway can verify the target cross-chain transaction according to the cross-chain certificate stored in the relay chain system. Send the target cross-chain transaction to the second application chain system, so as to ensure the validity of the target cross-chain transaction sent to the second application chain system.
  • FIG. 1 is a schematic structural diagram of a blockchain system provided by an embodiment of the present application.
  • FIG. 2 is a schematic diagram of a blockchain provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of a cross-chain transaction system provided by an embodiment of the present application.
  • FIG. 4 is a flowchart of a cross-chain transaction method provided by an embodiment of the present application.
  • FIG. 5 is a flowchart of another cross-chain transaction method provided by an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a cross-chain transaction device provided by an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • FIG. 1 is a schematic structural diagram of a blockchain system provided by an embodiment of the present application.
  • the blockchain system 100 refers to a system for sharing data between nodes.
  • the blockchain system 100 may include multiple nodes 101 , and multiple nodes 101 may refer to the system in the blockchain system 100 . each client.
  • Each node 101 can receive input information during normal work, and maintain shared data within the blockchain system 100 based on the received input information.
  • an information connection may exist between each node 101 in the blockchain system 100, and information transmission may be performed between the nodes 101 through the information connection.
  • any node 101 in the blockchain system 100 receives input information
  • other nodes 101 in the blockchain system 100 obtain the input information according to the consensus algorithm, and store the input information as data in the shared data , so that the data stored on all nodes 101 in the blockchain system 100 are consistent.
  • Each node 101 in the blockchain system 100 stores an identical blockchain.
  • the blockchain consists of multiple blocks.
  • the founding block includes a block header and a block body.
  • the block header stores the input information feature value, version number, timestamp and difficulty value.
  • the block body stores Input information;
  • the next block of the genesis block takes the genesis block as the parent block, the next block also includes the block header and the block body, and the block header stores the input information characteristic value of the current block, the parent block's
  • the block header feature value, version number, timestamp, and difficulty value, and so on make the block data stored in each block in the blockchain associated with the block data stored in the parent block, ensuring that Security of the information entered in the block.
  • the blockchain system 100 has computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • the blockchain system 100 is a distributed shared ledger and database, which has the characteristics of decentralization, non-tampering, full traces, traceability, collective maintenance, openness and transparency, etc. These features ensure the shared openness, authenticity, integrity, security and reliability of the blockchain.
  • Lisk system is a blockchain system that performs cross-chain transactions.
  • the relay chain system is a blockchain system.
  • the relay chain system can be connected to the application chain system to realize the verification of cross-chain transactions.
  • Cross-chain gateway is an adapter between the application chain system and the relay chain system.
  • the cross-chain gateway can capture the cross-chain events generated in the application chain system and submit the cross-chain transaction data to the relay chain system; or, the cross-chain gateway can receive the cross-chain transactions verified by the relay chain system and submit the cross-chain transaction to the application. chain system.
  • Cross-chain transaction is a transaction between two AppChain systems, which can include source AppChain ID, destination AppChain ID, cross-chain transaction serial number, call information and other information.
  • FIG. 3 is a schematic diagram of a cross-chain transaction system provided by an embodiment of the present application.
  • the cross-chain transaction system includes: a first cross-chain gateway 301 , a relay chain system 302 , and a second cross-chain gateway 303 .
  • the first cross-chain gateway 301 is a cross-chain gateway connected with the first application chain system 304 .
  • the second cross-chain gateway 303 is a cross-chain gateway connected with the second application chain system 305 .
  • the first cross-chain gateway 301 may communicate with the second cross-chain gateway 303 through a wired network or a wireless network.
  • the relay chain system 302 is located between the first cross-chain gateway 301 and the second cross-chain gateway 303 .
  • the relay chain system 302 can communicate with the first cross-chain gateway 301 through a wired network or a wireless network, and can also communicate with the second cross-chain gateway 303 through a wired network or a wireless network.
  • the first application chain system 304, the second application chain system 305 and the relay chain system 302 are all block chain systems, and the block chain system may be the block chain system 100 described in the embodiments of FIG. 1-FIG. 2 above. .
  • the first application chain system 304 may be the source application chain system
  • the second application chain system 305 may be the destination application chain system. That is, the cross-chain transaction may be a transaction initiated by the user of the first application chain system 304 and needs to be sent to the second application chain system 305 .
  • the first cross-chain gateway 301 , the relay chain system 302 and the second cross-chain gateway 303 can execute the cross-chain transaction method described in the embodiment of FIG. 4 below to realize the connection between the first application chain system 304 and the second application chain system 305 cross-chain transactions.
  • FIG. 4 is a flowchart of a cross-chain transaction method provided by an embodiment of the present application. Referring to Figure 4, the following steps are included.
  • Step 401 The first cross-chain gateway obtains the target cross-chain transaction and corresponding transaction proof information from the first application chain system.
  • the target cross-chain transaction is the transaction between the first application chain system and the second application chain system.
  • the first application chain system is the source application chain system
  • the second application chain system is the destination application chain system. That is, the target cross-chain transaction is a transaction initiated by the user of the first application chain system and needs to be sent to the second application chain system.
  • the target cross-chain transaction can contain information such as the source application chain identifier, the destination application chain identifier, the cross-chain transaction serial number, and the invocation information.
  • the source application chain identifier in the target cross-chain transaction is used to identify the source application chain system of the target cross-chain transaction, and the source application chain identifier is the identifier of the first application chain system.
  • the destination application chain identifier in the target cross-chain transaction is used to identify the destination application chain system of the target cross-chain transaction, and the destination application chain identifier is the identifier of the second application chain system.
  • the identity of the application chain system can be the MAC (Media Access) of the application chain system. Control, Media Access Control) address, IP (Internet Protocol, Internet Protocol) address, etc., which are not uniquely limited in this embodiment of the present application.
  • the cross-chain transaction sequence number in the target cross-chain transaction is used to uniquely identify the target cross-chain transaction. According to the cross-chain transaction sequence number of the target cross-chain transaction, it can be determined whether the target cross-chain transaction has been submitted before, which can prevent replay attacks.
  • the call information in the target cross-chain transaction can specify the number of tokens to be transferred, or the function to be called and the call parameters, or the binary code of the contract.
  • the transaction proof (Proof) information corresponding to the target cross-chain transaction is the information used to prove the legitimacy and existence of the target cross-chain transaction.
  • the transaction certification information may be endorsement information.
  • the transaction proof information corresponding to the target cross-chain transaction may include a transaction content hash value and a transaction hash value signature, the transaction content hash value is the transaction content hash value of the target cross-chain transaction, and the transaction hash value signature It is the signature of the hash value of the transaction content by the endorsement node in the first application chain system.
  • the operation of the first cross-chain gateway to obtain the target cross-chain transaction and the corresponding transaction proof information from the first application chain system is similar to the operation of the cross-chain gateway to obtain the cross-chain transaction data from the application chain system to which it is connected in the related art. This is not described in detail in the application examples.
  • the target cross-chain transaction is initiated by the user of the first application chain system.
  • the user equipment can invoke the cross-chain contract deployed on the first application chain system to initiate the target cross-chain transaction to the first application chain system.
  • the first application chain system executes the target cross-chain transaction to store the target cross-chain transaction in the blockchain configured by the first application chain system.
  • the transaction proof information corresponding to the target cross-chain transaction is constructed.
  • the target block identifier is obtained.
  • the target block identifier is used to uniquely identify the target block, and the target block is this blockchain
  • the block used to store the target cross-chain transaction, such as the target block identifier can be the block height of the target block, etc.
  • the first application chain system throws a cross-chain event, and the cross-chain event includes the target cross-chain transaction and the target block identifier.
  • the application chain plug-in polls or subscribes to the cross-chain event, collects transaction proof information associated with the cross-chain event in the first application chain system, and then sends the cross-chain event and the transaction proof information to the first cross-chain gateway. In this way, the first cross-chain gateway can obtain the target cross-chain transaction, the transaction proof information and the target block identifier.
  • the first cross-chain gateway can obtain one or more cross-chain transactions from the first application chain system, which may include the following two possible ways:
  • the first cross-chain gateway obtains a cross-chain transaction and corresponding transaction proof information from the first application chain system, and this cross-chain transaction is the target cross-chain transaction.
  • the first cross-chain gateway can calculate the hash value of the target cross-chain transaction as the first verification information.
  • the first cross-chain gateway can store the target cross-chain transaction and corresponding transaction proof information.
  • the first cross-chain gateway obtains multiple cross-chain transactions and transaction certification information corresponding to each cross-chain transaction from the first application chain system.
  • the multiple cross-chain transactions are all the cross-chain transactions stored in the target block, so the multiple cross-chain transactions include the target cross-chain transaction.
  • the first cross-chain gateway can construct a Merkle tree according to the plurality of cross-chain transactions as the first verification information.
  • the first cross-chain gateway may store the plurality of cross-chain transactions and transaction certification information corresponding to each cross-chain transaction.
  • Step 402 The first cross-chain gateway sends a cross-chain verification request to the relay chain system.
  • the first cross-chain gateway may call a network interface for verifying cross-chain transactions to the relay chain system, so as to send the cross-chain verification request to the relay chain system.
  • the first cross-chain gateway may also send the cross-chain verification request to the relay chain system in other ways, which is not limited in this embodiment of the present application.
  • the cross-chain verification request carries the target cross-chain transaction and corresponding transaction proof information.
  • the cross-chain verification request is used to request the relay chain system to verify the target cross-chain transaction.
  • the cross-chain verification request may carry the cross-chain transaction and the corresponding transaction certification information, and the cross-chain transaction For the target cross-chain transaction.
  • the cross-chain verification request may also carry first verification information, where the first verification information is the hash value of the target cross-chain transaction.
  • the cross-chain verification request may also carry the target block identifier.
  • the cross-chain verification request may carry the multiple cross-chain transactions and each cross-chain transaction Corresponding transaction proof information.
  • the cross-chain verification request may also carry first verification information, where the first verification information is a Merkle tree constructed by the first cross-chain gateway according to the multiple cross-chain transactions.
  • the cross-chain verification request may also carry the target block identifier.
  • Step 403 After receiving the cross-chain verification request, the relay chain system verifies the target cross-chain transaction according to the transaction proof information.
  • the relay chain system may also verify the target cross-chain transaction information according to the first verification information before verifying the target cross-chain transaction according to the transaction certification information. After the verification is passed, the target cross-chain transaction is verified according to the transaction proof information.
  • the relay chain system when the relay chain system verifies the target cross-chain transaction according to the first verification information, the relay chain system can determine the second verification information according to the hash values of all cross-chain transactions carried in the cross-chain verification request, Then, if the first verification information is the same as the second verification information, it is determined that all cross-chain transactions carried in the cross-chain verification request have passed the verification.
  • the first verification information carried in the cross-chain verification request is the same as the second verification information of all cross-chain transactions carried in the cross-chain verification request calculated by the relay chain system, indicating that all cross-chain transactions carried in the cross-chain verification request The transaction has not been tampered with and is authentic. Therefore, the relay chain system can continue to verify the target cross-chain transaction according to the transaction proof information.
  • step 402 when the cross-chain verification request sent by the first cross-chain gateway carries a cross-chain transaction and corresponding transaction proof data, and the carried first verification information is the hash value of the cross-chain transaction, the relay The chain system can calculate the hash value of the target cross-chain transaction carried by the cross-chain verification request as the second verification information. If the calculated hash value is the same as the hash value carried by the cross-chain verification request, the target cross-chain transaction is determined Chain transaction verification passed.
  • the cross-chain verification request sent by the first cross-chain gateway carries multiple cross-chain transactions and transaction certification data corresponding to each cross-chain transaction, and the first verification information carried is the default value of the multiple cross-chain transactions.
  • the relay chain system can construct a Merkle tree as the second verification information according to the multiple cross-chain transactions carried in the cross-chain verification request. If the Merkle tree carried by the verification request is the same, it is determined that the multiple cross-chain transactions have passed the verification.
  • the relay chain system when the relay chain system verifies the target cross-chain transaction according to the transaction proof information, the relay chain system obtains the verification rules corresponding to the first application chain system; all transaction proof information carried in the cross-chain verification request satisfies this requirement. In the case of verification rules, it is determined that all cross-chain transactions carried in the cross-chain verification request have passed the verification.
  • the verification rule corresponding to the first application chain system is a rule used to verify the validity of the cross-chain transaction sent by the first cross-chain gateway connected to the first application chain system, that is, it is used to verify whether the cross-chain transaction exists legally. Rules for the first application chain system.
  • the verification rules corresponding to the first application chain system can be stored in the relay chain system in advance.
  • the first cross-chain gateway can register the identifier of the first application chain system in the relay chain system, and the relay chain system can determine the identity of the first application chain system accordingly.
  • the first application chain system is connected to the first cross-chain gateway.
  • the relay chain system may store the identifier of the first application chain system corresponding to the verification rule. In this way, after receiving the cross-chain verification request sent by the first cross-chain gateway, the relay chain system can find the verification rule corresponding to the first application chain system according to the identifier of the first application chain system to which the first cross-chain gateway is docked.
  • the verification rule corresponding to the first application chain system may be that the number of endorsement nodes that need to be signed is s, and s is a positive integer.
  • the verification rule corresponding to the first application chain system may be that the hash value obtained by signing and decrypting the transaction hash value in the transaction certification information is the same as the transaction content hash value in the transaction certification information.
  • the verification rule may also be other rules, which are not limited in this embodiment of the present application.
  • the relay chain system can obtain the verification rules corresponding to the first application chain system, and then in the target If the transaction proof data corresponding to the cross-chain transaction satisfies the verification rule, it is determined that the target cross-chain transaction has passed the verification.
  • the relay chain system can obtain the verification corresponding to the first application chain system Then, if the transaction proof data corresponding to each cross-chain transaction in the multiple cross-chain transactions satisfies the verification rule, it is determined that the multiple cross-chain transactions have passed the verification.
  • the relay chain system can include multiple relay chain nodes.
  • the first cross-chain gateway sends the cross-chain verification request to one relay chain node among the plurality of relay chain nodes.
  • the relay chain node can verify the cross-chain transaction carried in the cross-chain verification request, and after the verification is passed, the cross-chain verification request is sent to the multiple relay chain nodes except the relay chain node. For other relay chain nodes, the cross-chain transactions carried in the cross-chain verification request are verified by the other relay chain nodes.
  • the relay chain system determines that the cross-chain transaction carried in the cross-chain verification request passes the verification only when the multiple relay chain nodes pass the verification of the cross-chain transaction carried in the cross-chain verification request.
  • Step 404 The relay chain system generates a digital signature of the identification information of the target cross-chain transaction when the target cross-chain transaction is verified.
  • the identification information of the target cross-chain transaction is some simple information used to identify the target cross-chain transaction.
  • the identification information of the target cross-chain transaction does not contain the calling information in the target cross-chain transaction, nor the transaction proof information corresponding to the target cross-chain transaction.
  • the identification information may include at least one of the following: the hash value of the target cross-chain transaction; the target application chain identifier and the cross-chain transaction sequence number in the target cross-chain transaction.
  • the identification information may also include a target block identification.
  • the cross-chain verification request sent by the first cross-chain gateway carries multiple cross-chain transactions and transaction certification data corresponding to each cross-chain transaction, and the first verification information carried is the default value of the multiple cross-chain transactions.
  • the multiple cross-chain transactions have identification information, and the identification information includes at least one of the following: a hash value of the root node in the Merkle tree of the multiple cross-chain transactions; the multiple cross-chain transactions The target application chain identifier and cross-chain transaction serial number in each cross-chain transaction in the cross-chain transaction; target block identifier.
  • the relay chain system when the relay chain system generates the digital signature of the identification information, it can calculate the digest of the identification information, and then use the private key of the relay chain system to encrypt the digest to obtain the digital signature of the identification information.
  • the relay chain system can include multiple relay chain nodes.
  • Each relay chain node of the plurality of relay chain nodes can generate a digital signature of the identification information after passing the cross-chain transaction verification carried in the cross-chain verification request.
  • the digital signature of the identification information generated by the relay chain system is a multiple digital signature, including the digital signature of the identification information generated by each of the multiple relay chain nodes.
  • Step 405 The relay chain system stores the identification information and the digital signature as cross-chain certificates in the blockchain configured by the relay chain system.
  • the identification information is only some simple information used to identify the target cross-chain transaction, it does not contain call information and transaction proof information, so the storage pressure of the relay chain system can be greatly reduced, and the privacy leakage of both parties in the cross-chain can be prevented.
  • the relay chain system can verify the digital signature before storing the identification information and the digital signature as a cross-chain certificate in the blockchain configured by the relay chain system.
  • the identification information and the digital signature are then stored in the blockchain configured by the relay chain system as a cross-chain certificate.
  • the digital signature of the identification information generated by the relay chain system is a multiple digital signature, including the digital signature of the identification information generated by each relay chain node of the plurality of relay chain nodes.
  • a digital signature generated by a relay chain node when the relay chain system verifies the digital signature, it can be determined that the digital signature is verified successfully when the digital signature is successfully decrypted using the public key of the relay chain node.
  • the cross-chain certificate stored in the blockchain configured by the relay chain system can prove that the target cross-chain the validity of the transaction.
  • the cross-chain certificate may include identification information (including the hash value of the target cross-chain transaction, the target application chain identifier and the cross-chain transaction serial number in the target cross-chain transaction), and a digital signature.
  • the cross-chain certificate stored in the blockchain configured by the relay chain system can prove the validity of the multiple cross-chain transactions. effectiveness.
  • the cross-chain certificate may include identification information (including the hash value of the root node in the Merkle tree of the multiple cross-chain transactions, the destination application chain in each of the multiple cross-chain transactions) ID and cross-chain transaction serial number, target block ID), digital signature.
  • Step 406 The relay chain system returns a block confirmation notification to the first cross-chain gateway.
  • the block confirmation notification is used to indicate that the relay chain system has confirmed the validity of the cross-chain transaction carried in the cross-chain verification request sent before.
  • Step 407 After receiving the block confirmation notification, the first cross-chain gateway sends a cross-chain transaction request to the second cross-chain gateway, and the cross-chain transaction request carries the target cross-chain transaction.
  • the first cross-chain gateway after receiving the block confirmation notification, the first cross-chain gateway directly carries the target cross-chain transaction in the cross-chain transaction request sent to the second cross-chain gateway. Further, the cross-chain transaction request may also carry the first verification information, that is, carry the hash value of the target cross-chain transaction.
  • the first cross-chain gateway carries the multiple cross-chain transactions in different In the cross-chain transaction request, one by one is sent to the cross-chain gateway connected to the application chain system identified by the target application chain identifier in the multiple cross-chain transactions. Further, the cross-chain transaction request may also carry first verification information, that is, carry Merkle trees of the multiple cross-chain transactions.
  • Step 408 After receiving the cross-chain transaction request, the second cross-chain gateway obtains the digital signature from the relay chain system according to the identification information.
  • the second cross-chain gateway After receiving the cross-chain transaction request, the second cross-chain gateway can obtain the identification information from the cross-chain transaction request.
  • the second cross-chain gateway may send a cross-chain certificate storage query request to the relay chain system, where the cross-chain certificate storage query request carries the identification information.
  • the relay chain system receives the cross-chain deposit certificate query request, it can determine the cross-chain deposit certificate including the identification information from the configured blockchain, and then obtain the digital signature in the cross-chain deposit certificate. The digital signature is sent to the second cross-chain gateway.
  • Step 409 The second cross-chain gateway verifies the target cross-chain transaction according to the digital signature.
  • the public key of the relay chain system may be stored in the second cross-chain gateway in advance, that is, the public key of each relay chain node of the plurality of relay chain nodes in the relay chain system may be stored.
  • the second cross-chain gateway uses the public key of the relay chain system to decrypt the digital signature. If the digital signature is successfully decrypted, it means that the relay chain system has confirmed the validity of the target cross-chain transaction, and it can be determined The target cross-chain transaction is verified.
  • the second cross-chain gateway decrypts the digital signature using the public key of the relay chain system, and calculates the hash value of the target cross-chain transaction.
  • the digital signature is successfully decrypted using the public key of the relay chain system, and the calculated hash value is the same as the hash value corresponding to the target cross-chain transaction in the first verification information, the verification of the target cross-chain transaction is determined. pass.
  • the hash value corresponding to the target cross-chain transaction in the first verification information is the first verification information.
  • the corresponding hash value of the target cross-chain transaction in the first verification information is the target cross-chain transaction in the The hash value of the corresponding leaf node in the Merkle tree.
  • the digital signature is successfully decrypted using the public key of the relay chain system, indicating that the relay chain system has confirmed the validity of the target cross-chain transaction.
  • the calculated hash value is the same as the corresponding hash value of the target cross-chain transaction in the first verification information, indicating that the target cross-chain transaction is authentic. Therefore, it can be determined that the target cross-chain transaction has passed the verification.
  • Step 410 The second cross-chain gateway sends the target cross-chain transaction to the second application chain system when the target cross-chain transaction is verified.
  • the second application chain system When the second application chain system receives the target cross-chain transaction, it can execute the target cross-chain transaction.
  • the relay chain system stores the cross-chain certificate of the target cross-chain transaction, and the cross-chain certificate includes identification information and digital signature.
  • the identification information is only some simple information used to identify the target cross-chain transaction. It does not include the calling information in the target cross-chain transaction, nor does it include transaction proof information. This can greatly reduce the storage pressure of the relay chain system, and can prevent Privacy disclosure of both parties across the chain.
  • the first cross-chain gateway can directly send the target cross-chain transaction to the second cross-chain gateway, and the second cross-chain gateway can verify the target cross-chain transaction according to the cross-chain certificate stored in the relay chain system. Send the target cross-chain transaction to the second application chain system, so as to ensure the validity of the target cross-chain transaction sent to the second application chain system.
  • FIG. 5 is a flowchart of a cross-chain transaction method provided by an embodiment of the present application. The method is applied to a relay chain system, and the relay chain system may be the above-mentioned relay chain system. Referring to Figure 5, the method may include the following steps.
  • Step 501 Receive a cross-chain verification request sent by the first cross-chain gateway.
  • the cross-chain verification request carries the target cross-chain transaction and corresponding transaction proof information obtained by the first cross-chain gateway from the first application chain system.
  • step 501 has been explained in the above-mentioned steps 401 and 402, which is not repeated in this embodiment of the present application.
  • Step 502 Verify the target cross-chain transaction according to the transaction proof information.
  • step 502 has been explained and described in the foregoing step 403, which is not repeated in this embodiment of the present application.
  • Step 503 When the target cross-chain transaction is verified, a digital signature of the identification information of the target cross-chain transaction is generated.
  • step 503 has been explained in the above-mentioned step 404, which is not repeated in this embodiment of the present application.
  • Step 504 Store the identification information and the digital signature as cross-chain certificates in the blockchain configured by the relay chain system.
  • step 504 has already been explained in the foregoing step 405, which is not repeated in this embodiment of the present application.
  • Step 505 Send a block confirmation notification to the first cross-chain gateway to instruct the first cross-chain gateway to send a cross-chain transaction request to the second cross-chain gateway, where the cross-chain transaction request carries the target cross-chain transaction.
  • step 505 has been explained in the above-mentioned steps 406 and 407, and is not repeated in this embodiment of the present application. It is worth noting that the cross-chain certificate is used when the second cross-chain gateway verifies the target cross-chain transaction. The specific use process has been explained in the above steps 408, 409 and 410. This will not be repeated here.
  • the relay chain system stores the cross-chain certificate of the target cross-chain transaction, and the cross-chain certificate includes identification information and digital signature.
  • the identification information is only some simple information used to identify the target cross-chain transaction. It does not include the calling information in the target cross-chain transaction, nor does it include transaction proof information. This can greatly reduce the storage pressure of the relay chain system, and can prevent Privacy disclosure of both parties across the chain.
  • the first cross-chain gateway can directly send the target cross-chain transaction to the second cross-chain gateway, and the second cross-chain gateway can verify the target cross-chain transaction according to the cross-chain certificate stored in the relay chain system, so as to ensure the reception The validity of the target cross-chain transaction.
  • FIG. 6 is a schematic structural diagram of a cross-chain transaction device provided by an embodiment of the present application.
  • the device is applied to a relay chain system, and the relay chain system may be the above-mentioned relay chain system.
  • the device includes:
  • the receiving module 601 is configured to receive a cross-chain verification request sent by the first cross-chain gateway, where the cross-chain verification request carries the target cross-chain transaction and corresponding transaction certification information obtained by the first cross-chain gateway from the first application chain system.
  • the verification module 602 is configured to verify the target cross-chain transaction according to the transaction proof information.
  • the generating module 603 is configured to generate a digital signature of the identification information of the target cross-chain transaction when the target cross-chain transaction is verified.
  • the storage module 604 is configured to store the identification information and the digital signature in the blockchain configured by the relay chain system as a cross-chain certificate, and the cross-chain certificate is used when the second cross-chain gateway verifies the target cross-chain transaction.
  • the sending module 605 is configured to send a block confirmation notification to the first cross-chain gateway to instruct the first cross-chain gateway to send a cross-chain transaction request to the second cross-chain gateway, where the cross-chain transaction request carries the target cross-chain transaction.
  • the cross-chain verification request carries a cross-chain transaction and corresponding transaction certification information, and a cross-chain transaction is the target cross-chain transaction; the cross-chain verification request also carries first verification information, and the first verification information is the target cross-chain transaction.
  • the cross-chain verification request carries multiple cross-chain transactions and transaction certification information corresponding to each cross-chain transaction.
  • the multiple cross-chain transactions are all cross-chain transactions stored in the target block, and the target block is the first application.
  • the block used to store the target cross-chain transaction in the blockchain configured by the chain system; the cross-chain verification request also carries the first verification information, and the first verification information is constructed by the first cross-chain gateway according to multiple cross-chain transactions. Merkle tree.
  • the device further includes: a computing module for determining the second verification information according to the hash values of all cross-chain transactions carried in the cross-chain verification request; a triggering module for comparing the first verification information with the second verification information; When the verification information is the same, the verification module 602 is triggered to verify the target cross-chain transaction according to the transaction certification information.
  • the verification module 602 is configured to: obtain the verification rules corresponding to the first application chain system; in the case that all transaction proof information carried in the cross-chain verification request satisfies the verification rules, determine all the cross-chain verification requirements carried in the cross-chain verification request. Transaction verification passed.
  • the identification information includes at least one of the following: the hash value of the target cross-chain transaction; the target application chain identifier and the cross-chain transaction sequence number in the target cross-chain transaction.
  • multiple cross-chain transactions have one piece of identification information, and the identification information includes at least one of the following: the hash value of the root node in the Merkle tree; the purpose application in each of the multiple cross-chain transactions Chain ID and cross-chain transaction sequence number; target block ID.
  • the digital signature includes a digital signature of identification information generated by each of the relay chain nodes in the relay chain system.
  • the relay chain system stores the cross-chain certificate of the target cross-chain transaction, and the cross-chain certificate includes identification information and digital signature.
  • the identification information is only some simple information used to identify the target cross-chain transaction. It does not include the calling information in the target cross-chain transaction, nor does it include transaction proof information. This can greatly reduce the storage pressure of the relay chain system, and can prevent Privacy disclosure of both parties across the chain.
  • the first cross-chain gateway can directly send the target cross-chain transaction to the second cross-chain gateway, and the second cross-chain gateway can verify the target cross-chain transaction according to the cross-chain certificate stored in the relay chain system, so as to ensure the reception The validity of the target cross-chain transaction.
  • the cross-chain transaction device provided in the above embodiments only takes the division of the above functional modules as an example for illustration. In practical applications, the above functions can be allocated to different functional modules as required. , that is, dividing the internal structure of the device into different functional modules to complete all or part of the functions described above.
  • cross-chain transaction device and the cross-chain transaction method provided in the above embodiments belong to the same concept.
  • the specific working process of the units and modules in the above embodiments and the technical effects brought by them can be found in the method embodiment section, which will not be repeated here. .
  • FIG. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application.
  • the computer device 7 includes: a processor 70 , a memory 71 , and a computer program 72 stored in the memory 71 and running on the processor 70 .
  • the processor 70 executes the computer program 72 , the above-mentioned embodiment in FIG. 5 is implemented Steps in the cross-chain transaction method in .
  • the computer device 7 may be a general purpose computer device or a special purpose computer device.
  • the computer device 7 may be a desktop computer, a portable computer, a network server, a palmtop computer, a mobile phone, a tablet computer, a wireless terminal device, a communication device or an embedded device, and the embodiment of the present application does not limit the type of the computer device 7 .
  • FIG. 7 is only an example of the computer device 7, and does not constitute a limitation to the computer device 7, and may include more or less components than the one shown, or combine some components, or different components , for example, it may also include input and output devices, network access devices, and so on.
  • the processor 70 may be a central processing unit (Central Processing Unit, CPU), the processor 70 can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor or it may be any conventional processor.
  • the memory 71 may in some embodiments be an internal storage unit of the computer device 7 , such as a hard disk or a memory of the computer device 7 . In other embodiments, the memory 71 may also be an external storage device of the computer device 7 , such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the computer device 7 . card, Flash Card, etc. Further, the memory 71 may also include both an internal storage unit of the computer device 7 and an external storage device. The memory 71 is used to store an operating system, application programs, a boot loader (Boot Loader), data, and other programs, such as program codes of computer programs, and the like. The memory 71 can also be used to temporarily store data that has been output or is to be output.
  • a boot loader Boot Loader
  • Embodiments of the present application also provide a computer device, the computer device comprising: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor executing the computer program
  • the steps in any of the foregoing method embodiments are implemented at the same time.
  • Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented.
  • the embodiments of the present application provide a computer program product, which, when running on a computer, enables the computer to execute the steps in the foregoing method embodiments.
  • the integrated unit if implemented as a software functional unit and sold or used as a stand-alone product, may be stored in a computer-readable storage medium.
  • all or part of the processes in the methods of the above embodiments can be implemented by a computer program to instruct the relevant hardware.
  • the computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments may be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like.
  • the computer-readable medium may include at least: any entity or device capable of carrying the computer program code to the photographing device/terminal device, recording medium, computer memory, ROM (Read-Only Memory, read-only memory), RAM (Random Access Memory) , random access memory), electrical carrier signals, telecommunications signals, and software distribution media.
  • ROM Read-Only Memory, read-only memory
  • RAM Random Access Memory
  • electrical carrier signals telecommunications signals, and software distribution media.
  • U disk mobile hard disk, disk or CD, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Accounting & Taxation (AREA)
  • Bioethics (AREA)
  • Economics (AREA)
  • Automation & Control Theory (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

A cross-chain transaction method, system and apparatus, a device, and a storage medium, which belong to the technical field of blockchains. The method comprises: a first cross-chain gateway sending, to a relay chain system, a cross-chain verification request carrying a target cross-chain transaction and transaction proof information, and the relay chain system verifying the target cross-chain transaction according to the transaction proof information (403); when the verification is passed, generating a digital signature of identification information of the target cross-chain transaction, storing, in a blockchain, the identification information and the digital signature as cross-chain deposit certificates, the first cross-chain gateway sending, to a second cross-chain gateway, a cross-chain transaction request carrying the target cross-chain transaction, and the second cross-chain gateway acquiring, according to the identification information, the digital signature from the relay chain system (408); verifying the target cross-chain transaction according to the digital signature (409); and when the target cross-chain transaction passes the verification, sending the target cross-chain transaction to a second application chain system (410). By means of the method, the storage pressure of a relay chain system can be greatly reduced, and the privacy leaks of both cross-chain parties can be prevented.

Description

跨链交易方法、系统、装置、设备和存储介质Cross-chain transaction method, system, device, device and storage medium
本申请要求于2020年11月06日提交的申请号为202011233653.6、发明名称为“跨链交易方法、系统、装置、设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202011233653.6 and the invention titled "Cross-chain transaction method, system, device, device and storage medium" filed on November 06, 2020, the entire contents of which are incorporated by reference in in this application.
技术领域technical field
本申请涉及跨链技术领域,特别涉及一种跨链交易方法、系统、装置、设备和存储介质。The present application relates to the field of cross-chain technology, and in particular, to a method, system, device, device and storage medium for cross-chain transactions.
背景技术Background technique
随着区块链技术的不断发展,越来越多的区块链系统采用跨链技术来进行互操作访问与协作。跨链技术是指将同构或异构的区块链系统连接起来,以实现区块链之间的信息互通。With the continuous development of blockchain technology, more and more blockchain systems use cross-chain technology for interoperable access and collaboration. Cross-chain technology refers to connecting homogeneous or heterogeneous blockchain systems to achieve information exchange between blockchains.
目前,采用中继链技术实现跨链。具体地,来源应用链系统将跨链交易数据发送到中继链系统,该跨链交易数据包括调用信息和交易证明信息;中继链系统对该跨链交易数据进行验证,在验证通过后,将该跨链交易数据存储至配置的区块链,之后,将该跨链交易数据发送到目的应用链系统。At present, the relay chain technology is used to achieve cross-chain. Specifically, the source application chain system sends the cross-chain transaction data to the relay chain system, and the cross-chain transaction data includes call information and transaction certification information; the relay chain system verifies the cross-chain transaction data, and after the verification is passed, The cross-chain transaction data is stored in the configured blockchain, and then the cross-chain transaction data is sent to the destination application chain system.
上述方式中,跨链交易数据中的调用信息和交易证明信息均存储至中继链系统配置的区块链,从而导致中继链系统的存储压力较大。并且,这种情况下,维护中继链系统的第三方能够获取到该调用信息,因而容易造成跨链双方的隐私泄露。In the above method, the calling information and transaction certification information in the cross-chain transaction data are stored in the blockchain configured by the relay chain system, which results in a large storage pressure on the relay chain system. Moreover, in this case, the third party who maintains the relay chain system can obtain the call information, which may easily lead to the leakage of the privacy of both parties across the chain.
技术问题technical problem
本申请提供了一种跨链交易方法、系统、装置、设备和存储介质,可以减轻中继链系统的存储压力,且可以防止跨链双方隐私泄露。The present application provides a cross-chain transaction method, system, device, device and storage medium, which can reduce the storage pressure of the relay chain system and prevent the leakage of privacy of both parties in the cross-chain.
技术解决方案technical solutions
第一方面,提供了一种跨链交易方法,所述方法包括:第一跨链网关从第一应用链系统获取目标跨链交易及对应的交易证明信息;向中继链系统发送跨链验证请求,所述跨链验证请求携带所述目标跨链交易和所述交易证明信息。所述中继链系统接收到所述跨链验证请求后,根据所述交易证明信息对所述目标跨链交易进行验证;在所述目标跨链交易验证通过时,生成所述目标跨链交易的标识信息的数字签名;将所述标识信息和所述数字签名作为跨链存证存储至所述中继链系统配置的区块链;向所述第一跨链网关返回区块确认通知。所述第一跨链网关接收到所述区块确认通知后,向第二跨链网关发送跨链交易请求,所述跨链交易请求携带所述目标跨链交易。所述第二跨链网关接收到所述跨链交易请求后,根据所述标识信息从所述中继链系统获取所述数字签名;根据所述数字签名对所述目标跨链交易进行验证;在所述目标跨链交易验证通过时,将所述目标跨链交易发送给第二应用链系统。In a first aspect, a cross-chain transaction method is provided, the method includes: a first cross-chain gateway obtains a target cross-chain transaction and corresponding transaction certification information from a first application chain system; and sends a cross-chain verification to the relay chain system request, the cross-chain verification request carries the target cross-chain transaction and the transaction certification information. After receiving the cross-chain verification request, the relay chain system verifies the target cross-chain transaction according to the transaction proof information; when the target cross-chain transaction is verified, the target cross-chain transaction is generated. The digital signature of the identification information; the identification information and the digital signature are stored in the blockchain configured by the relay chain system as a cross-chain certificate; a block confirmation notification is returned to the first cross-chain gateway. After receiving the block confirmation notification, the first cross-chain gateway sends a cross-chain transaction request to the second cross-chain gateway, where the cross-chain transaction request carries the target cross-chain transaction. After receiving the cross-chain transaction request, the second cross-chain gateway obtains the digital signature from the relay chain system according to the identification information; and verifies the target cross-chain transaction according to the digital signature; When the target cross-chain transaction is verified and passed, the target cross-chain transaction is sent to the second application chain system.
第二方面,提供了一种跨链交易系统,所述系统包括:第一跨链网关、中继链系统和第二跨链网关。所述第一跨链网关,用于从第一应用链系统获取目标跨链交易及对应的交易证明信息;向所述中继链系统发送跨链验证请求,所述跨链验证请求携带所述目标跨链交易和所述交易证明信息。所述中继链系统,用于接收到所述跨链验证请求后,根据所述交易证明信息对所述目标跨链交易进行验证;在所述目标跨链交易验证通过时,生成所述目标跨链交易的标识信息的数字签名;将所述标识信息和所述数字签名作为跨链存证存储至所述中继链系统配置的区块链;向所述第一跨链网关返回区块确认通知。所述第一跨链网关,还用于接收到所述区块确认通知后,向所述第二跨链网关发送跨链交易请求,所述跨链交易请求携带所述目标跨链交易。所述第二跨链网关,用于接收到所述跨链交易请求后,根据所述标识信息从所述中继链系统获取所述数字签名;根据所述数字签名对所述目标跨链交易进行验证;在所述目标跨链交易验证通过时,将所述目标跨链交易发送给第二应用链系统。In a second aspect, a cross-chain transaction system is provided, the system includes: a first cross-chain gateway, a relay chain system and a second cross-chain gateway. The first cross-chain gateway is used to obtain the target cross-chain transaction and corresponding transaction certification information from the first application chain system; send a cross-chain verification request to the relay chain system, and the cross-chain verification request carries the The target cross-chain transaction and the transaction proof information. The relay chain system is configured to verify the target cross-chain transaction according to the transaction proof information after receiving the cross-chain verification request; when the target cross-chain transaction is verified, generate the target cross-chain transaction The digital signature of the identification information of the cross-chain transaction; the identification information and the digital signature are stored as the cross-chain certificate in the blockchain configured by the relay chain system; the block chain is returned to the first cross-chain gateway Confirm the notification. The first cross-chain gateway is further configured to send a cross-chain transaction request to the second cross-chain gateway after receiving the block confirmation notification, where the cross-chain transaction request carries the target cross-chain transaction. The second cross-chain gateway is configured to obtain the digital signature from the relay chain system according to the identification information after receiving the cross-chain transaction request; Perform verification; when the target cross-chain transaction is verified, send the target cross-chain transaction to the second application chain system.
第三方面,提供了一种跨链交易方法,应用于中继链系统,所述方法包括:接收第一跨链网关发送的跨链验证请求,所述跨链验证请求携带所述第一跨链网关从第一应用链系统获取的目标跨链交易及对应的交易证明信息。根据所述交易证明信息对所述目标跨链交易进行验证。在所述目标跨链交易验证通过时,生成所述目标跨链交易的标识信息的数字签名。将所述标识信息和所述数字签名作为跨链存证存储至所述中继链系统配置的区块链,所述跨链存证用于在第二跨链网关验证所述目标跨链交易时使用。向所述第一跨链网关发送区块确认通知,以指示所述第一跨链网关向所述第二跨链网关发送跨链交易请求,所述跨链交易请求携带所述目标跨链交易。In a third aspect, a cross-chain transaction method is provided, which is applied to a relay chain system. The method includes: receiving a cross-chain verification request sent by a first cross-chain gateway, where the cross-chain verification request carries the first cross-chain verification request. The target cross-chain transaction and the corresponding transaction proof information obtained by the chain gateway from the first application chain system. The target cross-chain transaction is verified according to the transaction proof information. When the target cross-chain transaction is verified and passed, a digital signature of the identification information of the target cross-chain transaction is generated. The identification information and the digital signature are stored in the blockchain configured by the relay chain system as a cross-chain certificate, and the cross-chain certificate is used to verify the target cross-chain transaction at the second cross-chain gateway when used. Send a block confirmation notification to the first cross-chain gateway to instruct the first cross-chain gateway to send a cross-chain transaction request to the second cross-chain gateway, where the cross-chain transaction request carries the target cross-chain transaction .
第四方面,提供了一种跨链交易装置,应用于中继链系统,所述装置包括:In a fourth aspect, a cross-chain transaction device is provided, which is applied to a relay chain system, and the device includes:
接收模块,用于接收第一跨链网关发送的跨链验证请求,所述跨链验证请求携带所述第一跨链网关从第一应用链系统获取的目标跨链交易及对应的交易证明信息。验证模块,用于根据所述交易证明信息对所述目标跨链交易进行验证。生成模块,用于在所述目标跨链交易验证通过时,生成所述目标跨链交易的标识信息的数字签名。存储模块,用于将所述标识信息和所述数字签名作为跨链存证存储至所述中继链系统配置的区块链,所述跨链存证用于在第二跨链网关验证所述目标跨链交易时使用。发送模块,用于向所述第一跨链网关发送区块确认通知,以指示所述第一跨链网关向所述第二跨链网关发送跨链交易请求,所述跨链交易请求携带所述目标跨链交易。A receiving module, configured to receive a cross-chain verification request sent by the first cross-chain gateway, where the cross-chain verification request carries the target cross-chain transaction and corresponding transaction certification information obtained by the first cross-chain gateway from the first application chain system . A verification module, configured to verify the target cross-chain transaction according to the transaction certification information. The generating module is configured to generate a digital signature of the identification information of the target cross-chain transaction when the target cross-chain transaction is verified. The storage module is used to store the identification information and the digital signature in the blockchain configured by the relay chain system as a cross-chain deposit certificate, and the cross-chain deposit certificate is used for verifying at the second cross-chain gateway. It is used when the target cross-chain transaction is mentioned. A sending module, configured to send a block confirmation notification to the first cross-chain gateway to instruct the first cross-chain gateway to send a cross-chain transaction request to the second cross-chain gateway, and the cross-chain transaction request carries the Describe the target cross-chain transaction.
第五方面,提供了一种计算机设备,所述计算机设备包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现上述第三方面所述的跨链交易方法。In a fifth aspect, there is provided a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being executed by the processor When implementing the cross-chain transaction method described in the third aspect above.
第六方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述第三方面所述的跨链交易方法。In a sixth aspect, a computer-readable storage medium is provided, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the cross-chain transaction method described in the third aspect above is implemented.
第七方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第三方面所述的跨链交易方法的步骤。In a seventh aspect, a computer program product containing instructions is provided, which, when run on a computer, causes the computer to execute the steps of the cross-chain transaction method described in the third aspect above.
有益效果beneficial effect
在本申请中,中继链系统存储目标跨链交易的跨链存证,该跨链存证包括标识信息和数字签名。该标识信息仅是用于标识目标跨链交易的一些简单信息,不包含目标跨链交易中的调用信息,也不包含交易证明信息,如此可以大大降低中继链系统的存储压力,且可以防止跨链双方的隐私泄露。之后,第一跨链网关可以将目标跨链交易直接发送给第二跨链网关,第二跨链网关可以根据中继链系统存储的跨链存证来验证目标跨链交易,在验证通过后将目标跨链交易发送给第二应用链系统,如此可以保证发送给第二应用链系统的目标跨链交易的有效性。In this application, the relay chain system stores the cross-chain certificate of the target cross-chain transaction, and the cross-chain certificate includes identification information and digital signature. The identification information is only some simple information used to identify the target cross-chain transaction. It does not include the calling information in the target cross-chain transaction, nor does it include transaction proof information. This can greatly reduce the storage pressure of the relay chain system, and can prevent Privacy disclosure of both parties across the chain. After that, the first cross-chain gateway can directly send the target cross-chain transaction to the second cross-chain gateway, and the second cross-chain gateway can verify the target cross-chain transaction according to the cross-chain certificate stored in the relay chain system. Send the target cross-chain transaction to the second application chain system, so as to ensure the validity of the target cross-chain transaction sent to the second application chain system.
附图说明Description of drawings
图1是本申请实施例提供的一种区块链系统的结构示意图;1 is a schematic structural diagram of a blockchain system provided by an embodiment of the present application;
图2是本申请实施例提供的一种区块链的示意图;FIG. 2 is a schematic diagram of a blockchain provided by an embodiment of the present application;
图3是本申请实施例提供的一种跨链交易系统的示意图;3 is a schematic diagram of a cross-chain transaction system provided by an embodiment of the present application;
图4是本申请实施例提供的一种跨链交易方法的流程图;4 is a flowchart of a cross-chain transaction method provided by an embodiment of the present application;
图5是本申请实施例提供的另一种跨链交易方法的流程图;FIG. 5 is a flowchart of another cross-chain transaction method provided by an embodiment of the present application;
图6是本申请实施例提供的一种跨链交易装置的结构示意图;FIG. 6 is a schematic structural diagram of a cross-chain transaction device provided by an embodiment of the present application;
图7是本申请实施例提供的一种计算机设备的结构示意图。FIG. 7 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
本发明的实施方式Embodiments of the present invention
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
在对本申请实施例进行解释说明之前,先对区块链的相关内容予以说明。Before explaining the embodiments of the present application, the relevant content of the blockchain will be explained first.
图1是本申请实施例提供的一种区块链系统的结构示意图。FIG. 1 is a schematic structural diagram of a blockchain system provided by an embodiment of the present application.
参见图1,区块链系统100是指用于进行节点与节点之间数据共享的系统,区块链系统100中可以包括多个节点101,多个节点101可以是指区块链系统100中各个客户端。每个节点101在进行正常工作可以接收到输入信息,并基于接收到的输入信息维护区块链系统100内的共享数据。为了保证区块链系统100内的信息互通,区块链系统100中的每个节点101之间可以存在信息连接,节点101之间可以通过该信息连接进行信息传输。比如,当区块链系统100中的任意节点101接收到输入信息时,区块链系统100中的其他节点101便根据共识算法获取该输入信息,将该输入信息作为共享数据中的数据进行存储,使得区块链系统100中全部节点101上存储的数据一致。Referring to FIG. 1 , the blockchain system 100 refers to a system for sharing data between nodes. The blockchain system 100 may include multiple nodes 101 , and multiple nodes 101 may refer to the system in the blockchain system 100 . each client. Each node 101 can receive input information during normal work, and maintain shared data within the blockchain system 100 based on the received input information. In order to ensure the information exchange in the blockchain system 100, an information connection may exist between each node 101 in the blockchain system 100, and information transmission may be performed between the nodes 101 through the information connection. For example, when any node 101 in the blockchain system 100 receives input information, other nodes 101 in the blockchain system 100 obtain the input information according to the consensus algorithm, and store the input information as data in the shared data , so that the data stored on all nodes 101 in the blockchain system 100 are consistent.
区块链系统100中的每个节点101均存储一条相同的区块链。参见图2,区块链由多个区块组成,创始块中包括区块头和区块主体,区块头中存储有输入信息特征值、版本号、时间戳和难度值,区块主体中存储有输入信息;创始块的下一区块以创始块为父区块,下一区块中同样包括区块头和区块主体,区块头中存储有当前区块的输入信息特征值、父区块的区块头特征值、版本号、时间戳和难度值,并以此类推,使得区块链中每个区块中存储的区块数据均与父区块中存储的区块数据存在关联,保证了区块中输入信息的安全性。Each node 101 in the blockchain system 100 stores an identical blockchain. Referring to Figure 2, the blockchain consists of multiple blocks. The founding block includes a block header and a block body. The block header stores the input information feature value, version number, timestamp and difficulty value. The block body stores Input information; the next block of the genesis block takes the genesis block as the parent block, the next block also includes the block header and the block body, and the block header stores the input information characteristic value of the current block, the parent block's The block header feature value, version number, timestamp, and difficulty value, and so on, make the block data stored in each block in the blockchain associated with the block data stored in the parent block, ensuring that Security of the information entered in the block.
区块链系统100具有分布式数据存储、点对点传输、共识机制、加密算法等计算机技术。区块链系统100是一个分布式的共享账本和数据库,具有去中心化、不可篡改、全程留痕、可以追溯、集体维护、公开透明等特点。这些特点保证了区块链的共享开放、真实完整和安全可靠。The blockchain system 100 has computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. The blockchain system 100 is a distributed shared ledger and database, which has the characteristics of decentralization, non-tampering, full traces, traceability, collective maintenance, openness and transparency, etc. These features ensure the shared openness, authenticity, integrity, security and reliability of the blockchain.
下面对本申请实施例涉及的名词予以说明。The terms involved in the embodiments of the present application will be described below.
应用链系统:应用链系统是执行跨链交易的区块链系统。Lisk system: Lisk system is a blockchain system that performs cross-chain transactions.
中继链系统:中继链系统是一种区块链系统。中继链系统可以接入应用链系统,以实现跨链交易的验证。Relay chain system: The relay chain system is a blockchain system. The relay chain system can be connected to the application chain system to realize the verification of cross-chain transactions.
跨链网关:跨链网关是应用链系统和中继链系统之间的转接器。跨链网关可以捕获应用链系统中产生的跨链事件,提交跨链交易数据到中继链系统;或者,跨链网关可以接收中继链系统验证通过的跨链交易,提交跨链交易到应用链系统。Cross-chain gateway: Cross-chain gateway is an adapter between the application chain system and the relay chain system. The cross-chain gateway can capture the cross-chain events generated in the application chain system and submit the cross-chain transaction data to the relay chain system; or, the cross-chain gateway can receive the cross-chain transactions verified by the relay chain system and submit the cross-chain transaction to the application. chain system.
跨链交易:跨链交易是两个应用链系统之间的交易,可以包含来源应用链标识、目的应用链标识、跨链交易序号、调用信息等信息。Cross-chain transaction: Cross-chain transaction is a transaction between two AppChain systems, which can include source AppChain ID, destination AppChain ID, cross-chain transaction serial number, call information and other information.
下面对本申请实施例涉及的系统架构予以说明。The system architecture involved in the embodiments of the present application will be described below.
图3是本申请实施例提供的一种跨链交易系统的示意图。参见图3,该跨链交易系统包括:第一跨链网关301、中继链系统302、第二跨链网关303。FIG. 3 is a schematic diagram of a cross-chain transaction system provided by an embodiment of the present application. Referring to FIG. 3 , the cross-chain transaction system includes: a first cross-chain gateway 301 , a relay chain system 302 , and a second cross-chain gateway 303 .
第一跨链网关301是与第一应用链系统304对接的跨链网关。第二跨链网关303是与第二应用链系统305对接的跨链网关。第一跨链网关301可以通过有线网络或无线网络与第二跨链网关303进行通信。中继链系统302位于第一跨链网关301与第二跨链网关303之间。中继链系统302可以通过有线网络或无线网络与第一跨链网关301进行通信,也可以通过有线网络或无线网络与第二跨链网关303进行通信。第一应用链系统304、第二应用链系统305和中继链系统302均是区块链系统,该区块链系统可以是如上文图1-图2实施例所述的区块链系统100。The first cross-chain gateway 301 is a cross-chain gateway connected with the first application chain system 304 . The second cross-chain gateway 303 is a cross-chain gateway connected with the second application chain system 305 . The first cross-chain gateway 301 may communicate with the second cross-chain gateway 303 through a wired network or a wireless network. The relay chain system 302 is located between the first cross-chain gateway 301 and the second cross-chain gateway 303 . The relay chain system 302 can communicate with the first cross-chain gateway 301 through a wired network or a wireless network, and can also communicate with the second cross-chain gateway 303 through a wired network or a wireless network. The first application chain system 304, the second application chain system 305 and the relay chain system 302 are all block chain systems, and the block chain system may be the block chain system 100 described in the embodiments of FIG. 1-FIG. 2 above. .
本申请实施例中,第一应用链系统304与第二应用链系统305之间具有跨链交易。对于该跨链交易,第一应用链系统304可以是来源应用链系统,第二应用链系统305可以是目的应用链系统。也即,该跨链交易可以是由第一应用链系统304的用户发起的、需要发送到第二应用链系统305的交易。In this embodiment of the present application, there is a cross-chain transaction between the first application chain system 304 and the second application chain system 305 . For the cross-chain transaction, the first application chain system 304 may be the source application chain system, and the second application chain system 305 may be the destination application chain system. That is, the cross-chain transaction may be a transaction initiated by the user of the first application chain system 304 and needs to be sent to the second application chain system 305 .
第一跨链网关301、中继链系统302和第二跨链网关303可以执行下文图4实施例所述的跨链交易方法,来实现第一应用链系统304与第二应用链系统305之间的跨链交易。The first cross-chain gateway 301 , the relay chain system 302 and the second cross-chain gateway 303 can execute the cross-chain transaction method described in the embodiment of FIG. 4 below to realize the connection between the first application chain system 304 and the second application chain system 305 cross-chain transactions.
接下来对本申请实施例提供的跨链交易方法进行详细地解释说明。Next, the cross-chain transaction method provided by the embodiment of the present application will be explained in detail.
图4是本申请实施例提供的一种跨链交易方法的流程图。参见图4,包括以下步骤。FIG. 4 is a flowchart of a cross-chain transaction method provided by an embodiment of the present application. Referring to Figure 4, the following steps are included.
步骤401:第一跨链网关从第一应用链系统获取目标跨链交易及对应的交易证明信息。Step 401: The first cross-chain gateway obtains the target cross-chain transaction and corresponding transaction proof information from the first application chain system.
目标跨链交易是第一应用链系统与第二应用链系统之间的交易。对于目标跨链交易,第一应用链系统是来源应用链系统,第二应用链系统是目的应用链系统。也即,目标跨链交易是由第一应用链系统的用户发起的、需要发送到第二应用链系统的交易。目标跨链交易可以包含来源应用链标识、目的应用链标识、跨链交易序号、调用信息等信息。The target cross-chain transaction is the transaction between the first application chain system and the second application chain system. For the target cross-chain transaction, the first application chain system is the source application chain system, and the second application chain system is the destination application chain system. That is, the target cross-chain transaction is a transaction initiated by the user of the first application chain system and needs to be sent to the second application chain system. The target cross-chain transaction can contain information such as the source application chain identifier, the destination application chain identifier, the cross-chain transaction serial number, and the invocation information.
目标跨链交易中的来源应用链标识用于标识目标跨链交易的来源应用链系统,该来源应用链标识即是第一应用链系统的标识。目标跨链交易中的目的应用链标识用于标识目标跨链交易的目的应用链系统,该目的应用链标识即是第二应用链系统的标识。应用链系统的标识可以是该应用链系统的MAC(Media Access Control,介质访问控制)地址、IP(Internet Protocol,互联网协议)地址等,本申请实施例对此不作唯一限定。The source application chain identifier in the target cross-chain transaction is used to identify the source application chain system of the target cross-chain transaction, and the source application chain identifier is the identifier of the first application chain system. The destination application chain identifier in the target cross-chain transaction is used to identify the destination application chain system of the target cross-chain transaction, and the destination application chain identifier is the identifier of the second application chain system. The identity of the application chain system can be the MAC (Media Access) of the application chain system. Control, Media Access Control) address, IP (Internet Protocol, Internet Protocol) address, etc., which are not uniquely limited in this embodiment of the present application.
目标跨链交易中的跨链交易序号用于唯一标识目标跨链交易。根据目标跨链交易的跨链交易序号可以确定目标跨链交易之前是否提交过,如此可以防止重放攻击。The cross-chain transaction sequence number in the target cross-chain transaction is used to uniquely identify the target cross-chain transaction. According to the cross-chain transaction sequence number of the target cross-chain transaction, it can be determined whether the target cross-chain transaction has been submitted before, which can prevent replay attacks.
目标跨链交易中的调用信息可以指定需要转账的代币(token)数量,或者指定需要调用的函数以及调用参数,或者指定合约的二进制代码。The call information in the target cross-chain transaction can specify the number of tokens to be transferred, or the function to be called and the call parameters, or the binary code of the contract.
目标跨链交易对应的交易证明(Proof)信息是用于证明目标跨链交易的合法性和存在性的信息。示例地,当第一应用链系统为联盟链Fabric系统时,该交易证明信息可以为背书信息。比如,目标跨链交易对应的交易证明信息可以包括交易内容哈希值和交易哈希值签名,该交易内容哈希值是目标跨链交易的交易内容的哈希值,该交易哈希值签名是第一应用链系统中的背书节点对该交易内容哈希值的签名。The transaction proof (Proof) information corresponding to the target cross-chain transaction is the information used to prove the legitimacy and existence of the target cross-chain transaction. For example, when the first application chain system is a consortium chain Fabric system, the transaction certification information may be endorsement information. For example, the transaction proof information corresponding to the target cross-chain transaction may include a transaction content hash value and a transaction hash value signature, the transaction content hash value is the transaction content hash value of the target cross-chain transaction, and the transaction hash value signature It is the signature of the hash value of the transaction content by the endorsement node in the first application chain system.
其中,第一跨链网关从第一应用链系统获取目标跨链交易及对应的交易证明信息的操作与相关技术中跨链网关从其对接的应用链系统获取跨链交易数据的操作类似,本申请实施例对此不进行详细阐述。The operation of the first cross-chain gateway to obtain the target cross-chain transaction and the corresponding transaction proof information from the first application chain system is similar to the operation of the cross-chain gateway to obtain the cross-chain transaction data from the application chain system to which it is connected in the related art. This is not described in detail in the application examples.
例如,目标跨链交易由第一应用链系统的用户发起,具体地,用户设备可以调用部署在第一应用链系统上的跨链合约来向第一应用链系统发起目标跨链交易。第一应用链系统接收到目标跨链交易后,执行目标跨链交易以将目标跨链交易存储至第一应用链系统配置的区块链,并且,第一应用链系统在目标跨链交易的执行过程中构造目标跨链交易对应的交易证明信息。第一应用链系统将目标跨链交易存储至第一应用链系统配置的区块链后,得到目标区块标识,目标区块标识用于唯一标识目标区块,目标区块是此区块链中用于存储目标跨链交易的区块,如目标区块标识可以是目标区块的区块高度等。之后,第一应用链系统抛出一个跨链事件,此跨链事件包括目标跨链交易和目标区块标识。应用链插件轮询或订阅该跨链事件,并收集第一应用链系统中与该跨链事件关联的交易证明信息,然后将该跨链事件和该交易证明信息发送到第一跨链网关。如此,第一跨链网关就可以获取到目标跨链交易、该交易证明信息和目标区块标识。For example, the target cross-chain transaction is initiated by the user of the first application chain system. Specifically, the user equipment can invoke the cross-chain contract deployed on the first application chain system to initiate the target cross-chain transaction to the first application chain system. After the first application chain system receives the target cross-chain transaction, it executes the target cross-chain transaction to store the target cross-chain transaction in the blockchain configured by the first application chain system. During the execution process, the transaction proof information corresponding to the target cross-chain transaction is constructed. After the first application chain system stores the target cross-chain transaction in the blockchain configured by the first application chain system, the target block identifier is obtained. The target block identifier is used to uniquely identify the target block, and the target block is this blockchain The block used to store the target cross-chain transaction, such as the target block identifier can be the block height of the target block, etc. After that, the first application chain system throws a cross-chain event, and the cross-chain event includes the target cross-chain transaction and the target block identifier. The application chain plug-in polls or subscribes to the cross-chain event, collects transaction proof information associated with the cross-chain event in the first application chain system, and then sends the cross-chain event and the transaction proof information to the first cross-chain gateway. In this way, the first cross-chain gateway can obtain the target cross-chain transaction, the transaction proof information and the target block identifier.
第一跨链网关可以从第一应用链系统获取一个或多个跨链交易,具体可以包括如下两种可能的方式:The first cross-chain gateway can obtain one or more cross-chain transactions from the first application chain system, which may include the following two possible ways:
第一种可能的方式中,第一跨链网关从第一应用链系统获取一个跨链交易及对应的交易证明信息,这一个跨链交易是目标跨链交易。这种方式下,第一跨链网关可以计算目标跨链交易的哈希值作为第一校验信息。并且,第一跨链网关可以存储目标跨链交易及对应的交易证明信息。In a first possible manner, the first cross-chain gateway obtains a cross-chain transaction and corresponding transaction proof information from the first application chain system, and this cross-chain transaction is the target cross-chain transaction. In this way, the first cross-chain gateway can calculate the hash value of the target cross-chain transaction as the first verification information. Moreover, the first cross-chain gateway can store the target cross-chain transaction and corresponding transaction proof information.
第二种可能方式中,第一跨链网关从第一应用链系统获取多个跨链交易和每个跨链交易对应的交易证明信息。该多个跨链交易是目标区块中存储的所有跨链交易,因而该多个跨链交易中包括目标跨链交易。这种方式下,第一跨链网关可以根据该多个跨链交易构造默克尔树作为第一校验信息。并且,第一跨链网关可以存储该多个跨链交易和每个跨链交易对应的交易证明信息。In the second possible manner, the first cross-chain gateway obtains multiple cross-chain transactions and transaction certification information corresponding to each cross-chain transaction from the first application chain system. The multiple cross-chain transactions are all the cross-chain transactions stored in the target block, so the multiple cross-chain transactions include the target cross-chain transaction. In this manner, the first cross-chain gateway can construct a Merkle tree according to the plurality of cross-chain transactions as the first verification information. Moreover, the first cross-chain gateway may store the plurality of cross-chain transactions and transaction certification information corresponding to each cross-chain transaction.
步骤402:第一跨链网关向中继链系统发送跨链验证请求。Step 402: The first cross-chain gateway sends a cross-chain verification request to the relay chain system.
具体地,第一跨链网关可以向中继链系统调用用于验证跨链交易的网络接口,以向中继链系统发送该跨链验证请求。当然,第一跨链网关也可以通过其他方式向中继链系统发送跨链验证请求,本申请实施例对此不作限定。Specifically, the first cross-chain gateway may call a network interface for verifying cross-chain transactions to the relay chain system, so as to send the cross-chain verification request to the relay chain system. Of course, the first cross-chain gateway may also send the cross-chain verification request to the relay chain system in other ways, which is not limited in this embodiment of the present application.
该跨链验证请求携带目标跨链交易及对应的交易证明信息。该跨链验证请求用于请求中继链系统对目标跨链交易进行验证。The cross-chain verification request carries the target cross-chain transaction and corresponding transaction proof information. The cross-chain verification request is used to request the relay chain system to verify the target cross-chain transaction.
在步骤401中第一跨链网关仅获取了一个跨链交易及对应的交易证明信息的情况下,该跨链验证请求可以携带这一个跨链交易及对应的交易证明信息,这一个跨链交易为目标跨链交易。这种情况下,该跨链验证请求还可以携带第一校验信息,第一校验信息为目标跨链交易的哈希值。进一步地,该跨链验证请求还可以携带目标区块标识。In the case where the first cross-chain gateway only obtains one cross-chain transaction and the corresponding transaction certification information in step 401, the cross-chain verification request may carry the cross-chain transaction and the corresponding transaction certification information, and the cross-chain transaction For the target cross-chain transaction. In this case, the cross-chain verification request may also carry first verification information, where the first verification information is the hash value of the target cross-chain transaction. Further, the cross-chain verification request may also carry the target block identifier.
在步骤401中第一跨链网关获取了多个跨链交易和每个跨链交易对应的交易证明信息的情况下,该跨链验证请求可以携带该多个跨链交易和每个跨链交易对应的交易证明信息。这种情况下,该跨链验证请求还可以携带第一校验信息,第一校验信息为第一跨链网关根据该多个跨链交易构造的默克尔树。进一步地,该跨链验证请求中还可以携带目标区块标识。In the case where the first cross-chain gateway obtains multiple cross-chain transactions and transaction certification information corresponding to each cross-chain transaction in step 401, the cross-chain verification request may carry the multiple cross-chain transactions and each cross-chain transaction Corresponding transaction proof information. In this case, the cross-chain verification request may also carry first verification information, where the first verification information is a Merkle tree constructed by the first cross-chain gateway according to the multiple cross-chain transactions. Further, the cross-chain verification request may also carry the target block identifier.
步骤403:中继链系统接收到该跨链验证请求后,根据该交易证明信息对目标跨链交易进行验证。Step 403: After receiving the cross-chain verification request, the relay chain system verifies the target cross-chain transaction according to the transaction proof information.
若该跨链验证请求携带第一校验信息,则中继链系统在根据该交易证明信息对目标跨链交易进行验证之前,还可以先根据第一校验信息对目标跨链交易信息进行校验,在校验通过后,再根据该交易证明信息对目标跨链交易进行验证。If the cross-chain verification request carries the first verification information, the relay chain system may also verify the target cross-chain transaction information according to the first verification information before verifying the target cross-chain transaction according to the transaction certification information. After the verification is passed, the target cross-chain transaction is verified according to the transaction proof information.
其中,中继链系统根据第一校验信息对目标跨链交易进行校验时,中继链系统可以根据该跨链验证请求携带的所有跨链交易的哈希值确定第二校验信息,然后在第一校验信息与第二校验信息相同的情况下,确定该跨链验证请求携带的所有跨链交易校验通过。Wherein, when the relay chain system verifies the target cross-chain transaction according to the first verification information, the relay chain system can determine the second verification information according to the hash values of all cross-chain transactions carried in the cross-chain verification request, Then, if the first verification information is the same as the second verification information, it is determined that all cross-chain transactions carried in the cross-chain verification request have passed the verification.
该跨链验证请求携带的第一校验信息与中继链系统计算出的该跨链验证请求携带的所有跨链交易的第二校验信息相同,说明该跨链验证请求携带的所有跨链交易未被篡改,具备真实性。因而中继链系统可以继续根据该交易证明信息对目标跨链交易进行验证。The first verification information carried in the cross-chain verification request is the same as the second verification information of all cross-chain transactions carried in the cross-chain verification request calculated by the relay chain system, indicating that all cross-chain transactions carried in the cross-chain verification request The transaction has not been tampered with and is authentic. Therefore, the relay chain system can continue to verify the target cross-chain transaction according to the transaction proof information.
在步骤402中第一跨链网关发送的跨链验证请求携带一个跨链交易及对应的交易证明数据,以及携带的第一校验信息为这个跨链交易的哈希值的情况下,中继链系统可以计算该跨链验证请求携带的目标跨链交易的哈希值作为第二校验信息,若计算出的哈希值与该跨链验证请求携带的哈希值相同,则确定目标跨链交易校验通过。In step 402, when the cross-chain verification request sent by the first cross-chain gateway carries a cross-chain transaction and corresponding transaction proof data, and the carried first verification information is the hash value of the cross-chain transaction, the relay The chain system can calculate the hash value of the target cross-chain transaction carried by the cross-chain verification request as the second verification information. If the calculated hash value is the same as the hash value carried by the cross-chain verification request, the target cross-chain transaction is determined Chain transaction verification passed.
在步骤402中第一跨链网关发送的跨链验证请求携带多个跨链交易和每个跨链交易对应的交易证明数据,以及携带的第一校验信息为该多个跨链交易的默克尔树的情况下,中继链系统可以根据该跨链验证请求携带的该多个跨链交易构造默克尔树作为第二校验信息,若构造出的默克尔树与该跨链验证请求携带的默克尔树相同,则确定该多个跨链交易均校验通过。In step 402, the cross-chain verification request sent by the first cross-chain gateway carries multiple cross-chain transactions and transaction certification data corresponding to each cross-chain transaction, and the first verification information carried is the default value of the multiple cross-chain transactions. In the case of a Kerr tree, the relay chain system can construct a Merkle tree as the second verification information according to the multiple cross-chain transactions carried in the cross-chain verification request. If the Merkle tree carried by the verification request is the same, it is determined that the multiple cross-chain transactions have passed the verification.
其中,中继链系统根据该交易证明信息对目标跨链交易进行验证时,中继链系统获取第一应用链系统对应的验证规则;在该跨链验证请求携带的所有交易证明信息均满足该验证规则的情况下,确定该跨链验证请求携带的所有跨链交易验证通过。Among them, when the relay chain system verifies the target cross-chain transaction according to the transaction proof information, the relay chain system obtains the verification rules corresponding to the first application chain system; all transaction proof information carried in the cross-chain verification request satisfies this requirement. In the case of verification rules, it is determined that all cross-chain transactions carried in the cross-chain verification request have passed the verification.
第一应用链系统对应的验证规则是用于验证由与第一应用链系统对接的第一跨链网关发送的跨链交易的有效性的规则,即是用于验证此跨链交易是否合法存在于第一应用链系统的规则。第一应用链系统对应的验证规则可以事先存储于中继链系统。The verification rule corresponding to the first application chain system is a rule used to verify the validity of the cross-chain transaction sent by the first cross-chain gateway connected to the first application chain system, that is, it is used to verify whether the cross-chain transaction exists legally. Rules for the first application chain system. The verification rules corresponding to the first application chain system can be stored in the relay chain system in advance.
可选地,第一跨链网关向中继链系统发送跨链验证请求之前,第一跨链网关可以在中继链系统注册第一应用链系统的标识,中继链系统据此可以确定与第一应用链系统对接的是第一跨链网关。中继链系统可以将第一应用链系统的标识与验证规则对应存储。如此,中继链系统接收到第一跨链网关发送的跨链验证请求后,可以根据第一跨链网关对接的第一应用链系统的标识查找到第一应用链系统对应的验证规则。Optionally, before the first cross-chain gateway sends a cross-chain verification request to the relay chain system, the first cross-chain gateway can register the identifier of the first application chain system in the relay chain system, and the relay chain system can determine the identity of the first application chain system accordingly. The first application chain system is connected to the first cross-chain gateway. The relay chain system may store the identifier of the first application chain system corresponding to the verification rule. In this way, after receiving the cross-chain verification request sent by the first cross-chain gateway, the relay chain system can find the verification rule corresponding to the first application chain system according to the identifier of the first application chain system to which the first cross-chain gateway is docked.
示例地,第一应用链系统对应的验证规则可以是需要签名的背书节点个数为s个,s为正整数。或者,第一应用链系统对应的验证规则可以是对交易证明信息中的交易哈希值签名解密后得到的哈希值与该交易证明信息中的交易内容哈希值相同。当然,该验证规则还可以为其他的规则,本申请实施例对此不作限定。For example, the verification rule corresponding to the first application chain system may be that the number of endorsement nodes that need to be signed is s, and s is a positive integer. Alternatively, the verification rule corresponding to the first application chain system may be that the hash value obtained by signing and decrypting the transaction hash value in the transaction certification information is the same as the transaction content hash value in the transaction certification information. Of course, the verification rule may also be other rules, which are not limited in this embodiment of the present application.
在步骤402中第一跨链网关发送的跨链验证请求携带一个跨链交易及其对应的交易证明数据的情况下,中继链系统可以获取第一应用链系统对应的验证规则,然后在目标跨链交易对应的交易证明数据满足该验证规则的情况下,确定目标跨链交易验证通过。In the case where the cross-chain verification request sent by the first cross-chain gateway in step 402 carries a cross-chain transaction and its corresponding transaction proof data, the relay chain system can obtain the verification rules corresponding to the first application chain system, and then in the target If the transaction proof data corresponding to the cross-chain transaction satisfies the verification rule, it is determined that the target cross-chain transaction has passed the verification.
在步骤402中第一跨链网关发送的跨链验证请求携带多个跨链交易和每个跨链交易对应的交易证明数据的情况下,中继链系统可以获取第一应用链系统对应的验证规则,然后在该多个跨链交易中每个跨链交易对应的交易证明数据均满足该验证规则的情况下,确定该多个跨链交易均验证通过。In the case where the cross-chain verification request sent by the first cross-chain gateway in step 402 carries multiple cross-chain transactions and transaction certification data corresponding to each cross-chain transaction, the relay chain system can obtain the verification corresponding to the first application chain system Then, if the transaction proof data corresponding to each cross-chain transaction in the multiple cross-chain transactions satisfies the verification rule, it is determined that the multiple cross-chain transactions have passed the verification.
值得注意的是,中继链系统可以包括多个中继链节点。第一跨链网关将跨链验证请求发送到该多个中继链节点中的一个中继链节点。这个中继链节点可以对该跨链验证请求携带的跨链交易进行验证,在验证通过后,将该跨链验证请求发送给该多个中继链节点中除这个中继链节点之外的其他中继链节点,由该其他中继链节点对该跨链验证请求携带的跨链交易进行验证。在该多个中继链节点均对该跨链验证请求携带的跨链交易验证通过的情况下,中继链系统才确定对该跨链验证请求携带的跨链交易验证通过。It is worth noting that the relay chain system can include multiple relay chain nodes. The first cross-chain gateway sends the cross-chain verification request to one relay chain node among the plurality of relay chain nodes. The relay chain node can verify the cross-chain transaction carried in the cross-chain verification request, and after the verification is passed, the cross-chain verification request is sent to the multiple relay chain nodes except the relay chain node. For other relay chain nodes, the cross-chain transactions carried in the cross-chain verification request are verified by the other relay chain nodes. The relay chain system determines that the cross-chain transaction carried in the cross-chain verification request passes the verification only when the multiple relay chain nodes pass the verification of the cross-chain transaction carried in the cross-chain verification request.
步骤404:中继链系统在目标跨链交易验证通过时,生成目标跨链交易的标识信息的数字签名。Step 404: The relay chain system generates a digital signature of the identification information of the target cross-chain transaction when the target cross-chain transaction is verified.
目标跨链交易的标识信息是用于标识目标跨链交易的一些简单信息。目标跨链交易的标识信息不含有目标跨链交易中的调用信息,也不含有目标跨链交易对应的交易证明信息。The identification information of the target cross-chain transaction is some simple information used to identify the target cross-chain transaction. The identification information of the target cross-chain transaction does not contain the calling information in the target cross-chain transaction, nor the transaction proof information corresponding to the target cross-chain transaction.
在步骤402中第一跨链网关发送的跨链验证请求携带一个跨链交易及其对应的交易证明数据,以及携带的第一校验信息为这个跨链交易的哈希值的情况下,该标识信息可以包括以下至少一项:目标跨链交易的哈希值;目标跨链交易中的目的应用链标识和跨链交易序号。此外,该标识信息中还可以包括目标区块标识。In step 402, when the cross-chain verification request sent by the first cross-chain gateway carries a cross-chain transaction and its corresponding transaction proof data, and the carried first verification information is the hash value of the cross-chain transaction, the The identification information may include at least one of the following: the hash value of the target cross-chain transaction; the target application chain identifier and the cross-chain transaction sequence number in the target cross-chain transaction. In addition, the identification information may also include a target block identification.
在步骤402中第一跨链网关发送的跨链验证请求携带多个跨链交易和每个跨链交易对应的交易证明数据,以及携带的第一校验信息为该多个跨链交易的默克尔树的情况下,该多个跨链交易具有一个标识信息,该标识信息包括以下至少一项:该多个跨链交易的默克尔树中的根节点的哈希值;该多个跨链交易中每个跨链交易中的目的应用链标识和跨链交易序号;目标区块标识。In step 402, the cross-chain verification request sent by the first cross-chain gateway carries multiple cross-chain transactions and transaction certification data corresponding to each cross-chain transaction, and the first verification information carried is the default value of the multiple cross-chain transactions. In the case of a Kerr tree, the multiple cross-chain transactions have identification information, and the identification information includes at least one of the following: a hash value of the root node in the Merkle tree of the multiple cross-chain transactions; the multiple cross-chain transactions The target application chain identifier and cross-chain transaction serial number in each cross-chain transaction in the cross-chain transaction; target block identifier.
其中,中继链系统生成该标识信息的数字签名时,可以计算该标识信息的摘要,然后使用中继链系统的私钥对此摘要进行加密,得到该标识信息的数字签名。Wherein, when the relay chain system generates the digital signature of the identification information, it can calculate the digest of the identification information, and then use the private key of the relay chain system to encrypt the digest to obtain the digital signature of the identification information.
值得注意的是,中继链系统可以包括多个中继链节点。该多个中继链节点中的每个中继链节点对该跨链验证请求携带的跨链交易验证通过后,都可以生成该标识信息的数字签名。这种情况下,中继链系统生成的该标识信息的数字签名是一个多重数字签名,包括该多个中继链节点中每个中继链节点生成的该标识信息的数字签名。It is worth noting that the relay chain system can include multiple relay chain nodes. Each relay chain node of the plurality of relay chain nodes can generate a digital signature of the identification information after passing the cross-chain transaction verification carried in the cross-chain verification request. In this case, the digital signature of the identification information generated by the relay chain system is a multiple digital signature, including the digital signature of the identification information generated by each of the multiple relay chain nodes.
步骤405:中继链系统将该标识信息和该数字签名作为跨链存证存储至中继链系统配置的区块链。Step 405: The relay chain system stores the identification information and the digital signature as cross-chain certificates in the blockchain configured by the relay chain system.
由于该标识信息仅是用于标识目标跨链交易的一些简单信息,其中不含有调用信息和交易证明信息,所以可以大大减轻中继链系统的存储压力,且可以防止跨链双方的隐私泄露。Since the identification information is only some simple information used to identify the target cross-chain transaction, it does not contain call information and transaction proof information, so the storage pressure of the relay chain system can be greatly reduced, and the privacy leakage of both parties in the cross-chain can be prevented.
进一步地,中继链系统将该标识信息和该数字签名作为跨链存证存储至中继链系统配置的区块链之前,可以先验证该数字签名,在该数字签名验证通过的情况下,再将该标识信息和该数字签名作为跨链存证存储至中继链系统配置的区块链。Further, the relay chain system can verify the digital signature before storing the identification information and the digital signature as a cross-chain certificate in the blockchain configured by the relay chain system. The identification information and the digital signature are then stored in the blockchain configured by the relay chain system as a cross-chain certificate.
示例地,中继链系统生成的该标识信息的数字签名是一个多重数字签名,包括该多个中继链节点中每个中继链节点生成的该标识信息的数字签名。对于某个中继链节点生成的一个数字签名,中继链系统验证这个数字签名时,可以在使用这个中继链节点的公钥成功解密该数字签名的情况下,确定这个数字签名验证通过。For example, the digital signature of the identification information generated by the relay chain system is a multiple digital signature, including the digital signature of the identification information generated by each relay chain node of the plurality of relay chain nodes. For a digital signature generated by a relay chain node, when the relay chain system verifies the digital signature, it can be determined that the digital signature is verified successfully when the digital signature is successfully decrypted using the public key of the relay chain node.
值得说明的是,在步骤402中第一跨链网关发送的跨链验证请求携带一个跨链交易的情况下,中继链系统配置的区块链存储的该跨链存证可以证明目标跨链交易的有效性。比如,该跨链存证可以包括标识信息(包括目标跨链交易的哈希值、目标跨链交易中的目的应用链标识和跨链交易序号)、数字签名。It is worth noting that, in the case where the cross-chain verification request sent by the first cross-chain gateway in step 402 carries a cross-chain transaction, the cross-chain certificate stored in the blockchain configured by the relay chain system can prove that the target cross-chain the validity of the transaction. For example, the cross-chain certificate may include identification information (including the hash value of the target cross-chain transaction, the target application chain identifier and the cross-chain transaction serial number in the target cross-chain transaction), and a digital signature.
在步骤402中第一跨链网关发送的跨链验证请求携带多个跨链交易的情况下,中继链系统配置的区块链存储的该跨链存证可以证明该多个跨链交易的有效性。比如,该跨链存证可以包括标识信息(包括该多个跨链交易的默克尔树中的根节点的哈希值、该多个跨链交易中每个跨链交易中的目的应用链标识和跨链交易序号、目标区块标识)、数字签名。如此,对于同一区块中的多个跨链交易,中继链系统只需存储一个跨链存证就可以证明这一区块中的多个跨链交易的有效性,从而可以进一步降低中继链系统的存储压力。In the case where the cross-chain verification request sent by the first cross-chain gateway in step 402 carries multiple cross-chain transactions, the cross-chain certificate stored in the blockchain configured by the relay chain system can prove the validity of the multiple cross-chain transactions. effectiveness. For example, the cross-chain certificate may include identification information (including the hash value of the root node in the Merkle tree of the multiple cross-chain transactions, the destination application chain in each of the multiple cross-chain transactions) ID and cross-chain transaction serial number, target block ID), digital signature. In this way, for multiple cross-chain transactions in the same block, the relay chain system only needs to store one cross-chain certificate to prove the validity of multiple cross-chain transactions in this block, which can further reduce the number of relays. Storage pressure of the chain system.
步骤406:中继链系统向第一跨链网关返回区块确认通知。Step 406: The relay chain system returns a block confirmation notification to the first cross-chain gateway.
该区块确认通知用于指示中继链系统已确认此前发送的跨链验证请求携带的跨链交易的有效性。The block confirmation notification is used to indicate that the relay chain system has confirmed the validity of the cross-chain transaction carried in the cross-chain verification request sent before.
步骤407:第一跨链网关接收到该区块确认通知后,向第二跨链网关发送跨链交易请求,该跨链交易请求携带目标跨链交易。Step 407: After receiving the block confirmation notification, the first cross-chain gateway sends a cross-chain transaction request to the second cross-chain gateway, and the cross-chain transaction request carries the target cross-chain transaction.
在步骤402中第一跨链网关发送的跨链验证请求携带一个跨链交易的情况下,第一跨链网关接收到该区块确认通知后,直接将目标跨链交易携带于跨链交易请求中发送给第二跨链网关。进一步地,该跨链交易请求还可以携带第一校验信息,即携带目标跨链交易的哈希值。In the case where the cross-chain verification request sent by the first cross-chain gateway carries a cross-chain transaction in step 402, after receiving the block confirmation notification, the first cross-chain gateway directly carries the target cross-chain transaction in the cross-chain transaction request sent to the second cross-chain gateway. Further, the cross-chain transaction request may also carry the first verification information, that is, carry the hash value of the target cross-chain transaction.
在步骤402中第一跨链网关发送的跨链验证请求携带多个跨链交易的情况下,第一跨链网关接收到该区块确认通知后,将该多个跨链交易携带于不同的跨链交易请求中,并一一发送给与该多个跨链交易中的目的应用链标识所标识的应用链系统对接的跨链网关。进一步地,该跨链交易请求还可以携带第一校验信息,即携带该多个跨链交易的默克尔树。In the case where the cross-chain verification request sent by the first cross-chain gateway carries multiple cross-chain transactions in step 402, the first cross-chain gateway carries the multiple cross-chain transactions in different In the cross-chain transaction request, one by one is sent to the cross-chain gateway connected to the application chain system identified by the target application chain identifier in the multiple cross-chain transactions. Further, the cross-chain transaction request may also carry first verification information, that is, carry Merkle trees of the multiple cross-chain transactions.
步骤408:第二跨链网关接收到该跨链交易请求后,根据该标识信息从中继链系统获取该数字签名。Step 408: After receiving the cross-chain transaction request, the second cross-chain gateway obtains the digital signature from the relay chain system according to the identification information.
第二跨链网关接收到该跨链交易请求后,可以从该跨链交易请求中获取该标识信息。After receiving the cross-chain transaction request, the second cross-chain gateway can obtain the identification information from the cross-chain transaction request.
具体地,第二跨链网关可以向中继链系统发送跨链存证查询请求,该跨链存证查询请求中携带该标识信息。中继链系统接收到该跨链存证查询请求时,可以从配置的区块链中确定包括有该标识信息的跨链存证,然后获取该跨链存证中的数字签名,将获取到的数字签名发送给第二跨链网关。Specifically, the second cross-chain gateway may send a cross-chain certificate storage query request to the relay chain system, where the cross-chain certificate storage query request carries the identification information. When the relay chain system receives the cross-chain deposit certificate query request, it can determine the cross-chain deposit certificate including the identification information from the configured blockchain, and then obtain the digital signature in the cross-chain deposit certificate. The digital signature is sent to the second cross-chain gateway.
步骤409:第二跨链网关根据该数字签名对目标跨链交易进行验证。Step 409: The second cross-chain gateway verifies the target cross-chain transaction according to the digital signature.
第二跨链网关中可以事先存储有中继链系统的公钥,即可以存储有中继链系统中的多个中继链节点中每个中继链节点的公钥。The public key of the relay chain system may be stored in the second cross-chain gateway in advance, that is, the public key of each relay chain node of the plurality of relay chain nodes in the relay chain system may be stored.
一种可能的方式中,第二跨链网关使用中继链系统的公钥解密该数字签名,若成功解密该数字签名,说明中继链系统已经确认目标跨链交易的有效性,则可以确定目标跨链交易验证通过。In a possible way, the second cross-chain gateway uses the public key of the relay chain system to decrypt the digital signature. If the digital signature is successfully decrypted, it means that the relay chain system has confirmed the validity of the target cross-chain transaction, and it can be determined The target cross-chain transaction is verified.
另一种可能的情况下,若跨链交易请求携带第一校验信息,则第二跨链网关使用中继链系统的公钥解密该数字签名,且计算目标跨链交易的哈希值,在使用中继链系统的公钥成功解密该数字签名,且计算出的哈希值与目标跨链交易在第一校验信息中对应的哈希值相同的情况下,确定目标跨链交易验证通过。In another possible case, if the cross-chain transaction request carries the first verification information, the second cross-chain gateway decrypts the digital signature using the public key of the relay chain system, and calculates the hash value of the target cross-chain transaction, When the digital signature is successfully decrypted using the public key of the relay chain system, and the calculated hash value is the same as the hash value corresponding to the target cross-chain transaction in the first verification information, the verification of the target cross-chain transaction is determined. pass.
在该跨链交易请求携带的第一校验信息是目标跨链交易的哈希值时,目标跨链交易在第一校验信息中对应的哈希值就是第一校验信息。When the first verification information carried in the cross-chain transaction request is the hash value of the target cross-chain transaction, the hash value corresponding to the target cross-chain transaction in the first verification information is the first verification information.
在该跨链交易请求携带的第一校验信息是该多个跨链交易的默克尔树时,目标跨链交易在第一校验信息中对应的哈希值是目标跨链交易在该默克尔树中对应的叶子节点的哈希值。When the first verification information carried in the cross-chain transaction request is the Merkle tree of the multiple cross-chain transactions, the corresponding hash value of the target cross-chain transaction in the first verification information is the target cross-chain transaction in the The hash value of the corresponding leaf node in the Merkle tree.
使用中继链系统的公钥成功解密该数字签名,说明中继链系统已经确认目标跨链交易的有效性。计算出的哈希值与目标跨链交易在第一校验信息中对应的哈希值相同,说明目标跨链交易具备真实性。因而可以确定目标跨链交易验证通过。The digital signature is successfully decrypted using the public key of the relay chain system, indicating that the relay chain system has confirmed the validity of the target cross-chain transaction. The calculated hash value is the same as the corresponding hash value of the target cross-chain transaction in the first verification information, indicating that the target cross-chain transaction is authentic. Therefore, it can be determined that the target cross-chain transaction has passed the verification.
步骤410:第二跨链网关在目标跨链交易验证通过时,将目标跨链交易发送给第二应用链系统。Step 410: The second cross-chain gateway sends the target cross-chain transaction to the second application chain system when the target cross-chain transaction is verified.
第二应用链系统接收到目标跨链交易时,可以执行目标跨链交易。When the second application chain system receives the target cross-chain transaction, it can execute the target cross-chain transaction.
在本申请实施例中,中继链系统存储目标跨链交易的跨链存证,该跨链存证包括标识信息和数字签名。该标识信息仅是用于标识目标跨链交易的一些简单信息,不包含目标跨链交易中的调用信息,也不包含交易证明信息,如此可以大大降低中继链系统的存储压力,且可以防止跨链双方的隐私泄露。之后,第一跨链网关可以将目标跨链交易直接发送给第二跨链网关,第二跨链网关可以根据中继链系统存储的跨链存证来验证目标跨链交易,在验证通过后将目标跨链交易发送给第二应用链系统,如此可以保证发送给第二应用链系统的目标跨链交易的有效性。In the embodiment of the present application, the relay chain system stores the cross-chain certificate of the target cross-chain transaction, and the cross-chain certificate includes identification information and digital signature. The identification information is only some simple information used to identify the target cross-chain transaction. It does not include the calling information in the target cross-chain transaction, nor does it include transaction proof information. This can greatly reduce the storage pressure of the relay chain system, and can prevent Privacy disclosure of both parties across the chain. After that, the first cross-chain gateway can directly send the target cross-chain transaction to the second cross-chain gateway, and the second cross-chain gateway can verify the target cross-chain transaction according to the cross-chain certificate stored in the relay chain system. Send the target cross-chain transaction to the second application chain system, so as to ensure the validity of the target cross-chain transaction sent to the second application chain system.
图5是本申请实施例提供的一种跨链交易方法的流程图。该方法应用于中继链系统,该中继链系统可以是上述的中继链系统。参见图5,该方法可以包括如下步骤。FIG. 5 is a flowchart of a cross-chain transaction method provided by an embodiment of the present application. The method is applied to a relay chain system, and the relay chain system may be the above-mentioned relay chain system. Referring to Figure 5, the method may include the following steps.
步骤501:接收第一跨链网关发送的跨链验证请求。该跨链验证请求携带第一跨链网关从第一应用链系统获取的目标跨链交易及对应的交易证明信息。Step 501: Receive a cross-chain verification request sent by the first cross-chain gateway. The cross-chain verification request carries the target cross-chain transaction and corresponding transaction proof information obtained by the first cross-chain gateway from the first application chain system.
步骤501的相关内容已经在上述步骤401和步骤402进行解释说明,本申请实施例对此不再赘述。The relevant content of step 501 has been explained in the above-mentioned steps 401 and 402, which is not repeated in this embodiment of the present application.
步骤502:根据该交易证明信息对目标跨链交易进行验证。Step 502: Verify the target cross-chain transaction according to the transaction proof information.
步骤502的相关内容已经在上述步骤403进行解释说明,本申请实施例对此不再赘述。The related content of step 502 has been explained and described in the foregoing step 403, which is not repeated in this embodiment of the present application.
步骤503:在目标跨链交易验证通过时,生成目标跨链交易的标识信息的数字签名。Step 503: When the target cross-chain transaction is verified, a digital signature of the identification information of the target cross-chain transaction is generated.
步骤503的相关内容已经在上述步骤404进行解释说明,本申请实施例对此不再赘述。The related content of step 503 has been explained in the above-mentioned step 404, which is not repeated in this embodiment of the present application.
步骤504:将该标识信息和该数字签名作为跨链存证存储至中继链系统配置的区块链。Step 504: Store the identification information and the digital signature as cross-chain certificates in the blockchain configured by the relay chain system.
步骤504的相关内容已经在上述步骤405进行解释说明,本申请实施例对此不再赘述。The related content of step 504 has already been explained in the foregoing step 405, which is not repeated in this embodiment of the present application.
步骤505:向第一跨链网关发送区块确认通知,以指示第一跨链网关向第二跨链网关发送跨链交易请求,该跨链交易请求携带目标跨链交易。Step 505: Send a block confirmation notification to the first cross-chain gateway to instruct the first cross-chain gateway to send a cross-chain transaction request to the second cross-chain gateway, where the cross-chain transaction request carries the target cross-chain transaction.
步骤505的相关内容已经在上述步骤406和步骤407进行解释说明,本申请实施例对此不再赘述。值得注意的是,该跨链存证用于在第二跨链网关验证目标跨链交易时使用,具体的使用过程已在上述步骤408、步骤409和步骤410进行解释说明,本申请实施例对此不再赘述。The relevant content of step 505 has been explained in the above-mentioned steps 406 and 407, and is not repeated in this embodiment of the present application. It is worth noting that the cross-chain certificate is used when the second cross-chain gateway verifies the target cross-chain transaction. The specific use process has been explained in the above steps 408, 409 and 410. This will not be repeated here.
在本申请实施例中,中继链系统存储目标跨链交易的跨链存证,该跨链存证包括标识信息和数字签名。该标识信息仅是用于标识目标跨链交易的一些简单信息,不包含目标跨链交易中的调用信息,也不包含交易证明信息,如此可以大大降低中继链系统的存储压力,且可以防止跨链双方的隐私泄露。之后,第一跨链网关可以将目标跨链交易直接发送给第二跨链网关,第二跨链网关可以根据中继链系统存储的跨链存证来验证目标跨链交易,如此可以保证接收到的目标跨链交易的有效性。In the embodiment of the present application, the relay chain system stores the cross-chain certificate of the target cross-chain transaction, and the cross-chain certificate includes identification information and digital signature. The identification information is only some simple information used to identify the target cross-chain transaction. It does not include the calling information in the target cross-chain transaction, nor does it include transaction proof information. This can greatly reduce the storage pressure of the relay chain system, and can prevent Privacy disclosure of both parties across the chain. After that, the first cross-chain gateway can directly send the target cross-chain transaction to the second cross-chain gateway, and the second cross-chain gateway can verify the target cross-chain transaction according to the cross-chain certificate stored in the relay chain system, so as to ensure the reception The validity of the target cross-chain transaction.
图6是本申请实施例提供的一种跨链交易装置的结构示意图。该装置应用于中继链系统,该中继链系统可以是上述的中继链系统。参见图6,该装置包括:FIG. 6 is a schematic structural diagram of a cross-chain transaction device provided by an embodiment of the present application. The device is applied to a relay chain system, and the relay chain system may be the above-mentioned relay chain system. Referring to Figure 6, the device includes:
接收模块601,用于接收第一跨链网关发送的跨链验证请求,跨链验证请求携带第一跨链网关从第一应用链系统获取的目标跨链交易及对应的交易证明信息。验证模块602,用于根据交易证明信息对目标跨链交易进行验证。生成模块603,用于在目标跨链交易验证通过时,生成目标跨链交易的标识信息的数字签名。存储模块604,用于将标识信息和数字签名作为跨链存证存储至中继链系统配置的区块链,跨链存证用于在第二跨链网关验证目标跨链交易时使用。发送模块605,用于向第一跨链网关发送区块确认通知,以指示第一跨链网关向第二跨链网关发送跨链交易请求,跨链交易请求携带目标跨链交易。The receiving module 601 is configured to receive a cross-chain verification request sent by the first cross-chain gateway, where the cross-chain verification request carries the target cross-chain transaction and corresponding transaction certification information obtained by the first cross-chain gateway from the first application chain system. The verification module 602 is configured to verify the target cross-chain transaction according to the transaction proof information. The generating module 603 is configured to generate a digital signature of the identification information of the target cross-chain transaction when the target cross-chain transaction is verified. The storage module 604 is configured to store the identification information and the digital signature in the blockchain configured by the relay chain system as a cross-chain certificate, and the cross-chain certificate is used when the second cross-chain gateway verifies the target cross-chain transaction. The sending module 605 is configured to send a block confirmation notification to the first cross-chain gateway to instruct the first cross-chain gateway to send a cross-chain transaction request to the second cross-chain gateway, where the cross-chain transaction request carries the target cross-chain transaction.
可选地,跨链验证请求携带一个跨链交易及对应的交易证明信息,一个跨链交易为目标跨链交易;跨链验证请求还携带第一校验信息,第一校验信息为目标跨链交易的哈希值。可选地,跨链验证请求携带多个跨链交易和每个跨链交易对应的交易证明信息,多个跨链交易是目标区块中存储的所有跨链交易,目标区块是第一应用链系统配置的区块链中用于存储目标跨链交易的区块;跨链验证请求还携带第一校验信息,第一校验信息为第一跨链网关根据多个跨链交易构造的默克尔树。可选地,该装置还包括:计算模块,用于根据跨链验证请求携带的所有跨链交易的哈希值确定第二校验信息;触发模块,用于在第一校验信息与第二校验信息相同的情况下,触发验证模块602根据交易证明信息对目标跨链交易进行验证。可选地,验证模块602用于:获取第一应用链系统对应的验证规则;在跨链验证请求携带的所有交易证明信息均满足验证规则的情况下,确定跨链验证请求携带的所有跨链交易验证通过。可选地,标识信息包括以下至少一项:目标跨链交易的哈希值;目标跨链交易中的目的应用链标识和跨链交易序号。可选地,多个跨链交易具有一个标识信息,标识信息包括以下至少一项:默克尔树中的根节点的哈希值;多个跨链交易中每个跨链交易中的目的应用链标识和跨链交易序号;目标区块标识。可选地,数字签名包括中继链系统中的多个中继链节点中每个中继链节点生成的标识信息的数字签名。Optionally, the cross-chain verification request carries a cross-chain transaction and corresponding transaction certification information, and a cross-chain transaction is the target cross-chain transaction; the cross-chain verification request also carries first verification information, and the first verification information is the target cross-chain transaction. The hash of the chain transaction. Optionally, the cross-chain verification request carries multiple cross-chain transactions and transaction certification information corresponding to each cross-chain transaction. The multiple cross-chain transactions are all cross-chain transactions stored in the target block, and the target block is the first application. The block used to store the target cross-chain transaction in the blockchain configured by the chain system; the cross-chain verification request also carries the first verification information, and the first verification information is constructed by the first cross-chain gateway according to multiple cross-chain transactions. Merkle tree. Optionally, the device further includes: a computing module for determining the second verification information according to the hash values of all cross-chain transactions carried in the cross-chain verification request; a triggering module for comparing the first verification information with the second verification information; When the verification information is the same, the verification module 602 is triggered to verify the target cross-chain transaction according to the transaction certification information. Optionally, the verification module 602 is configured to: obtain the verification rules corresponding to the first application chain system; in the case that all transaction proof information carried in the cross-chain verification request satisfies the verification rules, determine all the cross-chain verification requirements carried in the cross-chain verification request. Transaction verification passed. Optionally, the identification information includes at least one of the following: the hash value of the target cross-chain transaction; the target application chain identifier and the cross-chain transaction sequence number in the target cross-chain transaction. Optionally, multiple cross-chain transactions have one piece of identification information, and the identification information includes at least one of the following: the hash value of the root node in the Merkle tree; the purpose application in each of the multiple cross-chain transactions Chain ID and cross-chain transaction sequence number; target block ID. Optionally, the digital signature includes a digital signature of identification information generated by each of the relay chain nodes in the relay chain system.
在本申请实施例中,中继链系统存储目标跨链交易的跨链存证,该跨链存证包括标识信息和数字签名。该标识信息仅是用于标识目标跨链交易的一些简单信息,不包含目标跨链交易中的调用信息,也不包含交易证明信息,如此可以大大降低中继链系统的存储压力,且可以防止跨链双方的隐私泄露。之后,第一跨链网关可以将目标跨链交易直接发送给第二跨链网关,第二跨链网关可以根据中继链系统存储的跨链存证来验证目标跨链交易,如此可以保证接收到的目标跨链交易的有效性。In the embodiment of the present application, the relay chain system stores the cross-chain certificate of the target cross-chain transaction, and the cross-chain certificate includes identification information and digital signature. The identification information is only some simple information used to identify the target cross-chain transaction. It does not include the calling information in the target cross-chain transaction, nor does it include transaction proof information. This can greatly reduce the storage pressure of the relay chain system, and can prevent Privacy disclosure of both parties across the chain. After that, the first cross-chain gateway can directly send the target cross-chain transaction to the second cross-chain gateway, and the second cross-chain gateway can verify the target cross-chain transaction according to the cross-chain certificate stored in the relay chain system, so as to ensure the reception The validity of the target cross-chain transaction.
需要说明的是:上述实施例提供的跨链交易装置在跨链交易时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。It should be noted that: the cross-chain transaction device provided in the above embodiments only takes the division of the above functional modules as an example for illustration. In practical applications, the above functions can be allocated to different functional modules as required. , that is, dividing the internal structure of the device into different functional modules to complete all or part of the functions described above.
上述实施例提供的跨链交易装置与跨链交易方法实施例属于同一构思,上述实施例中单元、模块的具体工作过程及带来的技术效果,可参见方法实施例部分,此处不再赘述。The cross-chain transaction device and the cross-chain transaction method provided in the above embodiments belong to the same concept. The specific working process of the units and modules in the above embodiments and the technical effects brought by them can be found in the method embodiment section, which will not be repeated here. .
图7为本申请实施例提供的一种计算机设备的结构示意图。如图7所示,计算机设备7包括:处理器70、存储器71以及存储在存储器71中并可在处理器70上运行的计算机程序72,处理器70执行计算机程序72时实现上述图5实施例中的跨链交易方法中的步骤。FIG. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in FIG. 7 , the computer device 7 includes: a processor 70 , a memory 71 , and a computer program 72 stored in the memory 71 and running on the processor 70 . When the processor 70 executes the computer program 72 , the above-mentioned embodiment in FIG. 5 is implemented Steps in the cross-chain transaction method in .
计算机设备7可以是一个通用计算机设备或一个专用计算机设备。在具体实现中,计算机设备7可以是台式机、便携式电脑、网络服务器、掌上电脑、移动手机、平板电脑、无线终端设备、通信设备或嵌入式设备,本申请实施例不限定计算机设备7的类型。本领域技术人员可以理解,图7仅仅是计算机设备7的举例,并不构成对计算机设备7的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,比如还可以包括输入输出设备、网络接入设备等。The computer device 7 may be a general purpose computer device or a special purpose computer device. In a specific implementation, the computer device 7 may be a desktop computer, a portable computer, a network server, a palmtop computer, a mobile phone, a tablet computer, a wireless terminal device, a communication device or an embedded device, and the embodiment of the present application does not limit the type of the computer device 7 . Those skilled in the art can understand that FIG. 7 is only an example of the computer device 7, and does not constitute a limitation to the computer device 7, and may include more or less components than the one shown, or combine some components, or different components , for example, it may also include input and output devices, network access devices, and so on.
处理器70可以是中央处理单元(Central Processing Unit,CPU),处理器70还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者也可以是任何常规的处理器。The processor 70 may be a central processing unit (Central Processing Unit, CPU), the processor 70 can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or it may be any conventional processor.
存储器71在一些实施例中可以是计算机设备7的内部存储单元,比如计算机设备7的硬盘或内存。存储器71在另一些实施例中也可以是计算机设备7的外部存储设备,比如计算机设备7上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器71还可以既包括计算机设备7的内部存储单元也包括外部存储设备。存储器71用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,比如计算机程序的程序代码等。存储器71还可以用于暂时地存储已经输出或者将要输出的数据。The memory 71 may in some embodiments be an internal storage unit of the computer device 7 , such as a hard disk or a memory of the computer device 7 . In other embodiments, the memory 71 may also be an external storage device of the computer device 7 , such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the computer device 7 . card, Flash Card, etc. Further, the memory 71 may also include both an internal storage unit of the computer device 7 and an external storage device. The memory 71 is used to store an operating system, application programs, a boot loader (Boot Loader), data, and other programs, such as program codes of computer programs, and the like. The memory 71 can also be used to temporarily store data that has been output or is to be output.
本申请实施例还提供了一种计算机设备,该计算机设备包括:至少一个处理器、存储器以及存储在该存储器中并可在该至少一个处理器上运行的计算机程序,该处理器执行该计算机程序时实现上述任意各个方法实施例中的步骤。本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。本申请实施例提供了一种计算机程序产品,当其在计算机上运行时,使得计算机执行上述各个方法实施例中的步骤。Embodiments of the present application also provide a computer device, the computer device comprising: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor executing the computer program The steps in any of the foregoing method embodiments are implemented at the same time. Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be implemented. The embodiments of the present application provide a computer program product, which, when running on a computer, enables the computer to execute the steps in the foregoing method embodiments.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,该计算机程序包括计算机程序代码,该计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。该计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、ROM(Read-Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。The integrated unit, if implemented as a software functional unit and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program to instruct the relevant hardware. The computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments may be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like. The computer-readable medium may include at least: any entity or device capable of carrying the computer program code to the photographing device/terminal device, recording medium, computer memory, ROM (Read-Only Memory, read-only memory), RAM (Random Access Memory) , random access memory), electrical carrier signals, telecommunications signals, and software distribution media. For example, U disk, mobile hard disk, disk or CD, etc.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the above-mentioned embodiments, those of ordinary skill in the art should understand that: it can still be used for the above-mentioned implementations. The technical solutions described in the examples are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions in the embodiments of the application, and should be included in the within the scope of protection of this application.

Claims (14)

  1. 一种跨链交易方法,其特征在于,所述方法包括:A cross-chain transaction method, characterized in that the method includes:
    第一跨链网关从第一应用链系统获取目标跨链交易及对应的交易证明信息;向中继链系统发送跨链验证请求,所述跨链验证请求携带所述目标跨链交易和所述交易证明信息;The first cross-chain gateway obtains the target cross-chain transaction and the corresponding transaction proof information from the first application chain system; sends a cross-chain verification request to the relay chain system, the cross-chain verification request carries the target cross-chain transaction and the transaction proof information;
    所述中继链系统接收到所述跨链验证请求后,根据所述交易证明信息对所述目标跨链交易进行验证;在所述目标跨链交易验证通过时,生成所述目标跨链交易的标识信息的数字签名;将所述标识信息和所述数字签名作为跨链存证存储至所述中继链系统配置的区块链;向所述第一跨链网关返回区块确认通知;After receiving the cross-chain verification request, the relay chain system verifies the target cross-chain transaction according to the transaction proof information; when the target cross-chain transaction is verified, the target cross-chain transaction is generated. The digital signature of the identification information; the identification information and the digital signature are stored as the cross-chain certificate in the blockchain configured by the relay chain system; the block confirmation notification is returned to the first cross-chain gateway;
    所述第一跨链网关接收到所述区块确认通知后,向第二跨链网关发送跨链交易请求,所述跨链交易请求携带所述目标跨链交易;After receiving the block confirmation notification, the first cross-chain gateway sends a cross-chain transaction request to the second cross-chain gateway, where the cross-chain transaction request carries the target cross-chain transaction;
    所述第二跨链网关接收到所述跨链交易请求后,根据所述标识信息从所述中继链系统获取所述数字签名;根据所述数字签名对所述目标跨链交易进行验证;在所述目标跨链交易验证通过时,将所述目标跨链交易发送给第二应用链系统。After receiving the cross-chain transaction request, the second cross-chain gateway obtains the digital signature from the relay chain system according to the identification information; and verifies the target cross-chain transaction according to the digital signature; When the target cross-chain transaction is verified and passed, the target cross-chain transaction is sent to the second application chain system.
  2. 如权利要求1所述的方法,其特征在于,所述跨链验证请求携带一个跨链交易及对应的交易证明信息,所述一个跨链交易为所述目标跨链交易;所述跨链验证请求还携带第一校验信息,所述第一校验信息为所述目标跨链交易的哈希值。The method of claim 1, wherein the cross-chain verification request carries a cross-chain transaction and corresponding transaction certification information, and the cross-chain transaction is the target cross-chain transaction; the cross-chain verification The request also carries first verification information, where the first verification information is the hash value of the target cross-chain transaction.
  3. 如权利要求1所述的方法,其特征在于,所述跨链验证请求携带多个跨链交易和每个跨链交易对应的交易证明信息,所述多个跨链交易是目标区块中存储的所有跨链交易,所述目标区块是所述第一应用链系统配置的区块链中用于存储所述目标跨链交易的区块;所述跨链验证请求还携带第一校验信息,所述第一校验信息为所述第一跨链网关根据所述多个跨链交易构造的默克尔树。The method of claim 1, wherein the cross-chain verification request carries multiple cross-chain transactions and transaction certification information corresponding to each cross-chain transaction, and the multiple cross-chain transactions are stored in the target block. All the cross-chain transactions of the first application chain, the target block is the block used to store the target cross-chain transaction in the blockchain configured by the first application chain system; the cross-chain verification request also carries the first verification information, the first verification information is a Merkle tree constructed by the first cross-chain gateway according to the multiple cross-chain transactions.
  4. 如权利要求2或3所述的方法,其特征在于,所述中继链系统根据所述交易证明信息对所述目标跨链交易进行验证之前,还包括:The method according to claim 2 or 3, wherein before the relay chain system verifies the target cross-chain transaction according to the transaction proof information, the method further comprises:
    所述中继链系统根据所述跨链验证请求携带的所有跨链交易的哈希值确定第二校验信息;所述中继链系统在所述第一校验信息与所述第二校验信息相同的情况下,执行所述根据所述交易证明信息对所述目标跨链交易进行验证的步骤。The relay chain system determines the second verification information according to the hash values of all cross-chain transactions carried in the cross-chain verification request; the relay chain system determines the second verification information between the first verification information and the second verification information. If the verification information is the same, the step of verifying the target cross-chain transaction according to the transaction certification information is performed.
  5. 如权利要求2或3所述的方法,其特征在于,所述中继链系统根据所述交易证明信息对所述目标跨链交易进行验证,包括:The method according to claim 2 or 3, wherein the relay chain system verifies the target cross-chain transaction according to the transaction certification information, comprising:
    所述中继链系统获取所述第一应用链系统对应的验证规则;所述中继链系统在所述跨链验证请求携带的所有交易证明信息均满足所述验证规则的情况下,确定所述跨链验证请求携带的所有跨链交易验证通过。The relay chain system obtains the verification rules corresponding to the first application chain system; the relay chain system determines that all transaction certification information carried in the cross-chain verification request meets the verification rules. All cross-chain transactions carried in the cross-chain verification request are verified to pass.
  6. 如权利要求2所述的方法,其特征在于,所述标识信息包括以下至少一项:The method of claim 2, wherein the identification information includes at least one of the following:
    所述目标跨链交易的哈希值;所述目标跨链交易中的目的应用链标识和跨链交易序号。The hash value of the target cross-chain transaction; the target application chain identifier and the cross-chain transaction serial number in the target cross-chain transaction.
  7. 如权利要求3所述的方法,其特征在于,所述多个跨链交易具有一个标识信息,所述标识信息包括以下至少一项:The method of claim 3, wherein the plurality of cross-chain transactions have identification information, and the identification information includes at least one of the following:
    所述默克尔树中的根节点的哈希值;所述多个跨链交易中每个跨链交易中的目的应用链标识和跨链交易序号;目标区块标识。The hash value of the root node in the Merkle tree; the target application chain identifier and the cross-chain transaction sequence number in each cross-chain transaction in the multiple cross-chain transactions; the target block identifier.
  8. 如权利要求1-3任一所述的方法,其特征在于,所述数字签名包括所述中继链系统中的多个中继链节点中每个中继链节点生成的所述标识信息的数字签名。The method according to any one of claims 1-3, wherein the digital signature includes the identification information generated by each relay chain node of the relay chain nodes in the relay chain system. digital signature.
  9. 如权利要求2或3所述的方法,其特征在于,所述跨链交易请求携带所述第一校验信息,所述第二跨链网关根据所述数字签名对所述目标跨链交易进行验证,包括:The method according to claim 2 or 3, wherein the cross-chain transaction request carries the first verification information, and the second cross-chain gateway performs the target cross-chain transaction on the target cross-chain transaction according to the digital signature. Validation, including:
    所述第二跨链网关使用所述中继链系统的公钥解密所述数字签名,且计算所述目标跨链交易的哈希值;所述第二跨链网关在使用所述中继链系统的公钥成功解密所述数字签名,且计算出的哈希值与所述目标跨链交易在所述第一校验信息中对应的哈希值相同的情况下,确定所述目标跨链交易验证通过。The second cross-chain gateway decrypts the digital signature using the public key of the relay chain system, and calculates the hash value of the target cross-chain transaction; the second cross-chain gateway is using the relay chain When the public key of the system successfully decrypts the digital signature, and the calculated hash value is the same as the hash value corresponding to the target cross-chain transaction in the first verification information, determine the target cross-chain transaction Transaction verification passed.
  10. 一种跨链交易系统,其特征在于,所述系统包括:第一跨链网关、中继链系统和第二跨链网关;A cross-chain transaction system, characterized in that the system comprises: a first cross-chain gateway, a relay chain system and a second cross-chain gateway;
    所述第一跨链网关,用于从第一应用链系统获取目标跨链交易及对应的交易证明信息;向所述中继链系统发送跨链验证请求,所述跨链验证请求携带所述目标跨链交易和所述交易证明信息;The first cross-chain gateway is used to obtain the target cross-chain transaction and corresponding transaction certification information from the first application chain system; send a cross-chain verification request to the relay chain system, and the cross-chain verification request carries the The target cross-chain transaction and the transaction proof information;
    所述中继链系统,用于接收到所述跨链验证请求后,根据所述交易证明信息对所述目标跨链交易进行验证;在所述目标跨链交易验证通过时,生成所述目标跨链交易的标识信息的数字签名;将所述标识信息和所述数字签名作为跨链存证存储至所述中继链系统配置的区块链;向所述第一跨链网关返回区块确认通知;The relay chain system is configured to verify the target cross-chain transaction according to the transaction proof information after receiving the cross-chain verification request; when the target cross-chain transaction is verified, generate the target cross-chain transaction The digital signature of the identification information of the cross-chain transaction; the identification information and the digital signature are stored as the cross-chain certificate in the blockchain configured by the relay chain system; the block chain is returned to the first cross-chain gateway confirmation notice;
    所述第一跨链网关,还用于接收到所述区块确认通知后,向所述第二跨链网关发送跨链交易请求,所述跨链交易请求携带所述目标跨链交易;The first cross-chain gateway is further configured to send a cross-chain transaction request to the second cross-chain gateway after receiving the block confirmation notification, where the cross-chain transaction request carries the target cross-chain transaction;
    所述第二跨链网关,用于接收到所述跨链交易请求后,根据所述标识信息从所述中继链系统获取所述数字签名;根据所述数字签名对所述目标跨链交易进行验证;在所述目标跨链交易验证通过时,将所述目标跨链交易发送给第二应用链系统。The second cross-chain gateway is configured to obtain the digital signature from the relay chain system according to the identification information after receiving the cross-chain transaction request; Perform verification; when the target cross-chain transaction is verified, send the target cross-chain transaction to the second application chain system.
  11. 一种跨链交易方法,其特征在于,应用于中继链系统,所述方法包括:A cross-chain transaction method, characterized in that it is applied to a relay chain system, the method comprising:
    接收第一跨链网关发送的跨链验证请求,所述跨链验证请求携带所述第一跨链网关从第一应用链系统获取的目标跨链交易及对应的交易证明信息;receiving a cross-chain verification request sent by the first cross-chain gateway, where the cross-chain verification request carries the target cross-chain transaction and corresponding transaction certification information obtained by the first cross-chain gateway from the first application chain system;
    根据所述交易证明信息对所述目标跨链交易进行验证;verifying the target cross-chain transaction according to the transaction proof information;
    在所述目标跨链交易验证通过时,生成所述目标跨链交易的标识信息的数字签名;When the target cross-chain transaction is verified and passed, a digital signature of the identification information of the target cross-chain transaction is generated;
    将所述标识信息和所述数字签名作为跨链存证存储至所述中继链系统配置的区块链,所述跨链存证用于在第二跨链网关验证所述目标跨链交易时使用;The identification information and the digital signature are stored in the blockchain configured by the relay chain system as a cross-chain certificate, and the cross-chain certificate is used to verify the target cross-chain transaction at the second cross-chain gateway when used;
    向所述第一跨链网关发送区块确认通知,以指示所述第一跨链网关向所述第二跨链网关发送跨链交易请求,所述跨链交易请求携带所述目标跨链交易。Send a block confirmation notification to the first cross-chain gateway to instruct the first cross-chain gateway to send a cross-chain transaction request to the second cross-chain gateway, where the cross-chain transaction request carries the target cross-chain transaction .
  12. 一种跨链交易装置,其特征在于,应用于中继链系统,所述装置包括:A cross-chain transaction device, characterized in that it is applied to a relay chain system, and the device includes:
    接收模块,用于接收第一跨链网关发送的跨链验证请求,所述跨链验证请求携带所述第一跨链网关从第一应用链系统获取的目标跨链交易及对应的交易证明信息;A receiving module, configured to receive a cross-chain verification request sent by the first cross-chain gateway, where the cross-chain verification request carries the target cross-chain transaction and corresponding transaction certification information obtained by the first cross-chain gateway from the first application chain system ;
    验证模块,用于根据所述交易证明信息对所述目标跨链交易进行验证;a verification module, configured to verify the target cross-chain transaction according to the transaction certification information;
    生成模块,用于在所述目标跨链交易验证通过时,生成所述目标跨链交易的标识信息的数字签名;a generation module, configured to generate a digital signature of the identification information of the target cross-chain transaction when the target cross-chain transaction is verified;
    存储模块,用于将所述标识信息和所述数字签名作为跨链存证存储至所述中继链系统配置的区块链,所述跨链存证用于在第二跨链网关验证所述目标跨链交易时使用;The storage module is used to store the identification information and the digital signature in the blockchain configured by the relay chain system as a cross-chain deposit certificate, and the cross-chain deposit certificate is used for verifying at the second cross-chain gateway. It is used when the target cross-chain transaction is mentioned;
    发送模块,用于向所述第一跨链网关发送区块确认通知,以指示所述第一跨链网关向所述第二跨链网关发送跨链交易请求,所述跨链交易请求携带所述目标跨链交易。A sending module, configured to send a block confirmation notification to the first cross-chain gateway to instruct the first cross-chain gateway to send a cross-chain transaction request to the second cross-chain gateway, and the cross-chain transaction request carries the Describe the target cross-chain transaction.
  13. 一种计算机设备,其特征在于,所述计算机设备包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求11所述的方法。A computer device, characterized in that the computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being implemented when executed by the processor The method of claim 11 .
  14. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求11所述的方法。A computer-readable storage medium, characterized in that, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to claim 11 is implemented.
PCT/CN2020/138062 2020-11-06 2020-12-21 Cross-chain transaction method, system and apparatus, device, and storage medium WO2022095244A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011233653.6A CN112446785B (en) 2020-11-06 2020-11-06 Cross-chain transaction method, system, device, equipment and storage medium
CN202011233653.6 2020-11-06

Publications (1)

Publication Number Publication Date
WO2022095244A1 true WO2022095244A1 (en) 2022-05-12

Family

ID=74735926

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/138062 WO2022095244A1 (en) 2020-11-06 2020-12-21 Cross-chain transaction method, system and apparatus, device, and storage medium

Country Status (2)

Country Link
CN (1) CN112446785B (en)
WO (1) WO2022095244A1 (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710297A (en) * 2022-05-25 2022-07-05 深圳天谷信息科技有限公司 Block chain evidence storing method, device and equipment based on aggregated signature and storage medium
CN115022305A (en) * 2022-05-30 2022-09-06 蚂蚁区块链科技(上海)有限公司 Data transmission system, method and device
CN115051815A (en) * 2022-08-15 2022-09-13 江苏通付盾区块链科技有限公司 Cross-chain data interaction method and device used between block chain heterogeneous chains
CN115545686A (en) * 2022-11-21 2022-12-30 宋八零 Block chain based decentralized fast feedback cross-chain transaction method
CN115632791A (en) * 2022-10-12 2023-01-20 南京航空航天大学 Dynamic cross-chain data consistency decentralized verification method
CN115860932A (en) * 2022-11-14 2023-03-28 临沂大学 Cross-fragment transaction method, device and medium
CN115941282A (en) * 2022-11-10 2023-04-07 天津理工大学 NFT-based block chain cross-chain interaction system and method
CN117708181A (en) * 2024-02-05 2024-03-15 人民法院信息技术服务中心 Heterogeneous data cross-link query method, device, system and equipment for private link

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113676546A (en) * 2021-03-30 2021-11-19 支付宝(杭州)信息技术有限公司 Method and device for transferring data in cross-link mode based on relay equipment network
CN112734432B (en) * 2021-03-30 2021-07-23 支付宝(杭州)信息技术有限公司 Cross-link data processing method and device
CN112804357B (en) * 2021-03-30 2021-08-06 支付宝(杭州)信息技术有限公司 Method and device for reading data in cross-link mode based on relay equipment network
CN112861190B (en) * 2021-04-23 2021-07-16 腾讯科技(深圳)有限公司 Data cross-chain cooperation method, system and device
CN113328997B (en) * 2021-05-10 2023-05-12 东软集团股份有限公司 Alliance chain crossing system and method
CN115442420A (en) * 2021-05-18 2022-12-06 京东科技控股股份有限公司 Block chain cross-chain service management method and device
CN115460142A (en) * 2021-06-07 2022-12-09 京东科技控股股份有限公司 Routing addressing method and device based on cross-chain transaction
CN113468268A (en) * 2021-06-29 2021-10-01 北京百度网讯科技有限公司 Cross-chain processing method and device, electronic equipment and readable storage medium
CN113434883A (en) * 2021-06-29 2021-09-24 北京百度网讯科技有限公司 Cross-chain processing method and device, electronic equipment and readable storage medium
CN115701078A (en) * 2021-07-27 2023-02-07 腾讯科技(深圳)有限公司 Cross-chain transaction processing method and device, electronic equipment and storage medium
CN115708119A (en) * 2021-08-20 2023-02-21 华为云计算技术有限公司 Cross-chain transaction system, method, device and storage medium
CN113706148B (en) * 2021-08-27 2023-09-29 杭州云象网络技术有限公司 Cross-link method, system, storage medium and device based on channel authority control
CN113992376B (en) * 2021-10-21 2023-07-21 卓尔智联(武汉)研究院有限公司 Cross-chain method based on block chain, electronic equipment and storage medium
CN114338666A (en) * 2021-12-03 2022-04-12 杭州趣链科技有限公司 Method, device, equipment and medium for verifying Fabric block chain cross-chain transaction
CN114760288B (en) * 2022-03-18 2024-02-06 国网四川省电力公司天府新区供电公司 File cross-chain transmission method based on block chain
CN115309581B (en) * 2022-10-11 2023-01-24 人民法院信息技术服务中心 Method and device for analyzing cross-chain transaction running state of heterogeneous block chain
CN115766037B (en) * 2022-11-28 2024-03-15 恒道礼创(深圳)发展合伙企业(有限合伙) Cross-chain transaction method based on block chain

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110430162A (en) * 2019-06-28 2019-11-08 阿里巴巴集团控股有限公司 A kind of method and apparatus that message can be certified in across chain transmission
CN110650189A (en) * 2019-09-20 2020-01-03 深圳供电局有限公司 Relay-based block chain interaction system and method
CN110751475A (en) * 2019-10-24 2020-02-04 杭州趣链科技有限公司 Cross-chain method, system, equipment and storage medium for blockchain transaction
US20200204364A1 (en) * 2019-04-19 2020-06-25 Alibaba Group Holding Limited Blockchain authorization information generation
CN111666325A (en) * 2020-05-18 2020-09-15 国网浙江省电力有限公司信息通信分公司 Validity verification method for cross-link port calling
CN111769957A (en) * 2020-09-02 2020-10-13 百度在线网络技术(北京)有限公司 Block chain cross-chain query method, device, equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019211225A1 (en) * 2018-05-01 2019-11-07 International Business Machines Corporation Blockchain implementing cross-chain transactions
CN109934592A (en) * 2019-03-22 2019-06-25 深圳市网心科技有限公司 A kind of across the chain communication means of block chain, system, electronic equipment and storage medium
CN110766408A (en) * 2019-10-24 2020-02-07 杭州趣链科技有限公司 Cross-chain transaction verification method, engine, equipment and storage medium for heterogeneous block chain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200204364A1 (en) * 2019-04-19 2020-06-25 Alibaba Group Holding Limited Blockchain authorization information generation
CN110430162A (en) * 2019-06-28 2019-11-08 阿里巴巴集团控股有限公司 A kind of method and apparatus that message can be certified in across chain transmission
CN110650189A (en) * 2019-09-20 2020-01-03 深圳供电局有限公司 Relay-based block chain interaction system and method
CN110751475A (en) * 2019-10-24 2020-02-04 杭州趣链科技有限公司 Cross-chain method, system, equipment and storage medium for blockchain transaction
CN111666325A (en) * 2020-05-18 2020-09-15 国网浙江省电力有限公司信息通信分公司 Validity verification method for cross-link port calling
CN111769957A (en) * 2020-09-02 2020-10-13 百度在线网络技术(北京)有限公司 Block chain cross-chain query method, device, equipment and storage medium

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710297A (en) * 2022-05-25 2022-07-05 深圳天谷信息科技有限公司 Block chain evidence storing method, device and equipment based on aggregated signature and storage medium
CN115022305A (en) * 2022-05-30 2022-09-06 蚂蚁区块链科技(上海)有限公司 Data transmission system, method and device
CN115022305B (en) * 2022-05-30 2024-05-03 蚂蚁区块链科技(上海)有限公司 Data transmission system, method, device, equipment and medium
CN115051815A (en) * 2022-08-15 2022-09-13 江苏通付盾区块链科技有限公司 Cross-chain data interaction method and device used between block chain heterogeneous chains
CN115632791A (en) * 2022-10-12 2023-01-20 南京航空航天大学 Dynamic cross-chain data consistency decentralized verification method
CN115632791B (en) * 2022-10-12 2024-03-19 南京航空航天大学 Dynamic cross-chain data consistency decentration verification method
CN115941282A (en) * 2022-11-10 2023-04-07 天津理工大学 NFT-based block chain cross-chain interaction system and method
CN115860932A (en) * 2022-11-14 2023-03-28 临沂大学 Cross-fragment transaction method, device and medium
CN115545686A (en) * 2022-11-21 2022-12-30 宋八零 Block chain based decentralized fast feedback cross-chain transaction method
CN115545686B (en) * 2022-11-21 2024-01-02 深圳易同汇电子商务有限公司 Block chain-based decentralization quick feedback cross-chain transaction method
CN117708181A (en) * 2024-02-05 2024-03-15 人民法院信息技术服务中心 Heterogeneous data cross-link query method, device, system and equipment for private link
CN117708181B (en) * 2024-02-05 2024-04-30 人民法院信息技术服务中心 Heterogeneous data cross-link query method, device, system and equipment for private link

Also Published As

Publication number Publication date
CN112446785A (en) 2021-03-05
CN112446785B (en) 2023-09-22

Similar Documents

Publication Publication Date Title
WO2022095244A1 (en) Cross-chain transaction method, system and apparatus, device, and storage medium
CN110602138B (en) Data processing method and device for block chain network, electronic equipment and storage medium
CN111066286B (en) Retrieving common data for blockchain networks using high availability trusted execution environments
CN111681003B (en) Resource cross-chain transfer method and device, computer equipment and storage medium
TWI798483B (en) Method and device for generating blockchain transactions
CN112822181B (en) Verification method of cross-chain transaction, terminal device and readable storage medium
JP4681554B2 (en) How to use reliable hardware-based identity credentials in runtime package signing for secure mobile communications and expensive transaction execution
CN111797159A (en) Information management and access control in a database
CN110177124B (en) Identity authentication method based on block chain and related equipment
TW202101165A (en) Secure smart unlocking
JP2004280284A (en) Control processor, electronic equipment, and program starting method for electronic equipment, and system module updating method for electronic equipment
CN110096894B (en) Data anonymous sharing system and method based on block chain
CN112036878B (en) Data processing method and device
CN112311779B (en) Data access control method and device applied to block chain system
US20170054561A1 (en) Double authenitication system for electronically signed documents
KR20120091618A (en) Digital signing system and method using chained hash
CN111241492A (en) Product multi-tenant secure credit granting method, system and electronic equipment
CN111222989B (en) Transaction method of multi-channel blockchain, electronic equipment and storage medium
WO2021027504A1 (en) Consensus protocol-based information processing method, and related device
CN114338091B (en) Data transmission method, device, electronic equipment and storage medium
CN115549984A (en) Cross-chain transaction method, device, equipment and storage medium
CN111651740B (en) Trusted platform sharing system for distributed intelligent embedded system
WO2020252753A1 (en) Blockchain node device, authentication method and device thereof, and storage medium
CN111369332A (en) Data processing method and device based on block chain
CN111435518A (en) Trusted hardware-based block chain private transaction method, device and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20960701

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20960701

Country of ref document: EP

Kind code of ref document: A1