Chain off-line data delivery method and device, electronic equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-31
- Publication Date
- 2026-08-11
AI Technical Summary
[0006]本申请的主要目的在于提供一种链下数据交付方法以及装置、电子设备、存储介质,以解决分析结果交付的原子性的问题
[0038] The off-chain data delivery method, apparatus, electronic device, and storage medium in this application embodiment utilize analysis results obtained in a trusted execution environment. First encryption result
Private key
The second encryption result
and the
and stated
The signature of the union of hash values
The method of sending to the second user, through the second user's chain, is to...
Send to the first user so that the first user can calculate the
After obtaining the hash value, it is submitted to the on-chain smart contract, thus achieving the calculation of the second user's local hash value.
The hash value, and locally in the second user's...
When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract.
The above
The purpose of sending to the smart contract is to achieve the calculation of the first user.
The hash value, the
The above
After successful verification via the smart contract, the digital assets pre-deposited by the first user into the smart contract are transferred to the second user. Simultaneously, the first user obtains the digital assets after decryption.
This technological advancement addresses the technical problem of ensuring the atomicity of analysis result delivery in scenarios where analysis results are too large to be uploaded to the blockchain.
Smart Images

Figure CN116244378B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software engineering, and more specifically, to an off-chain data delivery method, apparatus, electronic device, and storage medium. Background Technology
[0002] Trusted Execution Environments (TEEs), including Intel's SGX and AMD's SEV, ensure that programs run in a protected environment, achieving the two basic goals of preventing code tampering and preventing the access of intermediate variables. Their design principle involves adding permission checks for protected memory access at the CPU circuit level.
[0003] A blockchain is a decentralized ledger on which programs are executed, called smart contracts, in a completely open and transparent manner.
[0004] Privacy-preserving computation scenario based on a trusted execution environment: Assume a data provider (Party B) possesses the original data; and a data analyst (Party A) requires the execution result of Party B's original data on a specific analysis program. Also assume that both parties have agreed on the data transaction, and adhering to the principle of data not leaving the domain in privacy-preserving computation, a feasible execution environment containing the analysis program has been deployed locally on Party B's machine, and it has generated an analysis result D using Party B's original data as input. Now, Party A needs to obtain the value of D.
[0005] There is currently no effective solution to the problem of atomicity in the delivery of analytical results in related technologies. Summary of the Invention
[0006] The main objective of this application is to provide an off-chain data delivery method, apparatus, electronic device, and storage medium to solve the problem of atomicity in the delivery of analysis results.
[0007] To achieve the above objectives, according to one aspect of this application, an off-chain data delivery method is provided.
[0008] The off-chain data delivery method according to this application includes:
[0009] Analysis results obtained in a trusted execution environment First encryption result Private key The second encryption result and the and stated The signature of the union of hash values Send to the second user;
[0010] The second user chain will then... Send to the first user so that the first user can calculate the The hash value is then submitted to the smart contract on the chain;
[0011] Calculate the second user's local The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above Send to the smart contract;
[0012] In the calculation of the first user The hash value, the The above After successful verification via the smart contract, the digital assets pre-deposited by the first user into the smart contract are transferred to the second user. Simultaneously, the first user obtains the digital assets after decryption. Delivery completed.
[0013] Furthermore, the first user obtains the [data / property] after decryption. ,include:
[0014] According to the information obtained from the smart contract Using private key Decryption Obtain the private key ;
[0015] According to the above Decrypt the message sent from the second user chain. , to obtain the .
[0016] Furthermore, the analysis results obtained in the trusted execution environment First encryption result Private key The second encryption result and the and stated The signature of the union of hash values ,include:
[0017] Generate a pair of asymmetric keys, where the public key is denoted as . The private key is recorded as ;
[0018] Calculate the first encryption result ,in Indicates using public key right Encrypt;
[0019] ,in Indicates using public key right Encrypt;
[0020] ,in for hash value, Let be a public constant, where Indicates using private key right The consortium signed the document.
[0021] Furthermore, the step of passing the second user chain down to the Send to the first user so that the first user can calculate the The hash value is then submitted to the on-chain smart contract, including:
[0022] The second user chain off-chain transmission method will be used to transmit the... ciphertext The private key ciphertext that can be decrypted is sent to the first user but is still stored in the second user's possession.
[0023] Furthermore, the method also includes:
[0024] When the first user receives the ciphertext However, it requires a specific private key for decryption.
[0025] Further, the calculation of the second user's local... The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above Sending to the smart contract includes:
[0026] After the second user confirms that the first user has received the... After the ciphertext is obtained, the second user's local data is calculated. The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above Send it to the smart contract to publish the decryptable private key ciphertext.
[0027] Furthermore, the calculation by the first user The hash value, the The above Verification via the smart contract includes:
[0028] According to the calculation of the first user The hash value, the The above Verified via the smart contract ,
[0029] Among them, the Indicates using public key Verify the Is it A legitimate signature of the consortium.
[0030] To achieve the above objectives, according to another aspect of this application, an off-chain data delivery device is provided.
[0031] The off-chain data delivery device according to this application includes:
[0032] Encryption module, used to process analysis results obtained in a trusted execution environment. First encryption result Private key The second encryption result and the and stated The signature of the union of hash values Send to the second user;
[0033] The off-chain sending module is used to send the data via the second user's off-chain connection. Send to the first user so that the first user can calculate the The hash value is then submitted to the smart contract on the chain;
[0034] The hash calculation module is used to calculate the hash value locally of the second user. The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above Send to the smart contract;
[0035] The hash verification module is used to verify the hash value calculated by the first user. The hash value, the The above After successful verification via the smart contract, the digital assets pre-deposited by the first user into the smart contract are transferred to the second user. Simultaneously, the first user obtains the digital assets after decryption. Delivery completed.
[0036] According to another aspect of this application, a storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0037] According to another aspect of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0038] The off-chain data delivery method, apparatus, electronic device, and storage medium in this application embodiment utilize analysis results obtained in a trusted execution environment. First encryption result Private key The second encryption result and the and stated The signature of the union of hash values The method of sending to the second user, through the second user's chain, is to... Send to the first user so that the first user can calculate the After obtaining the hash value, it is submitted to the on-chain smart contract, thus achieving the calculation of the second user's local hash value. The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above The purpose of sending to the smart contract is to achieve the calculation of the first user. The hash value, the The above After successful verification via the smart contract, the digital assets pre-deposited by the first user into the smart contract are transferred to the second user. Simultaneously, the first user obtains the digital assets after decryption. This technological advancement addresses the technical problem of ensuring the atomicity of analysis result delivery in scenarios where analysis results are too large to be uploaded to the blockchain. Attached Figure Description
[0039] The accompanying drawings, which form part of this application, are used to provide a further understanding of the application and to make other features, objects, and advantages of the application more apparent. The illustrative embodiments and descriptions of this application are used to explain the application and do not constitute an undue limitation of the application. In the drawings:
[0040] Figure 1 This is a flowchart illustrating an off-chain data delivery method according to an embodiment of this application;
[0041] Figure 2 This is a schematic diagram of the structure of an off-chain data delivery device according to an embodiment of this application;
[0042] Figure 3 This is a schematic diagram illustrating the implementation principle of the off-chain data delivery method according to an embodiment of this application. Detailed Implementation
[0043] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0044] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0045] In this application, the terms "upper," "lower," "left," "right," "front," "rear," "top," "bottom," "inner," "outer," "middle," "vertical," "horizontal," "lateral," and "longitudinal" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are primarily for the purpose of better describing this application and its embodiments, and are not intended to limit the indicated device, element, or component to having a specific orientation, or to be constructed and operated in a specific orientation.
[0046] Furthermore, in addition to indicating location or positional relationship, some of the aforementioned terms may also have other meanings. For example, the term "above" may also be used in some cases to indicate a certain dependency or connection relationship. Those skilled in the art can understand the specific meaning of these terms in this application based on the specific circumstances.
[0047] Furthermore, the terms "installation," "setup," "equipped with," "connection," "linking," and "socketing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral structure; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium, or an internal connection between two devices, components, or parts. Those skilled in the art can understand the specific meaning of these terms in this application based on the specific circumstances.
[0048] The problem with this technology lies in the atomicity of the delivery of analysis results. That is, Party B will not receive payment from Party A until Party A receives the correct analysis results. However, once Party A has indeed received the correct analysis results, Party B will receive payment. In other words, the events of Party A receiving the correct analysis results and Party B receiving payment must occur simultaneously; otherwise, neither will occur.
[0049] This application focuses on scenarios where the analysis results are too large to be uploaded to the blockchain. The solution in this application perfectly enables the delivery of large-scale data analysis results. Specifically, during the above execution process, any breach of the protocol by either party will not affect atomicity.
[0050] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0051] like Figure 1 The diagram illustrates an off-chain data delivery method in an embodiment of this application, comprising the following steps S110 to S140:
[0052] Step S110: The analysis results obtained in the trusted execution environment. First encryption result Private key The second encryption result and the and stated The signature of the union of hash values , and send it to the second user.
[0053] The first user is the nail company, the data analysis company.
[0054] The second user refers to Party B, the data provider.
[0055] First, assume that Party A has a pair of asymmetric keys, where the public key is denoted as . Private key is recorded as The public key is submitted to the smart contract, and the private key is transmitted to the analysis program in the trusted execution environment through trusted means. Furthermore, Party A has already deposited a digital asset into the smart contract, the amount of which equals the funds required for this data transaction.
[0056] Then, generate an asymmetric key pair, with the public key denoted as . The private key is recorded as The data to be transmitted is encrypted using a specific private key within a trusted execution environment. Simultaneously, the ciphertext of the specific private key, the ciphertext of D, and the relevant signature are output to Party B, who then runs the program within the trusted execution environment.
[0057] It is understandable that the first encryption result and the second encryption result were obtained by encrypting with different public keys.
[0058] It should be noted that this application first assumes that the data transmission method based on the trusted execution environment has been given, and no additional restrictions are imposed.
[0059] Step S120, the second user chain is used to transfer the... Send to the first user so that the first user can calculate the The hash value is then submitted to the smart contract on the chain.
[0060] Party B will Send to Party A. Because... for The ciphertext, its size and In this context, the transmission is performed via off-chain transfer, including network transmission or hardware device transmission. The purpose of this step is to... The encrypted text is sent to Party A, but the private key that can currently decrypt it is still in the hands of Party B.
[0061] Step S130, calculate the local value of the second user. The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above Send to the smart contract.
[0062] Party A received Then, calculate the above. hash value And submit it to the smart contract. This step indicates that Party A has received it. The encrypted text can be obtained, but a specific private key is required to decrypt it.
[0063] When Party B uses its local... calculate When it discovers a smart contract that matches its local computation... When the values are the same, submit the local one. To the smart contract. This step is after Party B confirms that Party A has received the information. After obtaining the ciphertext, the private key ciphertext that can be decrypted will be published.
[0064] Step S140, in the calculation of the first user The hash value, the The above After successful verification via the smart contract, the digital assets pre-deposited by the first user into the smart contract are transferred to the second user. Simultaneously, the first user obtains the digital assets after decryption. Delivery completed.
[0065] Verify the correctness of the information submitted by all parties through smart contracts, including wait.
[0066] As can be seen from the above description, this application achieves the following technical effects:
[0067] The analysis results obtained in a trusted execution environment will be used. First encryption result Private key The second encryption result and the and stated The signature of the union of hash values The method of sending to the second user, through the second user's chain, is to... Send to the first user so that the first user can calculate the After obtaining the hash value, it is submitted to the on-chain smart contract, thus achieving the calculation of the second user's local hash value. The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above The purpose of sending to the smart contract is to achieve the calculation of the first user. The hash value, the The above After successful verification via the smart contract, the digital assets pre-deposited by the first user into the smart contract are transferred to the second user. Simultaneously, the first user obtains the digital assets after decryption. This technological advancement addresses the technical problem of ensuring the atomicity of analysis result delivery in scenarios where analysis results are too large to be uploaded to the blockchain.
[0068] As a preferred embodiment, the first user obtains the [data / property] after decryption. This includes: based on the information obtained from the smart contract Using private key Decryption Obtain the private key According to the above Decrypt the message sent from the second user chain. , to obtain the .
[0069] In practice, once the smart contract payment process is completed, Party A obtains the payment from the smart contract. ,use Decryption get Then use Decrypt the received The analysis results were obtained. The delivery of analysis results is now complete.
[0070] As a preferred embodiment, the analysis results obtained in a trusted execution environment First encryption result Private key The second encryption result and the and stated The signature of the union of hash values This includes: generating a pair of asymmetric keys, where the public key is denoted as . The private key is recorded as ; Calculate the first encryption result ,in Indicates using public key right Encrypt; ,in Indicates using public key right Encrypt; ,in for hash value, Let be a public constant, where Indicates using private key right The consortium signed the document.
[0071] In practice, Party B runs the program in a trusted execution environment, and the program includes the following modules:
[0072] First, execute the analysis program specified by Party A, using Party B's original data as input, and record the analysis results as follows: .
[0073] Next, generate an asymmetric key pair, with the public key denoted as . The private key is recorded as .
[0074] Then, calculate ,in Indicates using public key right Encrypt;
[0075] ,in Indicates using public key right Encrypt;
[0076] Finally, the signature is calculated. ,in for The hash value, also called the digest value, is obtained by calculating a given collision resistance function. It is a public constant used in each signature. It's different; it ensures that the signature cannot be reused. Indicates using private key right The consortium signed the document.
[0077] In summary, Output to Party B.
[0078] As a preferred embodiment, the step of passing the second user chain down... Send to the first user so that the first user can calculate the After obtaining the hash value, it is submitted to the on-chain smart contract, including: transmitting the hash value to the second user off-chain. ciphertext The private key ciphertext that can be decrypted is sent to the first user but is still stored in the second user's possession.
[0079] For scenarios where the analysis results are too large to be uploaded to the blockchain, Party B will... Send to Party A. Because... for The ciphertext, its size and In this context, the transmission is done via off-chain methods, including network transmission or hardware device transmission.
[0080] If Party B submits incorrect encrypted analysis results Give it to Party A, then Party A submits The subsequent verification of the smart contract will fail because the trusted execution environment generates... Yes The signature instead The second party does not have the private key. Unable to obtain The valid signature has been verified, therefore the agreement will not continue to be executed.
[0081] As a preferred embodiment, the method further includes: after the first user receives the... ciphertext However, decryption requires a specific private key. Party A has already received it. The encrypted text can be obtained, but a specific private key is required to decrypt it.
[0082] As a preferred embodiment, the calculation of the second user's local... The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above Sending to the smart contract includes: after the second user confirms that the first user has received the message. After the ciphertext is obtained, the second user's local data is calculated. The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above Send it to the smart contract to publish the decryptable private key ciphertext.
[0083] In practice, Party A received Then, calculate And submit it to the smart contract.
[0084] When Party B uses its local... calculate When it discovers a smart contract that matches its local computation... When the values are the same, submit the local one. To smart contracts.
[0085] If Party A receives the correct Afterwards, still submit an error. To smart contracts (expected to obtain without payment) (The decryption key), at this time, Party B is in the current smart contract And its local calculation Different, therefore will not be submitted. On the smart contract, the agreement will not continue to execute, and Party A will still be unable to decrypt it. .
[0086] As a preferred embodiment, the first user calculates the... The hash value, the The above Verification via the smart contract includes: based on the calculations of the first user. The hash value, the The above Verified via the smart contract , wherein Indicates using public key Verify the Is it A legitimate signature of the consortium.
[0087] In practice, smart contract verification ,
[0088] in For the data submitted by Party A, The data submitted by Party B.
[0089] Indicates using public key verify Is it A valid signature from the consortium. If verification passes, the digital assets deposited by Party A in the smart contract will be transferred to Party B's address, completing the payment process.
[0090] If Party B submits an incorrect If this happens with the smart contract, then the smart contract verification will fail because the second party does not have the private key. ,remove It is impossible to obtain another one containing [the virus / organization] outside of this. The signature.
[0091] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0092] According to embodiments of this application, an off-chain data delivery device for implementing the above method is also provided, such as... Figure 2 As shown, the device includes:
[0093] Encryption module 210 is used to store analysis results obtained in a trusted execution environment. First encryption result Private key The second encryption result and the and stated The signature of the union of hash values Send to the second user;
[0094] Off-chain sending module 220 is used to send the data via the second user's off-chain connection. Send to the first user so that the first user can calculate the The hash value is then submitted to the smart contract on the chain;
[0095] Hash calculation module 230, used to calculate the hash locally of the second user. The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above Send to the smart contract;
[0096] Hash verification module 240, used for verifying the hash value calculated by the first user. The hash value, the The above After successful verification via the smart contract, the digital assets pre-deposited by the first user into the smart contract are transferred to the second user. Simultaneously, the first user obtains the digital assets after decryption. Delivery completed.
[0097] The first user in the encryption module 210 refers to the nail party and the data analysis party.
[0098] The second user refers to Party B, the data provider.
[0099] First, assume that Party A has a pair of asymmetric keys, where the public key is denoted as . Private key is recorded as The public key is submitted to the smart contract, and the private key is transmitted to the analysis program in the trusted execution environment through trusted means. Furthermore, Party A has already deposited a digital asset into the smart contract, the amount of which equals the funds required for this data transaction.
[0100] Then, generate an asymmetric key pair, with the public key denoted as . The private key is recorded as The data to be transmitted is encrypted using a specific private key within a trusted execution environment. Simultaneously, the ciphertext of the specific private key, the ciphertext of D, and the relevant signature are output to Party B, who then runs the program within the trusted execution environment.
[0101] It is understandable that the first encryption result and the second encryption result were obtained by encrypting with different public keys.
[0102] It should be noted that this application first assumes that the data transmission method based on the trusted execution environment has been given, and no additional restrictions are imposed.
[0103] In the off-chain sending module 220, Party B will... Send to Party A. Because... for The ciphertext, its size and In this context, the transmission is performed via off-chain transfer, including network transmission or hardware device transmission. The purpose of this step is to... The encrypted text is sent to Party A, but the private key that can currently decrypt it is still in the hands of Party B.
[0104] The hash calculation module 230 receives the data from Party A. Then, calculate the above. hash value And submit it to the smart contract. This step indicates that Party A has received it. The encrypted text can be obtained, but a specific private key is required to decrypt it.
[0105] When Party B uses its local... calculate When it discovers a smart contract that matches its local computation... When the values are the same, submit the local one. To the smart contract. This step is after Party B confirms that Party A has received the information. After obtaining the ciphertext, the private key ciphertext that can be decrypted will be published.
[0106] The hash verification module 240 verifies the correctness of the information submitted by each party through a smart contract, including... wait.
[0107] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device, or fabricating them separately as individual integrated circuit modules, or fabricating multiple modules or steps as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0108] like Figure 3 The diagram shown illustrates the implementation principle of an off-chain data delivery method according to an embodiment of this application, which specifically includes the following steps:
[0109] Step 1: Party B runs the program in a trusted execution environment, wherein the program contains the following modules:
[0110] (1) Execute the analysis program specified by Party A, using Party B's original data as input (this invention assumes that the analysis program module has been given and does not impose any additional restrictions), and record the analysis results as follows: .
[0111] (2) Generate a pair of asymmetric keys, with the public key denoted as . The private key is recorded as .
[0112] (3) Calculation ,in Indicates using public key right Encrypt;
[0113] ,in Indicates using public key right Encrypt;
[0114] ,in for The hash value, also called the digest value, is obtained by calculating a given collision resistance function. It is a public constant used in each signature. It's different; it ensures that the signature cannot be reused. Indicates using private key right The consortium signed the document.
[0115] (4) Output to Party B.
[0116] The above steps are equivalent to encrypting the data to be transmitted using a specific private key. Simultaneously, the ciphertext containing the specific private key is output. The encrypted text and related signatures are given to Party B.
[0117] Step 2, Party B will Send to Party A. Because... for The ciphertext, its size and In this context, the transmission is done via off-chain methods, including network transmission or hardware device transmission.
[0118] The purpose of this step is to The encrypted text is sent to Party A, but the private key that can currently decrypt it is still in the hands of Party B.
[0119] Step 3, Party A receives Then, calculate And submit it to the smart contract.
[0120] This step indicates that Party A has received it. The encrypted text can be obtained, but a specific private key is required to decrypt it.
[0121] Step 4, when Party B uses its local... calculate When it discovers a smart contract that matches its local computation... When the values are the same, submit the local one. To smart contracts.
[0122] This step is completed after Party B confirms that Party A has received the document. After obtaining the ciphertext, the private key ciphertext that can be decrypted will be published.
[0123] Step 5, Smart Contract Verification ,in The data submitted by Party A in step 3. The data submitted by Party B in step 4, Indicates using public key verify Is it A valid signature from the consortium. If verification passes, the digital assets deposited by Party A in the smart contract will be transferred to Party B's address, completing the payment process.
[0124] The purpose of this step is to verify the correctness of the information submitted by each party, including wait.
[0125] Step 6: If the smart contract payment process is completed, Party A obtains the payment details from the smart contract. ,use Decryption get Then use Decrypt what it received in step 3 The analysis results were obtained. The delivery of analysis results is now complete.
[0126] If Party B cheats in step 2 and submits incorrect encrypted analysis results... If it is given to Party A, then Party A submits it in step 3. Then, step 5 of the smart contract verification will fail because the trusted execution environment will not be able to generate the necessary verification. Yes The signature instead The second party does not have the private key. Unable to obtain The valid signature has been verified, therefore the agreement will not continue to be executed.
[0127] If Party A cheats in step 3 and receives the correct result... Afterwards, still submit an error. To smart contracts (expected to obtain without payment) (The decryption key), at which point Party B discovers the smart contract in step 4. And its local calculation Different, therefore will not be submitted. On the smart contract, the agreement will not continue to execute, and Party A will still be unable to decrypt it. .
[0128] If Party B cheats in step 4 and submits an incorrect submission... If this leads to a smart contract verification, then step 5 will fail because the second party does not possess the private key. ,remove It is impossible to obtain another one containing [the virus / organization] outside of this. The signature.
[0129] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for off-chain data delivery, characterized in that, The method includes: Analysis results obtained in a trusted execution environment First encryption result Private key The second encryption result and the and stated The signature of the union of hash values Send to the second user; The second user chain will then... Send to the first user so that the first user can calculate the The hash value is then submitted to the smart contract on the chain; Among them, the transmission is carried out through the second user chain. ciphertext The private key ciphertext that can be decrypted is sent to the first user, but is still stored in the second user's possession; When the first user receives the ciphertext However, a specific private key is required for decryption; Calculate the second user's local The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above Send to the smart contract; Wherein, the second user confirms that the first user has received the... After the ciphertext is obtained, the second user's local data is calculated. The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above Send it to the smart contract to publish the decryptable private key ciphertext; In the calculation of the first user The hash value, the The above After successful verification via the smart contract, the digital assets pre-deposited by the first user into the smart contract are transferred to the second user. Simultaneously, the first user obtains the digital assets after decryption. Delivery completed.
2. The method according to claim 1, characterized in that, The first user obtains the [data / property] after decryption. ,include: According to the information obtained from the smart contract Using private key Decryption Obtain the private key ; According to the above Decrypt the message sent from the second user chain. , to obtain the .
3. The method according to claim 1, characterized in that, The analysis results obtained in the trusted execution environment First encryption result Private key The second encryption result and the and stated The signature of the union of hash values ,include: Generate a pair of asymmetric keys, where the public key is denoted as . The private key is recorded as ; Calculate the first encryption result ,in Indicates using public key right Encrypt; ,in Indicates using public key right Encrypt; ,in for hash value, Let be a public constant, where Indicates using private key right The consortium signed the document.
4. The method according to claim 1, characterized in that, The first user calculated the The hash value, the The above Verification via the smart contract includes: According to the calculation of the first user The hash value, the The above Verified via the smart contract , Among them, the Indicates using public key Verify the Is it A legitimate signature of the consortium.
5. An off-chain data delivery device, characterized in that, The device includes: Encryption module, used to process analysis results obtained in a trusted execution environment. First encryption result Private key The second encryption result and the and stated The signature of the union of hash values Send to the second user; The off-chain sending module is used to send the data via the second user's off-chain connection. Send to the first user so that the first user can calculate the The hash value is then submitted to the smart contract on the chain; Among them, the transmission is carried out through the second user chain. ciphertext The private key ciphertext that can be decrypted is sent to the first user, but is still stored in the second user's possession; When the first user receives the ciphertext However, a specific private key is required for decryption; The hash calculation module is used to calculate the hash value locally of the second user. The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above Send to the smart contract; Wherein, the second user confirms that the first user has received the... After the ciphertext is obtained, the second user's local data is calculated. The hash value, and locally in the second user's... When the hash value of the smart contract is the same as the hash value of the smart contract, the second user will transfer the hash value to the smart contract. The above Send it to the smart contract to publish the decryptable private key ciphertext; The hash verification module is used to verify the hash value calculated by the first user. The hash value, the The above After successful verification via the smart contract, the digital assets pre-deposited by the first user into the smart contract are transferred to the second user. Simultaneously, the first user obtains the digital assets after decryption. Delivery completed.
6. An electronic device, comprising: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method of any one of claims 1 to 4.
7. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the method of any one of claims 1 to 4.
Citation Information
Patent Citations
Blockchain implementation method with Turing complete smart contract
CN111882437A
Data uplink method and system applied to transmission terminal, equipment and storage medium
CN112667743A
Private data transaction method and system, computer equipment and storage medium
CN114301675A