Cross-chain Transaction Processing Method, Apparatus, Electronic Device, Medium and Program Product
By generating and using temporary key pairs in a cross-chain repeater, cross-chain transactions are encrypted and decrypted, the problem that cross-chain repeaters need to change access control information is solved, and the security of cross-chain access process is improved.
Patent Information
- Application Number
- CN202411444698.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2044-10-16
AI Technical Summary
In the prior art, cross-chain repeaters forward cross-chain transactions need to involve the security mechanisms of different blockchain networks themselves, resulting in the need to change access control information during the cross-chain process, which is vulnerable to malicious attacks, affecting the security of cross-chain access process.
By receiving the authentication request sent by the source blockchain in a cross-chain repeater, the target authentication information is determined based on the identification information of the target blockchain, and a temporary key pair is generated with the authentication information of the source blockchain. Return the private key of the temporary key pair to the source blockchain, which encrypts the original cross-chain transaction and sends the encrypted cross-chain transaction to the cross-chain repeater for secondary encryption. Finally, the secondary encrypted cross-chain transaction is sent to the target blockchain and the public key of the temporary key pair is decrypted.
Through the encryption and decryption process of temporary key pairs, cross-chain transactions are ensured that cross-chain transactions are not maliciously stolen during transmission, and changes in access control information during cross-chain process are avoided, improving the security of cross-chain access process.
Smart Images

Figure CN119341804B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular, to a cross-chain transaction processing method, apparatus, electronic device, medium, and program product. Background Art
[0002] With the rapid development of blockchain technology, a single blockchain network can no longer meet the increasingly complex application requirements. Different blockchains need to be interconnected to enable functions such as cross-chain asset transfer and cross-chain smart contract invocation.
[0003] Currently, information exchange between the source blockchain and the target blockchain is mainly completed through a cross-chain repeater. The cross-chain transaction is sent from the source blockchain to the cross-chain repeater, and then forwarded by the cross-chain repeater to the target blockchain, thereby completing communication and data exchange between different blockchains.
[0004] However, in cross-chain technology, the forwarding of cross-chain transactions by the cross-chain repeater needs to involve the security mechanism issues of different blockchain networks themselves, resulting in the need to change access control information during this cross-chain process. During this change process, it is vulnerable to malicious attacks, thereby affecting the security of the cross-chain access process. Summary of the Invention
[0005] The present application provides a cross-chain transaction processing method, apparatus, electronic device, medium, and program product to solve the problem in the prior art that the forwarding of cross-chain transactions by the cross-chain repeater needs to involve the security mechanism issues of different blockchain networks themselves, resulting in the need to change access control information during this cross-chain process. During this change process, it is vulnerable to malicious attacks, thereby affecting the security of the cross-chain access process.
[0006] In a first aspect, the present application provides a cross-chain transaction processing method, which is applied to a cross-chain repeater in a cross-chain transaction processing system. The cross-chain transaction processing system further includes a source blockchain and a target blockchain. The method includes:
[0007] Receiving an identity verification request sent by the source blockchain; wherein the identity verification request includes the identification information of the target blockchain and the source identity verification information of the source blockchain;
[0008] Determining the target identity verification information of the target blockchain according to the identification information of the target blockchain;
[0009] Generating a temporary key pair according to the source identity verification information and the target identity verification information, and returning the private key of the temporary key pair to the source blockchain;
[0010] Receive the first encrypted cross-chain transaction sent by the source blockchain, and perform secondary encryption on the first encrypted cross-chain transaction using the public key of the temporary key pair to obtain a second encrypted cross-chain transaction; wherein, the first encrypted cross-chain transaction is obtained by the source blockchain encrypting the original cross-chain transaction using the private key of the temporary key pair;
[0011] Send the second encrypted cross-chain transaction to the target blockchain, so that the target blockchain determines the public key of the temporary key pair according to the target authentication information, and processes the original cross-chain transaction obtained by decrypting the second encrypted cross-chain transaction using the public key of the temporary key pair.
[0012] In a second aspect, the present application provides a cross-chain transaction processing method, which is applied to the source blockchain in a cross-chain transaction processing system. The cross-chain transaction processing system further includes a cross-chain relay and a target blockchain. The method includes:
[0013] Receive a cross-chain transaction processing request sent by a target user device, and determine an original cross-chain transaction and identification information of the target blockchain according to the cross-chain transaction processing request;
[0014] Generate an authentication request according to the identification information of the target blockchain and the source authentication information of the source blockchain, and send the authentication request to the cross-chain relay; wherein, the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain;
[0015] Receive the private key of the temporary key pair returned by the cross-chain relay, encrypt the original cross-chain transaction using the private key of the temporary key pair to obtain a first encrypted cross-chain transaction, and send the first encrypted cross-chain transaction to the cross-chain relay, so that the cross-chain relay performs secondary encryption on the first encrypted cross-chain transaction to obtain a second encrypted cross-chain transaction, and sends the second encrypted cross-chain transaction to the target blockchain; wherein, the target blockchain is used to determine the public key of the temporary key pair according to the target authentication information, and process the original cross-chain transaction obtained by decrypting the second encrypted cross-chain transaction using the public key of the temporary key pair.
[0016] In a third aspect, the present application provides a cross-chain transaction processing device, which is configured in a cross-chain relay in a cross-chain transaction processing system. The cross-chain transaction processing system further includes a source blockchain and a target blockchain. The device includes:
[0017] An authentication request receiving module, configured to receive the authentication request sent by the source blockchain; wherein, the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain;
[0018] A verification information determination module, configured to determine target authentication information of the target blockchain according to the identification information of the target blockchain;
[0019] A key pair generation module, configured to generate a temporary key pair according to the source authentication information and the target authentication information, and return the private key of the temporary key pair to the source blockchain;
[0020] A secondary encryption module, configured to receive a first-encrypted cross-chain transaction sent by the source blockchain, and perform secondary encryption on the first-encrypted cross-chain transaction according to the public key of the temporary key pair to obtain a second-encrypted cross-chain transaction; wherein, the first-encrypted cross-chain transaction is obtained by the source blockchain encrypting an original cross-chain transaction according to the private key of the temporary key pair;
[0021] A cross-chain transaction sending module, configured to send the second-encrypted cross-chain transaction to the target blockchain, so that the target blockchain determines the public key of the temporary key pair according to the target authentication information, and processes the original cross-chain transaction obtained by decrypting the second-encrypted cross-chain transaction by using the public key of the temporary key pair.
[0022] In a fourth aspect, the present application provides a cross-chain transaction processing device, configured in a source blockchain in a cross-chain transaction processing system, the cross-chain transaction processing system further including a cross-chain relay and a target blockchain, the device including:
[0023] A processing request receiving module, configured to receive a cross-chain transaction processing request sent by a target user device, and determine an original cross-chain transaction and identification information of the target blockchain according to the cross-chain transaction processing request;
[0024] A verification request sending module, configured to generate a verification request according to the identification information of the target blockchain and the source authentication information of the source blockchain, and send the verification request to the cross-chain relay; wherein, the verification request includes the identification information of the target blockchain and the source authentication information of the source blockchain;
[0025] A primary encryption module, configured to receive the private key of the temporary key pair returned by the cross-chain repeater, encrypt the original cross-chain transaction according to the private key of the temporary key pair to obtain a primary encrypted cross-chain transaction, and send the primary encrypted cross-chain transaction to the cross-chain repeater, so that the cross-chain repeater performs secondary encryption on the primary encrypted cross-chain transaction to obtain a secondary encrypted cross-chain transaction, and send the secondary encrypted cross-chain transaction to the target blockchain; wherein, the target blockchain is configured to determine the public key of the temporary key pair according to the target authentication information, and process the original cross-chain transaction obtained by decrypting the secondary encrypted cross-chain transaction with the public key of the temporary key pair.
[0026] In a fifth aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the cross-chain transaction processing method as described in any embodiment of the present application is implemented.
[0027] In a sixth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the cross-chain transaction processing method as described in any embodiment of the present application is implemented.
[0028] In a seventh aspect, the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, the cross-chain transaction processing method as described in any embodiment of the present application is implemented.
[0029] In the solution of this application, the cross-chain relay receives an authentication request sent by the source blockchain; where the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain; determines the target authentication information of the target blockchain according to the identification information of the target blockchain; generates a temporary key pair according to the source authentication information and the target authentication information, and returns the private key of the temporary key pair to the source blockchain; receives a first-encrypted cross-chain transaction sent by the source blockchain, and performs second encryption on the first-encrypted cross-chain transaction according to the public key of the temporary key pair to obtain a second-encrypted cross-chain transaction; where the first-encrypted cross-chain transaction is obtained by the source blockchain encrypting the original cross-chain transaction according to the private key of the temporary key pair; sends the second-encrypted cross-chain transaction to the target blockchain, so that the target blockchain determines the public key of the temporary key pair according to the target authentication information, and processes the original cross-chain transaction obtained by decrypting the second-encrypted cross-chain transaction with the public key of the temporary key pair. That is, in the solution of this application, on the one hand, the cross-chain transaction is encrypted with the temporary key pair, so that the cross-chain transaction can be transmitted in the blockchain in the form of encrypted information, so as to avoid the malicious theft of the cross-chain transaction during the cross-chain process. On the other hand, the cross-chain relay generates a temporary key pair according to the authentication information of the source blockchain and the authentication information of the target blockchain, which can make the generation of the temporary key pair involve the security mechanism issues of the source blockchain and the target blockchain, so that there is no need to change the access control information during the cross-chain process, avoiding the situation of being maliciously attacked during the change process of the access control information, and thus improving the security of the cross-chain access process. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of this application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other relevant drawings can also be obtained based on these drawings.
[0031] Figure 1 is a schematic flowchart of a cross-chain transaction processing method provided by this application;
[0032] Figure 2a is another schematic flowchart of a cross-chain transaction processing method provided by this application;
[0033] Figure 3 is another schematic flowchart of a cross-chain transaction processing method provided by this application;
[0034] Figure 4 is a schematic structural diagram of a cross-chain transaction processing device provided by this application;
[0035] Figure 5It is another structural schematic diagram of the cross-chain transaction processing device provided by this application;
[0036] Figure 6 It is a structural schematic diagram of an electronic device provided by this application. Detailed implementation manners
[0037] In order to enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.
[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so that the embodiments of this application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily need to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0039] Figure 1 It is a flowchart of a cross-chain transaction processing method provided by this application. This method can be executed by a cross-chain transaction processing device, and the device can be implemented in a software and / or hardware manner. In a specific embodiment, the device can be applied to a cross-chain repeater or a source blockchain. Both the cross-chain repeater and the source blockchain are in a cross-chain transaction processing system, and the cross-chain transaction processing system further includes a target blockchain. The following embodiments will be described by taking the application of the device in a cross-chain repeater or a source blockchain as an example. Refer to Figure 1 , and the method can specifically include the following steps:
[0040] Step 101: Receive a cross-chain transaction processing request sent by a target user device, and determine an original cross-chain transaction and identification information of a target blockchain according to the cross-chain transaction processing request.
[0041] Specifically, the target user device is one of the user devices connected to the source blockchain. The user corresponding to the target user device initiates a cross-chain transaction processing request to request the source blockchain to process the cross-chain transaction. The original cross-chain transaction in the cross-chain transaction processing request is the transaction that the user expects the source blockchain to complete. The source blockchain needs to obtain the content of the original cross-chain transaction to complete this transaction. The identification information of the target blockchain in the cross-chain transaction processing request is the identification information of the blockchain that the original cross-chain transaction needs to access through the source blockchain and the cross-chain repeater. The way for the source blockchain to determine the original cross-chain transaction according to the cross-chain transaction processing request can be as follows: if the original cross-chain transaction and the identification information of the target blockchain are directly obtainable information in the cross-chain transaction processing request, the source blockchain directly obtains the original cross-chain transaction and the identification information of the target blockchain. If the original cross-chain transaction and the identification information of the target blockchain are encrypted information in the cross-chain transaction processing request, the source blockchain decrypts the encrypted original cross-chain transaction and the identification information of the target blockchain according to the user information corresponding to the target user device to obtain the original cross-chain transaction and the identification information of the target blockchain.
[0042] Step 102: Generate an authentication request according to the identification information of the target blockchain and the source authentication information of the source blockchain, and send the authentication request to the cross-chain repeater.
[0043] Among them, the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain.
[0044] Specifically, the source authentication information of the source blockchain is the authentication information pre-set between the source blockchain and the cross-chain repeater, which can represent that the source blockchain is a trusted blockchain. For example, the source authentication information of the source blockchain can be the trust certificate established by the source blockchain with the cross-chain repeater. The source blockchain generates an authentication request according to the identification information of the target blockchain and the source authentication information of the source blockchain. The authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain. After generating the authentication request, the source blockchain sends the authentication request to the cross-chain repeater.
[0045] Step 103: Receive the authentication request sent by the source blockchain.
[0046] Specifically, the cross-chain repeater receives the authentication request sent by the source blockchain, and the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain.
[0047] Step 104: Determine the target authentication information of the target blockchain according to the identification information of the target blockchain.
[0048] Specifically, the cross-chain repeater is connected to multiple blockchains, and each blockchain connected to the cross-chain repeater has corresponding authentication information. The cross-chain repeater determines the target blockchain according to the identification information of the target blockchain, and thus determines the target authentication information of the target blockchain.
[0049] Step 105: Generate a temporary key pair according to the source authentication information and the target authentication information, and return the private key of the temporary key pair to the source blockchain.
[0050] Specifically, the cross-chain repeater generates a temporary key pair by encrypting according to the source authentication information and the target authentication information using an encryption algorithm, so that the temporary key pair can be used by the source blockchain and the target blockchain. After generating the temporary key pair, the cross-chain repeater returns the private key of the temporary key pair to the source blockchain.
[0051] Step 106: Receive the private key of the temporary key pair returned by the cross-chain repeater, encrypt the original cross-chain transaction according to the private key of the temporary key pair to obtain a once-encrypted cross-chain transaction, and send the once-encrypted cross-chain transaction to the cross-chain repeater.
[0052] Specifically, the source blockchain receives the private key of the temporary key pair returned by the cross-chain repeater, and encrypts the original cross-chain transaction according to the private key of the temporary key pair using an encryption algorithm to obtain an encrypted cross-chain transaction, that is, a once-encrypted cross-chain transaction. The source blockchain sends the once-encrypted cross-chain transaction to the cross-chain repeater, so that the cross-chain repeater performs secondary encryption on the once-encrypted cross-chain transaction to obtain a twice-encrypted cross-chain transaction, and sends the twice-encrypted cross-chain transaction to the target blockchain.
[0053] The target blockchain determines the public key of the temporary key pair according to the target authentication information. For example, the way to determine the public key of the temporary key pair can be that the public key of the temporary key pair generated by the cross-chain repeater is parsed from the trust certificate of the smart contract of the target blockchain of the target blockchain. After the target blockchain obtains the public key of the temporary key pair, it decrypts the twice-encrypted cross-chain transaction using the public key of the temporary key pair to obtain the original cross-chain transaction, and processes the original cross-chain transaction. For example, the original cross-chain transaction can be a transaction request. After the target blockchain obtains the transaction request, it allows the user to conduct a transaction.
[0054] Step 107: Receive the once-encrypted cross-chain transaction sent by the source blockchain, and perform secondary encryption on the once-encrypted cross-chain transaction according to the public key of the temporary key pair to obtain a twice-encrypted cross-chain transaction.
[0055] Among them, the once-encrypted cross-chain transaction is obtained by the source blockchain encrypting the original cross-chain transaction according to the private key of the temporary key pair.
[0056] Specifically, the cross-chain repeater receives a primary encrypted cross-chain transaction sent by the source blockchain, and performs secondary encryption on the primary encrypted cross-chain transaction according to the public key of the temporary key pair to obtain a secondary encrypted cross-chain transaction.
[0057] Step 108: Send the secondary encrypted cross-chain transaction to the target blockchain.
[0058] Specifically, after obtaining the secondary encrypted cross-chain transaction, the cross-chain repeater sends the secondary encrypted cross-chain transaction to the target blockchain, so that the target blockchain determines the public key of the temporary key pair according to the target authentication information and processes the original cross-chain transaction obtained by decrypting the secondary encrypted cross-chain transaction with the public key of the temporary key pair.
[0059] In the solution of this application, the cross-chain repeater receives an authentication request sent by the source blockchain; the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain; determines the target authentication information of the target blockchain according to the identification information of the target blockchain; generates a temporary key pair according to the source authentication information and the target authentication information, and returns the private key of the temporary key pair to the source blockchain; receives a primary encrypted cross-chain transaction sent by the source blockchain, and performs secondary encryption on the primary encrypted cross-chain transaction according to the public key of the temporary key pair to obtain a secondary encrypted cross-chain transaction; the primary encrypted cross-chain transaction is obtained by the source blockchain encrypting the original cross-chain transaction according to the private key of the temporary key pair; sends the secondary encrypted cross-chain transaction to the target blockchain, so that the target blockchain determines the public key of the temporary key pair according to the target authentication information and processes the original cross-chain transaction obtained by decrypting the secondary encrypted cross-chain transaction with the public key of the temporary key pair. That is, in the solution of this application, on the one hand, the temporary key pair is used to encrypt the cross-chain transaction, so that the cross-chain transaction can be transmitted in the blockchain in the form of encrypted information to avoid the cross-chain transaction being maliciously stolen during the cross-chain process. On the other hand, the cross-chain repeater generates a temporary key pair according to the authentication information of the source blockchain and the authentication information of the target blockchain, which can make the generation of the temporary key pair involve the security mechanism issues of the source blockchain and the target blockchain, so that there is no need to change the access control information during the cross-chain process, avoiding the situation of being maliciously attacked during the change process of the access control information, and thus improving the security of the cross-chain access process.
[0060] Figure 2a It is another process schematic diagram of the cross-chain transaction processing method provided by this application, which is applied to the cross-chain repeater and details the process of the cross-chain repeater generating a temporary key pair to further illustrate the cross-chain transaction processing method provided by this application, as Figure 2a shown, the method may include the following steps:
[0061] Step 201: Receive an authentication request sent by the source blockchain.
[0062] Step 202: Determine the identification information of the source blockchain according to the source authentication information.
[0063] Specifically, the identification information of the source blockchain is the identity identification information of the source blockchain. After receiving the authentication request sent by the source blockchain, the cross-chain repeater determines the identification information of the source blockchain according to the source authentication information in the authentication request.
[0064] Step 203: If it is determined that the source blockchain is a trusted blockchain according to the identification information of the source blockchain, then determine to execute Step 204.
[0065] Specifically, among the multiple blockchains connected to the cross-chain repeater, there may be blockchains with relatively low trust levels. Such blockchains are regarded as untrusted blockchains in the cross-chain repeater, and the requests sent by the untrusted blockchains are not processed. For blockchains with relatively high trust levels, they are regarded as trusted blockchains in the cross-chain repeater, and the requests sent by such blockchains can be processed. Therefore, when the cross-chain repeater determines that the source blockchain is a trusted blockchain according to the identification information of the source blockchain, it confirms to execute the step of determining the target authentication information of the target blockchain according to the identification information of the target blockchain.
[0066] Step 204: Determine the target authentication information of the target blockchain according to the identification information of the target blockchain.
[0067] Step 205: Generate a temporary key pair according to the source authentication information and the target authentication information, and return the private key of the temporary key pair to the source blockchain.
[0068] Optionally, generating a temporary key pair according to the source authentication information and the target authentication information can be achieved through Step 2051.
[0069] Step 2051: Encrypt the source authentication information and the target authentication information according to the first preset encryption algorithm to generate a temporary key pair.
[0070] Specifically, the first preset encryption algorithm can be the preset national cryptographic SM2 algorithm. The national cryptographic SM2, SM3, and SM4 algorithms have higher efficiency compared with traditional encryption algorithms, and the encryption intensity is higher than that of traditional encryption algorithms, and they can also be verified simultaneously, so that concurrent tasks can be processed. The cross-chain repeater encrypts the source authentication information and the target authentication information according to the SM2 algorithm to generate a temporary key pair, thereby ensuring the security of cross-chain communication.
[0071] Exemplarily, the source blockchain identification information is IB_i, the target blockchain identification information is IB_j, and the source authentication information and the target authentication information are encrypted according to the first preset encryption algorithm to generate a temporary key pair (T_i, T_j).
[0072] Step 206: Receive the first encrypted cross-chain transaction sent by the source blockchain, and perform secondary encryption on the first encrypted cross-chain transaction using the public key of the temporary key pair to obtain the second encrypted cross-chain transaction.
[0073] Optionally, receiving the first encrypted cross-chain transaction sent by the source blockchain can be implemented through step 2061.
[0074] Step 2061: Receive the first encrypted cross-chain transaction sent by the source blockchain, the hash value of the first encrypted cross-chain transaction, and the signature information of the source blockchain.
[0075] Specifically, after the source blockchain generates the first encrypted cross-chain transaction, it calculates the hash value of the first encrypted cross-chain transaction, and signs the hash value to generate the signature information of the source blockchain. The source blockchain sends the first encrypted cross-chain transaction, the hash value of the first encrypted cross-chain transaction, and the signature information of the source blockchain to the cross-chain relay, and the cross-chain relay receives the first encrypted cross-chain transaction, the hash value of the first encrypted cross-chain transaction, and the signature information of the source blockchain sent by the source blockchain.
[0076] Step 207: Send the second encrypted cross-chain transaction to the target blockchain.
[0077] Optionally, after performing step 2061, step 207 can be implemented through step 2071.
[0078] Step 2071: Send the second encrypted cross-chain transaction, the hash value of the first encrypted cross-chain transaction, and the signature information of the source blockchain to the target blockchain.
[0079] Specifically, send the second encrypted cross-chain transaction, the hash value of the first encrypted cross-chain transaction, and the signature information of the source blockchain to the target blockchain. The target blockchain uses the first preset encryption algorithm to verify the hash value of the first encrypted cross-chain transaction and the signature information of the source blockchain to obtain a verification result to determine whether the source blockchain is a trustworthy blockchain. If the source blockchain is a trustworthy blockchain, it is determined that the verification result is passed. After the verification result is passed, the target blockchain determines the public key of the temporary key pair according to the target identity verification information, and processes the original cross-chain transaction obtained by decrypting the second encrypted cross-chain transaction using the public key of the temporary key pair.
[0080] In the solution of this application, the cross-chain repeater determines the identification information of the source blockchain based on the source authentication information, thereby determining whether the source blockchain is a trustworthy blockchain, further enhancing the security of the cross-chain transaction processing process, and preventing the cross-chain repeater from receiving malicious information. The cross-chain repeater sends the secondarily encrypted cross-chain transaction, the hash value of the primarily encrypted cross-chain transaction, and the signature information of the source blockchain to the target blockchain, facilitating the target blockchain to verify the source blockchain information, thereby further enhancing the security of the cross-chain transaction processing process.
[0081] Figure 3 It is another process schematic diagram of the cross-chain transaction processing method provided by this application, which is applied to the source blockchain, and details the content of determining the original cross-chain transaction and the identification information of the target blockchain according to the cross-chain transaction processing request, thereby further explaining the cross-chain transaction processing method provided by this application. As Figure 3 shown, the method may include the following steps:
[0082] Step 301, receive a cross-chain transaction processing request sent by the target user device.
[0083] Optionally, the cross-chain transaction processing request includes target user identification information, the original cross-chain transaction, and target access information.
[0084] Specifically, the source blockchain receives a cross-chain transaction processing request sent by the target user device, and the cross-chain transaction processing request includes target user identification information, the original cross-chain transaction, and target access information. The target access information is the information of the target blockchain that the cross-chain transaction needs to access.
[0085] The third preset encryption algorithm may be the national cryptographic SM3 algorithm. The target user identification information is the identity identification information of the target user, which is returned by the source blockchain to the target user device when the target user registers information in the source blockchain. Therefore, the source blockchain can determine the target user identity based on the target user identification information.
[0086] Optionally, before executing step 301, steps 3011 to 3012 may also be executed.
[0087] Step 3011, receive an information registration request sent by the target user device.
[0088] Among them, the information registration request includes the target user registration public key.
[0089] Specifically, the source blockchain receives an information registration request sent by the target user device, and the information registration request includes the target user registration public key. The target user registration public key and the target user registration private key are the public key and private key of a pair of registration key pairs generated by the target user device before registration, and are used to complete the registration of the target user.
[0090] Step 3012: Complete the registration of the target user based on the registered public key of the target user, and return the generated target user identification information to the target user device.
[0091] Specifically, after the source blockchain receives the information registration request sent by the target user device, the source blockchain performs identity registration on the target user. Exemplarily, the way for the source blockchain to perform identity registration on the target user can be to use the user registration contract of the source blockchain to register the user, generate user identification information that can represent the user identity, and return the generated target user identification information to the target user device.
[0092] Exemplarily, the user uses the national cryptography SM2 algorithm to generate a key pair (S_u, P_u). Where S_u is the target user registration private key of user u, and P_u is the target user registration public key of the user. The user device sends the public key P_u to the source blockchain, and the user registration contract of the source blockchain realizes the registration of user u on the source blockchain IB_i according to the public key P_u. After the user registration is successful, IB_i sends the generated target user identification information Key_u to the user device. Through this registration process, user u establishes a trusted digital identity on IB_i, thus ensuring the privacy and security of the target user during the cross-chain interaction process.
[0093] Step 302: Determine the identification information of the target blockchain according to the target access information, and obtain the original cross-chain transaction.
[0094] Exemplarily, the target access information is <SourceChain, DestinationChain>. According to the preset blockchain information, it is determined that the blockchain corresponding to SourceChain in the target access information is the source blockchain IB_i, and the target blockchain identification information corresponding to DestinationChain is IB_j. Therefore, the identification information of the target blockchain is determined to be IB_j.
[0095] Optionally, after executing step 302, steps 3031 to 3032 can also be executed.
[0096] Step 3031: Determine whether the identification information of the target blockchain is the same as the identification information of the source blockchain.
[0097] Specifically, in the target access information, the identification information of the target blockchain is determined, and it is determined whether the identification information of the target blockchain is the same as the identification information of the source blockchain. If the identification information of the target blockchain is the same as the identification information of the source blockchain, it means that the transaction submitted by the user is not a cross-chain transaction and does not require cross-chain processing, and the source blockchain itself can complete the processing of this transaction.
[0098] Step 3032, if the identification information of the target blockchain is inconsistent with that of the source blockchain, determine to execute Step 303.
[0099] Step 303, generate an authentication request based on the identification information of the target blockchain and the source authentication information of the source blockchain, and send the authentication request to the cross-chain relay.
[0100] Step 304, receive the private key of the temporary key pair returned by the cross-chain relay, encrypt the original cross-chain transaction according to the private key of the temporary key pair to obtain a once-encrypted cross-chain transaction, and send the once-encrypted cross-chain transaction to the cross-chain relay.
[0101] Optionally, encrypting the original cross-chain transaction according to the private key of the temporary key pair to obtain a once-encrypted cross-chain transaction can be achieved through Step 3061.
[0102] Step 3061, encrypt the original cross-chain transaction according to the second preset encryption algorithm and the private key of the temporary key pair to obtain a once-encrypted cross-chain transaction.
[0103] Specifically, after the source blockchain receives the private key of the temporary key pair, it encrypts the original cross-chain transaction according to the second preset encryption algorithm and the private key of the temporary key pair to obtain a once-encrypted cross-chain transaction.
[0104] Optionally, after obtaining the once-encrypted cross-chain transaction, Steps 3062 to 3063 can also be executed.
[0105] Step 3062, calculate the hash value of the once-encrypted cross-chain transaction according to the third preset encryption algorithm.
[0106] Exemplarily, the source blockchain uses the national cryptographic SM3 algorithm to calculate the hash value of the once-encrypted cross-chain transaction Enc_i_n, and the hash value H(Enc_i_n) of the once-encrypted cross-chain transaction is SM3.Hash(Enc_i_n).
[0107] Step 3063, sign the hash value of the once-encrypted cross-chain transaction according to the private key of the temporary key pair and the first preset encryption algorithm to obtain the signature information of the source blockchain.
[0108] Exemplarily, the source blockchain uses the SM2 algorithm and the private key T_i of the temporary key pair to sign the hash value H(Enc_i_n) of the once-encrypted cross-chain transaction, and the signature information Sig_i_n of the source blockchain is SM2.Sign(T_i, H(Enc_i_n)).
[0109] Optionally, after executing Steps 3061 to 3063, sending the once-encrypted cross-chain transaction to the cross-chain relay can be achieved through Step 3064.
[0110] Step 3064: Send the first - encrypted cross - chain transaction, the hash value of the first - encrypted cross - chain transaction, and the signature information of the source blockchain to the cross - chain relay.
[0111] Specifically, send the first - encrypted cross - chain transaction, the hash value of the first - encrypted cross - chain transaction, and the signature information of the source blockchain to the cross - chain relay, so that the cross - chain relay performs secondary encryption on the first - encrypted cross - chain transaction to obtain a second - encrypted cross - chain transaction, and sends the second - encrypted cross - chain transaction, the hash value of the first - encrypted cross - chain transaction, and the signature information of the source blockchain to the target blockchain. The target blockchain is used to verify the hash value of the first - encrypted cross - chain transaction and the signature information of the source blockchain according to the first preset encryption algorithm, and determine the public key of the temporary key pair according to the target authentication information after the verification result is passed, and process the original cross - chain transaction obtained by decrypting the second - encrypted cross - chain transaction with the public key of the temporary key pair.
[0112] Exemplarily, the source blockchain sends the first - encrypted cross - chain transaction Enc_i_n, the hash value H(Enc_i_n) of the first - encrypted cross - chain transaction, and the signature information Sig_i_n of the source blockchain to the cross - chain relay. The cross - chain relay applies the public key T_j of the temporary key pair to perform secondary encryption on the first - encrypted cross - chain transaction Enc_i_n, and sends the second - encrypted cross - chain transaction, the hash value of the first - encrypted cross - chain transaction, and the signature information of the source blockchain to the target blockchain. The target blockchain applies the national cryptography SM2 algorithm to verify the signature information Sig_i_n of the source blockchain and the hash value H(Enc_i_n) of the first - encrypted cross - chain transaction, so as to verify the security of the source blockchain. After the result of verifying the security of the source blockchain is passed, determine the public key T_j of the temporary key pair according to the target authentication information, and decrypt the second - encrypted cross - chain transaction with the public key of the temporary key pair to obtain and process the original cross - chain transaction t_u_n.
[0113] In the solution of this application, the source blockchain receives a cross-chain transaction processing request sent by a target user device, and determines an original cross-chain transaction and identification information of the target blockchain according to the cross-chain transaction processing request; generates an authentication request according to the identification information of the target blockchain and the source authentication information of the source blockchain, and sends the authentication request to a cross-chain relay; wherein, the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain; receives the private key of a temporary key pair returned by the cross-chain relay, and encrypts the original cross-chain transaction according to the private key of the temporary key pair to obtain a first-encrypted cross-chain transaction, and sends the first-encrypted cross-chain transaction to the cross-chain relay, so that the cross-chain relay performs secondary encryption on the first-encrypted cross-chain transaction to obtain a second-encrypted cross-chain transaction, and sends the second-encrypted cross-chain transaction to the target blockchain; wherein, the target blockchain is used to determine the public key of the temporary key pair according to the target authentication information, and process the original cross-chain transaction obtained by decrypting the second-encrypted cross-chain transaction with the public key of the temporary key pair. That is, in the solution of this application, the source blockchain authenticates the identity of the target user to determine that the target user is a user registered on the source blockchain, thereby further improving the security of cross-chain transaction processing. The information included in the cross-chain transaction processing request sent by the target user device is information encrypted by the target user device according to multiple preset encryption algorithms, thereby improving the initial security of cross-chain transactions. The source blockchain establishes a hash value of the first-encrypted cross-chain transaction and signature information of the source blockchain, and sends both the hash value of the first-encrypted cross-chain transaction and the signature information of the source blockchain to the cross-chain relay, and then the cross-chain relay forwards them to the target blockchain, which is convenient for the target blockchain to verify the source blockchain information, thereby further enhancing the security of the cross-chain transaction processing process.
[0114] Figure 4 It is a schematic structural diagram of a cross-chain transaction processing device provided by this application. The device is applicable to execute the cross-chain transaction processing method provided by this application, and is configured in a cross-chain relay in a cross-chain transaction processing system. The cross-chain transaction processing system further includes a source blockchain and a target blockchain. As Figure 4 shown, the device may specifically include:
[0115] An authentication request receiving module 401, configured to receive the authentication request sent by the source blockchain; wherein, the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain.
[0116] An authentication information determining module 402, configured to determine the target authentication information of the target blockchain according to the identification information of the target blockchain.
[0117] The key pair generation module 403 is configured to generate a temporary key pair according to the source authentication information and the target authentication information, and return the private key of the temporary key pair to the source blockchain.
[0118] The secondary encryption module 404 is configured to receive the first-encrypted cross-chain transaction sent by the source blockchain, and perform secondary encryption on the first-encrypted cross-chain transaction according to the public key of the temporary key pair to obtain a second-encrypted cross-chain transaction; wherein, the first-encrypted cross-chain transaction is obtained by the source blockchain encrypting the original cross-chain transaction according to the private key of the temporary key pair.
[0119] The cross-chain transaction sending module 405 is configured to send the second-encrypted cross-chain transaction to the target blockchain, so that the target blockchain determines the public key of the temporary key pair according to the target authentication information, and processes the original cross-chain transaction obtained by decrypting the second-encrypted cross-chain transaction with the public key of the temporary key pair.
[0120] In one embodiment, the verification request receiving module 401 is further configured to: after receiving the authentication request sent by the source blockchain, determine the identification information of the source blockchain according to the source authentication information; if it is determined that the source blockchain is a trusted blockchain according to the identification information of the source blockchain, then determine to execute the step of determining the target authentication information of the target blockchain according to the identification information of the target blockchain.
[0121] In one embodiment, the key pair generation module 403 is specifically configured to: encrypt the source authentication information and the target authentication information according to a first preset encryption algorithm to generate the temporary key pair.
[0122] In one embodiment, when receiving the first-encrypted cross-chain transaction sent by the source blockchain, the secondary encryption module 404 is specifically configured to: receive the first-encrypted cross-chain transaction sent by the source blockchain, the hash value of the first-encrypted cross-chain transaction, and the signature information of the source blockchain; the cross-chain transaction sending module 405 is specifically configured to: send the second-encrypted cross-chain transaction, the hash value of the first-encrypted cross-chain transaction, and the signature information of the source blockchain to the target blockchain, so that the target blockchain verifies the hash value of the first-encrypted cross-chain transaction and the signature information of the source blockchain by using the first preset encryption algorithm, and determines the public key of the temporary key pair according to the target authentication information and processes the original cross-chain transaction obtained by decrypting the second-encrypted cross-chain transaction with the public key of the temporary key pair after the verification result is verified.
[0123] For the device of the present application, the cross-chain relayer receives an authentication request sent by the source blockchain; wherein, the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain; determines the target authentication information of the target blockchain according to the identification information of the target blockchain; generates a temporary key pair according to the source authentication information and the target authentication information, and returns the private key of the temporary key pair to the source blockchain; receives a first-encrypted cross-chain transaction sent by the source blockchain, and performs second encryption on the first-encrypted cross-chain transaction according to the public key of the temporary key pair to obtain a second-encrypted cross-chain transaction; wherein, the first-encrypted cross-chain transaction is obtained by the source blockchain encrypting the original cross-chain transaction according to the private key of the temporary key pair; sends the second-encrypted cross-chain transaction to the target blockchain, so that the target blockchain determines the public key of the temporary key pair according to the target authentication information, and processes the original cross-chain transaction obtained by decrypting the second-encrypted cross-chain transaction with the public key of the temporary key pair. That is, in the solution of the present application, on the one hand, the cross-chain transaction is encrypted with the temporary key pair, so that the cross-chain transaction can be transmitted in the blockchain in the form of encrypted information, so as to avoid the cross-chain transaction being maliciously stolen during the cross-chain process. On the other hand, the cross-chain relayer generates a temporary key pair according to the authentication information of the source blockchain and the authentication information of the target blockchain, which can make the generation of the temporary key pair involve the security mechanism issues of the source blockchain and the target blockchain, so that there is no need to change the access control information during the cross-chain process, avoiding the situation of being maliciously attacked during the change process of the access control information, and thus improving the security of the cross-chain access process.
[0124] Figure 5 FIG. 4 is another schematic structural diagram of the cross-chain transaction processing device provided by the present application. The device is applicable to execute the cross-chain transaction processing method provided by the present application and is configured in the source blockchain of the cross-chain transaction processing system. The cross-chain transaction processing system further includes a cross-chain relayer and a target blockchain. As Figure 5 shown, the device may specifically include:
[0125] A processing request receiving module 501, configured to receive a cross-chain transaction processing request sent by a target user device, and determine an original cross-chain transaction and the identification information of a target blockchain according to the cross-chain transaction processing request.
[0126] An authentication request sending module 502, configured to generate an authentication request according to the identification information of the target blockchain and the source authentication information of the source blockchain, and send the authentication request to the cross-chain relayer; wherein, the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain.
[0127] The primary encryption module 503 is configured to receive the private key of the temporary key pair returned by the cross-chain relayer, encrypt the original cross-chain transaction according to the private key of the temporary key pair to obtain a primary-encrypted cross-chain transaction, and send the primary-encrypted cross-chain transaction to the cross-chain relayer, so that the cross-chain relayer performs secondary encryption on the primary-encrypted cross-chain transaction to obtain a secondary-encrypted cross-chain transaction, and sends the secondary-encrypted cross-chain transaction to the target blockchain; wherein, the target blockchain is configured to determine the public key of the temporary key pair according to the target authentication information, and process the original cross-chain transaction obtained by decrypting the secondary-encrypted cross-chain transaction by using the public key of the temporary key pair.
[0128] In one embodiment, the cross-chain transaction processing request includes target user identification information, initial encryption information, target user signature information, a hash value of the initial encryption information, and target access information. The processing request receiving module 501 is specifically configured to determine the original cross-chain transaction and the identification information of the target blockchain according to the cross-chain transaction processing request as follows: determine the identification information of the target blockchain according to the target access information; perform signature verification on the target user signature information and the hash value of the initial encryption information according to the target user registered public key and a first preset encryption algorithm; wherein, the target user registered public key is the information sent by the target user during registration on the source blockchain; if the result of the signature authentication is that the signature authentication is passed, decrypt the initial encryption information according to the target user identification information and a second preset encryption algorithm to obtain the original cross-chain transaction.
[0129] In one embodiment, before performing signature verification on the target user signature information and the hash value of the initial encryption information according to the target user registered public key and a first preset encryption algorithm, the processing request receiving module 501 is further configured to: determine whether the identification information of the target blockchain is consistent with the identification information of the source blockchain; if the identification information of the target blockchain is not consistent with the identification information of the source blockchain, determine to execute the step of performing signature verification on the target user signature information and the hash value of the initial encryption information according to the target user registered public key and a first preset encryption algorithm.
[0130] In one embodiment, the device further includes: a registration module, configured to receive an information registration request sent by the target user device before the processing request receiving module 501 receives a cross-chain transaction processing request sent by the target user device; wherein, the information registration request includes the target user registered public key; complete the registration of the target user according to the target user registered public key, and return the generated target user identification information to the target user device.
[0131] In one embodiment, the initial encrypted information is obtained by the target user device encrypting the original cross-chain transaction according to the second preset encryption algorithm and the target user identification information; the hash value of the initial encrypted information is obtained by the target user device calculating the hash value of the initial encrypted information according to the third preset encryption algorithm; the target user signature information is obtained by the target user device signing the hash value of the initial encrypted information according to the target user registration private key and the first preset encryption algorithm.
[0132] In one embodiment, when the primary encryption module 503 encrypts the original cross-chain transaction according to the private key of the temporary key pair to obtain a primary encrypted cross-chain transaction, it is specifically configured to: encrypt the original cross-chain transaction according to the second preset encryption algorithm and the private key of the temporary key pair to obtain a primary encrypted cross-chain transaction; after the primary encryption module 503 encrypts the original cross-chain transaction according to the private key of the temporary key pair to obtain a primary encrypted cross-chain transaction, it is further configured to: calculate the hash value of the primary encrypted cross-chain transaction according to the third preset encryption algorithm; sign the hash value of the primary encrypted cross-chain transaction according to the private key of the temporary key pair and the first preset encryption algorithm to obtain the signature information of the source blockchain; when the primary encryption module 503 sends the primary encrypted cross-chain transaction to the cross-chain relay for the cross-chain relay to perform secondary encryption on the primary encrypted cross-chain transaction to obtain a secondary encrypted cross-chain transaction and send the secondary encrypted cross-chain transaction to the target blockchain, it is specifically configured to: send the primary encrypted cross-chain transaction, the hash value of the primary encrypted cross-chain transaction, and the signature information of the source blockchain to the cross-chain relay, so that the cross-chain relay performs secondary encryption on the primary encrypted cross-chain transaction to obtain a secondary encrypted cross-chain transaction, and sends the secondary encrypted cross-chain transaction, the hash value of the primary encrypted cross-chain transaction, and the signature information of the source blockchain to the target blockchain; wherein, the target blockchain is configured to verify the hash value of the primary encrypted cross-chain transaction and the signature information of the source blockchain according to the first preset encryption algorithm, and determine the public key of the temporary key pair according to the target identity verification information after the verification result is passed, and process the original cross-chain transaction obtained by decrypting the secondary encrypted cross-chain transaction using the public key of the temporary key pair.
[0133] For the device of the present application, the source blockchain receives a cross-chain transaction processing request sent by a target user device, and determines an original cross-chain transaction and identification information of the target blockchain according to the cross-chain transaction processing request; generates an authentication request according to the identification information of the target blockchain and the source authentication information of the source blockchain, and sends the authentication request to a cross-chain relay; wherein, the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain; receives the private key of a temporary key pair returned by the cross-chain relay, and encrypts the original cross-chain transaction according to the private key of the temporary key pair to obtain a first-encrypted cross-chain transaction, and sends the first-encrypted cross-chain transaction to the cross-chain relay, so that the cross-chain relay performs second encryption on the first-encrypted cross-chain transaction to obtain a second-encrypted cross-chain transaction, and sends the second-encrypted cross-chain transaction to the target blockchain; wherein, the target blockchain is used to determine the public key of the temporary key pair according to the target authentication information, and process the original cross-chain transaction obtained by decrypting the second-encrypted cross-chain transaction with the public key of the temporary key pair. That is, in the solution of the present application, the source blockchain authenticates the identity of the target user to determine that the target user is a user registered on the source blockchain, thereby further improving the security of cross-chain transaction processing. The information included in the cross-chain transaction processing request sent by the target user device is information encrypted by the target user device according to multiple preset encryption algorithms, thereby improving the initial security of cross-chain transactions. The source blockchain establishes a hash value of the first-encrypted cross-chain transaction and signature information of the source blockchain, and sends both the hash value of the first-encrypted cross-chain transaction and the signature information of the source blockchain to the cross-chain relay, and then the cross-chain relay forwards them to the target blockchain, facilitating the target blockchain to verify the source blockchain information, thereby further enhancing the security of the cross-chain transaction processing process.
[0134] The present application also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the cross-chain transaction processing method provided in any of the above embodiments.
[0135] The present application also provides a computer-readable medium, on which a computer program is stored. When the program is executed by a processor, it implements the cross-chain transaction processing method provided in any of the above embodiments.
[0136] Next, refer to Figure 6 , which shows a schematic structural diagram of an electronic device 600 suitable for implementing the present application. Figure 6 The electronic device shown is only an example and should not impose any limitation on the functions and usage scope of the present application.
[0137] As Figure 6As shown, the electronic device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage section 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0138] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom can be installed into the storage section 608 as needed.
[0139] Specifically, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above functions defined in the system of the present application are executed.
[0140] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0141] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram can represent a module, a program segment, or a part of code, and the above-mentioned module, program segment, or part of code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, as well as the combination of blocks in a block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0142] The modules and / or units involved in this application can be implemented in software or in hardware. The described modules and / or units can also be provided in a processor. For example, it can be described as: A processor is applied to a cross-chain repeater in a cross-chain transaction processing system. The cross-chain transaction processing system further includes a source blockchain and a target blockchain, and includes an authentication request receiving module, an authentication information determining module, a key pair generating module, a secondary encryption module, and a cross-chain transaction sending module. Or, it can be described as: A processor is applied to the source blockchain in a cross-chain transaction processing system. The cross-chain transaction processing system further includes a cross-chain repeater and a target blockchain, and includes a processing request receiving module, an authentication request sending module, and a primary encryption module. Among them, the names of these modules do not constitute a limitation to the modules themselves in some cases.
[0143] As another aspect, the present invention also provides a computer-readable medium. The computer-readable medium can be included in the device described in the above embodiments; or it can exist alone without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device is caused to perform the following operations:
[0144] Receive an authentication request sent by the source blockchain; wherein, the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain; determine the target authentication information of the target blockchain according to the identification information of the target blockchain; generate a temporary key pair according to the source authentication information and the target authentication information, and return the private key of the temporary key pair to the source blockchain; receive the primary encrypted cross-chain transaction sent by the source blockchain, and perform secondary encryption on the primary encrypted cross-chain transaction according to the public key of the temporary key pair to obtain a secondary encrypted cross-chain transaction; wherein, the primary encrypted cross-chain transaction is obtained by the source blockchain encrypting the original cross-chain transaction according to the private key of the temporary key pair; send the secondary encrypted cross-chain transaction to the target blockchain, so that the target blockchain determines the public key of the temporary key pair according to the target authentication information, and processes the original cross-chain transaction obtained by decrypting the secondary encrypted cross-chain transaction with the public key of the temporary key pair.
[0145] Or the above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device is caused to perform the following operations:
[0146] Receive a cross-chain transaction processing request sent by a target user device, and determine an original cross-chain transaction and identification information of a target blockchain according to the cross-chain transaction processing request; generate an authentication request according to the identification information of the target blockchain and source authentication information of a source blockchain, and send the authentication request to a cross-chain relay; wherein, the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain; receive a private key of a temporary key pair returned by the cross-chain relay, encrypt the original cross-chain transaction according to the private key of the temporary key pair to obtain a once-encrypted cross-chain transaction, and send the once-encrypted cross-chain transaction to the cross-chain relay, so that the cross-chain relay performs secondary encryption on the once-encrypted cross-chain transaction to obtain a twice-encrypted cross-chain transaction, and send the twice-encrypted cross-chain transaction to the target blockchain; wherein, the target blockchain is used to determine a public key of the temporary key pair according to target authentication information, and process the original cross-chain transaction obtained by decrypting the twice-encrypted cross-chain transaction by using the public key of the temporary key pair.
[0147] According to the technical solution of the present invention, the cross-chain relay receives an authentication request sent by the source blockchain; wherein, the authentication request includes the identification information of the target blockchain and the source authentication information of the source blockchain; determine the target authentication information of the target blockchain according to the identification information of the target blockchain; generate a temporary key pair according to the source authentication information and the target authentication information, and return the private key of the temporary key pair to the source blockchain; receive the once-encrypted cross-chain transaction sent by the source blockchain, and perform secondary encryption on the once-encrypted cross-chain transaction according to the public key of the temporary key pair to obtain a twice-encrypted cross-chain transaction; wherein, the once-encrypted cross-chain transaction is obtained by the source blockchain encrypting the original cross-chain transaction according to the private key of the temporary key pair; send the twice-encrypted cross-chain transaction to the target blockchain, so that the target blockchain determines the public key of the temporary key pair according to the target authentication information, and processes the original cross-chain transaction obtained by decrypting the twice-encrypted cross-chain transaction by using the public key of the temporary key pair. That is, in the solution of the present application, on the one hand, the cross-chain transaction is encrypted with the temporary key pair, so that the cross-chain transaction can be transmitted in the blockchain in the form of encrypted information, so as to avoid the cross-chain transaction being maliciously stolen during the cross-chain process. On the other hand, the cross-chain relay generates a temporary key pair according to the authentication information of the source blockchain and the authentication information of the target blockchain, which can make the generation of the temporary key pair involve the security mechanism problems of the source blockchain and the target blockchain, so that there is no need to change the access control information during the cross-chain process, avoiding the situation of being maliciously attacked during the change process of the access control information, and further improving the security of the cross-chain access process.
[0148] An embodiment of the present application further provides a computer program product, including a computer program, which implements the cross-chain transaction processing method provided in any embodiment of the present application when being executed by a processor.
[0149] In the process of implementing the computer program product, computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN) - or, alternatively, can be connected to an external computer (e.g., by using an Internet service provider to connect through the Internet).
[0150] It should be understood that the various forms of the processes shown above can be used, steps can be reordered, added, or deleted. For example, the steps described in this application can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of this application can be achieved, and no limitations are imposed herein.
[0151] The above specific implementation manners do not constitute a limitation on the protection scope of this application. Those skilled in the art should understand that, depending on design requirements and other factors, various modifications, combinations, sub-combinations, and substitutions can occur. Any modifications, equivalent replacements, and improvements made within the spirit and principles of this application shall be included within the protection scope of this application.
Claims
1. A cross-chain transaction processing method, characterized in that: A cross-chain repeater applied to a cross-chain transaction processing system, wherein the cross-chain transaction processing system further includes a source blockchain and a target blockchain, and the method includes: Receiving an identity authentication request sent by the source blockchain; wherein the identity authentication request includes identification information of the target blockchain and source identity authentication information of the source blockchain; Determine the target identity authentication information of the target blockchain according to the identification information of the target blockchain; Generate a temporary key pair according to the source identity authentication information and the target identity authentication information, and return the private key of the temporary key pair to the source blockchain; Receive a primary encrypted cross-chain transaction sent by the source blockchain, and perform secondary encryption on the primary encrypted cross-chain transaction according to the public key of the temporary key pair to obtain a secondary encrypted cross-chain transaction; wherein the primary encrypted cross-chain transaction is obtained by encrypting the original cross-chain transaction by the source blockchain according to the private key of the temporary key pair; The secondary encrypted cross-chain transaction is sent to the target blockchain, so that the target blockchain determines the public key of the temporary key pair according to the target identity authentication information, and processes the original cross-chain transaction obtained by decrypting the secondary encrypted cross-chain transaction using the public key of the temporary key pair.
2. The method according to claim 1, characterized in that After receiving the identity authentication request sent by the source blockchain, the method further includes: Determine the identification information of the source blockchain according to the source identity verification information; If the source blockchain is determined to be a trusted blockchain based on the identification information of the source blockchain, then a step of determining the target identity authentication information of the target blockchain based on the identification information of the target blockchain is performed.
3. The method according to claim 1, characterized in that The generating a temporary key pair according to the source identity authentication information and the target identity authentication information includes: The source identity authentication information and the target identity authentication information are encrypted according to a first preset encryption algorithm to generate the temporary key pair.
4. The method according to claim 1, characterized in that: The receiving an encrypted cross-chain transaction sent by the source blockchain includes: Receive the encrypted cross-chain transaction sent by the source blockchain, the hash value of the encrypted cross-chain transaction, and the signature information of the source blockchain; The sending of the secondary encrypted cross-chain transaction to the target blockchain so that the target blockchain determines the public key of the temporary key pair according to the target identity authentication information, and processes the original cross-chain transaction obtained by decrypting the secondary encrypted cross-chain transaction using the public key of the temporary key pair, including: The secondary encrypted cross-chain transaction, the hash value of the primary encrypted cross-chain transaction, and the signature information of the source blockchain are sent to the target blockchain, so that the target blockchain verifies the hash value of the primary encrypted cross-chain transaction and the signature information of the source blockchain using the first preset encryption algorithm, and determines the public key of the temporary key pair according to the target identity authentication information after the verification result is verified passed, and processes the original cross-chain transaction obtained by decrypting the secondary encrypted cross-chain transaction using the public key of the temporary key pair.
5. A cross-chain transaction processing method, characterized in that: A source blockchain applied to a cross-chain transaction processing system, wherein the cross-chain transaction processing system further includes a cross-chain repeater and a target blockchain, and the method includes: Receive a cross-chain transaction processing request sent by a target user device, and determine identification information of the original cross-chain transaction and the target blockchain according to the cross-chain transaction processing request; Generate an identity authentication request according to the identification information of the target blockchain and the source identity authentication information of the source blockchain, and send the identity authentication request to the cross-chain repeater; wherein the identity authentication request includes the identification information of the target blockchain and the source identity authentication information of the source blockchain; Receive the private key of the temporary key pair returned by the cross-chain repeater, and encrypt the original cross-chain transaction according to the private key of the temporary key pair to obtain a primary encrypted cross-chain transaction, and send the primary encrypted cross-chain transaction to the cross-chain repeater, so that the cross-chain repeater performs secondary encryption on the primary encrypted cross-chain transaction to obtain a secondary encrypted cross-chain transaction, and sends the secondary encrypted cross-chain transaction to the target blockchain; wherein the target blockchain is used to determine the public key of the temporary key pair according to the target identity authentication information, and process the original cross-chain transaction obtained by decrypting the secondary encrypted cross-chain transaction using the public key of the temporary key pair.
6. The method according to claim 5, characterized in that The cross-chain transaction processing request includes target user identification information, an original cross-chain transaction, and target access information, and determining the identification information of the original cross-chain transaction and the target blockchain according to the cross-chain transaction processing request includes: Determine the identification information of the target blockchain according to the target access information, and obtain the original cross-chain transaction.
7. The method according to claim 6, characterized in that After determining the identification information of the target blockchain according to the target access information and obtaining the original cross-chain transaction, the method further includes: Determine whether the identification information of the target blockchain is consistent with the identification information of the source blockchain; If the identification information of the target blockchain is inconsistent with the identification information of the source blockchain, determine to execute the step of generating an identity authentication request based on the identification information of the target blockchain and the source identity authentication information of the source blockchain, and send the identity authentication request to the cross-chain repeater.
8. The method according to claim 6, characterized in that Before receiving the cross-chain transaction processing request sent by the target user equipment, the method further includes: Receiving an information registration request sent by the target user device; wherein the information registration request includes the target user registration public key; The registration of the target user is completed according to the target user registration public key, and the generated target user identification information is returned to the target user device.
9. The method according to claim 6, characterized in that The step of encrypting the original cross-chain transaction according to the private key of the temporary key pair to obtain an encrypted cross-chain transaction includes: Encrypt the original cross-chain transaction according to the second preset encryption algorithm and the private key of the temporary key pair to obtain an encrypted cross-chain transaction; After encrypting the original cross-chain transaction according to the private key of the temporary key pair to obtain an encrypted cross-chain transaction, the method further includes: Calculate the hash value of the encrypted cross-chain transaction according to a third preset encryption algorithm; Signing the hash value of the one-time encrypted cross-chain transaction according to the private key of the temporary key pair and the first preset encryption algorithm to obtain signature information of the source blockchain; The sending the once encrypted cross-chain transaction to the cross-chain repeater so that the cross-chain repeater performs secondary encryption on the once encrypted cross-chain transaction to obtain a secondary encrypted cross-chain transaction, and sending the secondary encrypted cross-chain transaction to the target blockchain includes: The once encrypted cross-chain transaction, the hash value of the once encrypted cross-chain transaction, and the signature information of the source blockchain are sent to the cross-chain repeater, so that the cross-chain repeater performs a second encryption on the once encrypted cross-chain transaction to obtain a second encrypted cross-chain transaction, and sends the second encrypted cross-chain transaction, the hash value of the once encrypted cross-chain transaction, and the signature information of the source blockchain to the target blockchain; wherein the target blockchain is used to verify the hash value of the once encrypted cross-chain transaction and the signature information of the source blockchain according to the first preset encryption algorithm, and after the verification result is verification passed, determine the public key of the temporary key pair according to the target identity authentication information, and process the original cross-chain transaction obtained by decrypting the second encrypted cross-chain transaction using the public key of the temporary key pair.
10. A cross-chain transaction processing device, characterized in that: A cross-chain repeater configured in a cross-chain transaction processing system, wherein the cross-chain transaction processing system further includes a source blockchain and a target blockchain, and the device includes: A verification request receiving module, used to receive an identity authentication request sent by the source blockchain; wherein the identity authentication request includes the identification information of the target blockchain and the source identity authentication information of the source blockchain; A verification information determination module, used to determine the target identity authentication information of the target blockchain according to the identification information of the target blockchain; A key pair generation module, configured to generate a temporary key pair according to the source identity authentication information and the target identity authentication information, and return the private key of the temporary key pair to the source blockchain; A secondary encryption module is used to receive the primary encrypted cross-chain transaction sent by the source blockchain, and perform secondary encryption on the primary encrypted cross-chain transaction according to the public key of the temporary key pair to obtain a secondary encrypted cross-chain transaction; wherein the primary encrypted cross-chain transaction is obtained by encrypting the original cross-chain transaction by the source blockchain according to the private key of the temporary key pair; A cross-chain transaction sending module is used to send the secondary encrypted cross-chain transaction to the target blockchain, so that the target blockchain determines the public key of the temporary key pair according to the target identity authentication information, and processes the original cross-chain transaction obtained by decrypting the secondary encrypted cross-chain transaction using the public key of the temporary key pair.
11. A cross-chain transaction processing device, characterized in that: A source blockchain configured in a cross-chain transaction processing system, the cross-chain transaction processing system also including a cross-chain repeater and a target blockchain, the device comprising: A processing request receiving module, used to receive a cross-chain transaction processing request sent by a target user device, and determine the identification information of the original cross-chain transaction and the target blockchain according to the cross-chain transaction processing request; A verification request sending module, used to generate an identity authentication request according to the identification information of the target blockchain and the source identity authentication information of the source blockchain, and send the identity authentication request to the cross-chain repeater; wherein the identity authentication request includes the identification information of the target blockchain and the source identity authentication information of the source blockchain; A one-time encryption module is used to receive the private key of the temporary key pair returned by the cross-chain repeater, and encrypt the original cross-chain transaction according to the private key of the temporary key pair to obtain a one-time encrypted cross-chain transaction, and send the one-time encrypted cross-chain transaction to the cross-chain repeater, so that the cross-chain repeater performs a second encryption on the one-time encrypted cross-chain transaction to obtain a second encrypted cross-chain transaction, and sends the second encrypted cross-chain transaction to the target blockchain; wherein the target blockchain is used to determine the public key of the temporary key pair according to the target identity authentication information, and process the original cross-chain transaction obtained by decrypting the second encrypted cross-chain transaction using the public key of the temporary key pair.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the cross-chain transaction processing method as described in any one of claims 1 to 4, or implements the cross-chain transaction processing method as described in any one of claims 5 to 9.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the cross-chain transaction processing method as described in any one of claims 1 to 4, or implements the cross-chain transaction processing method as described in any one of claims 5 to 9.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by the processor, it implements the cross-chain transaction processing method as described in any one of claims 1 to 4, or implements the cross-chain transaction processing method as described in any one of claims 5 to 9.
Citation Information
Patent Citations
Secure verifiable service providing method and system based on block chain cross-chain
CN114826766A
Method and system for safely interacting information of different departments based on cross-chain block chain
CN116506104A