Distributed execution environment secure deletion method suitable for privacy smart contract

By generating deletion proof and storing evidence on the blockchain, combining the heartbeat mechanism and state perception mechanism, the security deletion problem of trusted execution environment nodes in the privacy smart contract is solved, ensuring data integrity and security.

CN120408600APending Publication Date: 2025-08-01TSINGHUA UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510276850.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

In privacy smart contracts executed on blockchain, the existing technology cannot provide valid proof of deletion when the node of the trusted execution environment exits, resulting in the possibility of privacy data being left over and facing the risk of ongoing attacks.

Method used

By generating a proof of deletion of trusted execution environment instances and storing evidence on the blockchain, combining the heartbeat mechanism and state awareness mechanism, we ensure that the data owner can safely delete the trusted execution environment instances, and use the remote verification service to verify the integrity of the deletion process.

Benefits of technology

It realizes secure deletion when the trusted execution environment node exits, eliminating the risk of private data legacy and being attacked, and ensuring data integrity and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120408600A_ABST
    Figure CN120408600A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed execution environment secure deletion method suitable for a privacy smart contract, and the method is used for a trusted execution environment node, and comprises the steps: receiving a deletion request which is that a data owner client queries a first state table at a first preset moment, after the trusted execution environment instance of which the quit state is normal quit is obtained, the trusted execution environment instance is generated for the obtained trusted execution environment instance; deleting the trusted execution environment instance to obtain a deletion result and a deletion proof; sending the deletion certificate to the block chain for certificate storage; and deleting return information formed by the deleting result is fed back to the data owner client, so that the data owner client updates the deleting state of the trusted execution environment instance in the second state table, the first state table is inquired at a second preset moment, and the successfully deleted trusted execution environment instance is obtained. And obtaining a deletion proof of the successfully deleted trusted execution environment instance from the block chain, and performing verification. The trusted execution environment can be safely deleted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of circuit structure design and computer data processing, and particularly relates to a secure deletion method for a distributed execution environment suitable for privacy smart contracts. Background Art

[0002] This section aims to provide background or context for the embodiments of the present invention described in the claims. The descriptions herein are not admitted to be prior art merely because they are included in this section.

[0003] The blockchain itself is an open and transparent distributed ledger system, in which all data can be publicly queried. This transparency ensures the trustworthiness of the system but also brings the risk of privacy data exposure. As a distributed application on the blockchain, smart contracts also have the same privacy issues during execution, that is, the contract code and contract state are transparent to all participants, which may expose sensitive information.

[0004] A trusted execution environment is a secure computing environment. It provides an isolated execution space to protect sensitive data and operations from external attacks or unauthorized access. The life cycle of the trusted execution environment covers the entire process from initialization, loading, execution to deletion.

[0005] With the continuous development of blockchain applications (smart contracts), the demand for protecting data privacy and contract code confidentiality on the blockchain is increasing. Introducing a trusted execution environment into the blockchain can meet the needs of privacy smart contracts. The main idea of the privacy smart contract solution based on the trusted execution environment is: deploying smart contract code and sensitive data to execute in the secure environment of the trusted execution environment, and using the isolation and encryption protection mechanisms at the hardware level to ensure that the code and data during the execution of the smart contract cannot be obtained or tampered with.

[0006] In recent years, privacy smart contracts assisted by trusted hardware (trusted execution environment) have received extensive attention and research. Currently, some general architectures of privacy smart contracts based on a distributed trusted execution environment have emerged, aiming to solve the limitations of smart contracts in terms of confidentiality and performance. The smart contracts are deployed in the trusted execution environment to ensure the security of the code and data, and at the same time, the blockchain is used to persistently store and verify the contract state, thereby achieving high-performance and high-security smart contract processing, which is suitable for complex distributed application scenarios that require protecting privacy and data integrity.

[0007] However, in the scenario where a general architecture based on a distributed trusted execution environment exits the trusted execution environment node, that is, when the trusted execution environment enters the deletion life cycle, an attacker can easily disguise the situation where private data is deleted, causing the private data to remain in the node's trusted execution environment. As a result, the attacker can privately initiate attacks such as side-channel attacks, exposing the private data to the risk of continuous malicious attacks.

[0008] Therefore, there is currently a need for a secure deletion method for a distributed execution environment suitable for privacy smart contracts to securely delete the executable environment in a distributed trusted execution environment system and protect the security of private data. Summary of the Invention

[0009] An embodiment of the present invention provides a secure deletion method for a distributed execution environment suitable for privacy smart contracts to securely delete the executable environment in a distributed trusted execution environment system. The method is applied to any trusted execution environment node in the distributed trusted execution environment system, and the method includes:

[0010] According to the received deletion request, delete the trusted execution environment instance, obtain a deletion result, and generate a deletion proof. The deletion request is generated by the data owner client after querying the first status table at a first preset moment and obtaining a trusted execution environment instance with a normal exit status.

[0011] Send the deletion proof to the blockchain for evidence storage.

[0012] Feed back the deletion return information composed of the deletion result of the trusted execution environment to the data owner client, so that the data owner client can update the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information, and query the first status table at a second preset moment to obtain a trusted execution environment instance with a deletion status of successful deletion. After obtaining the deletion proof of the trusted execution environment instance with successful deletion from the blockchain, call the remote verification service to verify the deletion proof.

[0013] Another embodiment of the present invention provides another secure deletion method for a distributed execution environment suitable for privacy smart contracts to securely delete the executable environment in a distributed trusted execution environment system. The method is applied to the data owner client in the distributed trusted execution environment system, and the method includes:

[0014] Query the first status table at a first preset moment to obtain a trusted execution environment instance with a normal exit status.

[0015] Generate a deletion request for each queried trusted execution environment instance and send it to the trusted execution environment node where the trusted execution environment instance is located, so that the trusted execution environment node deletes the trusted execution environment instance according to the received deletion request, obtains a deletion result, generates a deletion proof, sends the deletion proof to the blockchain for evidence storage, and feeds back deletion return information composed of the deletion result of the trusted execution environment;

[0016] Update the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information;

[0017] Query the first status table at the second preset moment, obtain the trusted execution environment instances with the deletion status of successful deletion, obtain the deletion proof of the trusted execution environment instances with successful deletion from the blockchain, and then call the remote verification service to verify the deletion proof.

[0018] An embodiment of the present invention further provides a secure deletion device for a distributed execution environment applicable to a privacy smart contract to securely delete an executable environment in a distributed trusted execution environment system. The device is applied to any trusted execution environment node in the distributed trusted execution environment system, and the device includes:

[0019] A deletion request receiving module, configured to receive a deletion request, where the deletion request is generated by the data owner client after querying the first status table at the first preset moment and obtaining the trusted execution environment instances with the exit status of normal exit;

[0020] A deletion module, configured to delete the trusted execution environment instance, obtain a deletion result, and generate a deletion proof;

[0021] A deletion proof sending module, configured to send the deletion proof to the blockchain for evidence storage;

[0022] A deletion return information sending module, configured to feed back deletion return information composed of the deletion result of the trusted execution environment to the data owner client, so that the data owner client updates the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information, and queries the first status table at the second preset moment, obtains the trusted execution environment instances with the deletion status of successful deletion, obtains the deletion proof of the trusted execution environment instances with successful deletion from the blockchain, and then calls the remote verification service to verify the deletion proof.

[0023] An embodiment of the present invention further provides another secure deletion device for a distributed execution environment applicable to a privacy smart contract to securely delete an executable environment in a distributed trusted execution environment system. The device is applied to the data owner client in the distributed trusted execution environment system, and the device includes:

[0024] A trusted execution environment instance query module, configured to query a first status table at a first preset moment to obtain trusted execution environment instances with a normal exit status;

[0025] A deletion request generation module, configured to generate a deletion request for each queried trusted execution environment instance and send it to the trusted execution environment node where the trusted execution environment instance is located, so that the trusted execution environment node deletes the trusted execution environment instance according to the received deletion request, obtains a deletion result, generates a deletion proof, sends the deletion proof to the blockchain for evidence storage, and feeds back deletion return information composed of the deletion results of the trusted execution environment;

[0026] A second status table update module, configured to update the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information;

[0027] A verification module, configured to query the first status table at a second preset moment to obtain trusted execution environment instances with a deletion success status, obtain the deletion proof of the trusted execution environment instance with a deletion success from the blockchain, and then call a remote verification service to verify the deletion proof.

[0028] An embodiment of the present invention provides a distributed execution environment security deletion system applicable to privacy smart contracts to securely delete an executable environment in a distributed trusted execution environment system. The system includes:

[0029] A distributed trusted execution environment system, a data owner client, a remote verification service, and a blockchain; the distributed trusted execution environment system includes at least one trusted execution environment node;

[0030] A data owner client, configured to query a first status table at a first preset moment to obtain trusted execution environment instances with a normal exit status, generate a deletion request for each queried trusted execution environment instance, and send it to the trusted execution environment node where the trusted execution environment instance is located;

[0031] A trusted execution environment node, configured to delete the trusted execution environment instance according to the received deletion request, obtain a deletion result, and generate a deletion proof; send the deletion proof to the blockchain for evidence storage; feed back deletion return information composed of the deletion results of the trusted execution environment to the data owner client;

[0032] The data owner client is used to update the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information; query the first status table at the second preset moment to obtain the trusted execution environment instance with the deletion status of successful deletion, and after obtaining the deletion proof of the trusted execution environment instance with successful deletion from the blockchain, send it to the remote verification service;

[0033] The remote verification service is used to verify the received deletion proof and return the verification result to the data owner client.

[0034] An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above-mentioned distributed execution environment security deletion method applicable to privacy smart contracts is implemented.

[0035] An embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned distributed execution environment security deletion method applicable to privacy smart contracts is implemented.

[0036] An embodiment of the present invention further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the above-mentioned distributed execution environment security deletion method applicable to privacy smart contracts is implemented.

[0037] In the embodiments of the present invention, by generating a deletion proof of a trusted execution environment instance, in the case where the trusted execution environment instance of a node exits normally or abnormally after executing a smart contract, secure distributed deletion of the trusted execution environment instance can be performed, eliminating the potential risk that the trusted execution environment node is forged to exit, and the private data is retained and continuously attacked resulting in leakage. This solution can be applied to privacy smart contract architectures of different technical types and can also be compatible with multiple trusted execution environment systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings. In the drawings:

[0039] Figure 1 It is a schematic structural diagram of a distributed execution environment security deletion system applicable to privacy smart contracts in an embodiment of the present invention;

[0040] Figure 2This is the overall architecture diagram of the secure deletion method for the distributed execution environment applicable to privacy smart contracts in the embodiments of the present invention;

[0041] Figure 3 This is the technical architecture diagram of the secure deletion method for the distributed execution environment applicable to privacy smart contracts in the embodiments of the present invention;

[0042] Figure 4 This is the flowchart of the normal exit state perception of the trusted execution environment in the embodiments of the present invention;

[0043] Figure 5 This is the flowchart of the deletion of the trusted execution environment instance and the generation of the deletion proof in the embodiments of the present invention;

[0044] Figure 6 This is the flowchart of verifying the deletion proof in the embodiments of the present invention;

[0045] Figure 7 This is the architecture diagram of integrating the trusted execution environment node as a node of the blockchain in the embodiments of the present invention;

[0046] Figure 8 This is the timing diagram of the normal exit of the operating system kernel signature mode in the embodiments of the present invention;

[0047] Figure 9 This is the abnormal exit timing diagram of the trusted execution environment instance in the embodiments of the present invention;

[0048] Figure 10 This is another abnormal exit timing diagram of the trusted execution environment instance in the embodiments of the present invention;

[0049] Figure 11 This is the flowchart of the secure deletion method for the distributed execution environment applicable to privacy smart contracts in the embodiments of the present invention;

[0050] Figure 12 This is the structural schematic diagram of the secure deletion device for the distributed execution environment applicable to privacy smart contracts in the embodiments of the present invention;

[0051] Figure 13 This is the flowchart of another secure deletion method for the distributed execution environment applicable to privacy smart contracts in the embodiments of the present invention;

[0052] Figure 14 This is the structural diagram of another secure deletion device for the distributed execution environment applicable to privacy smart contracts in the embodiments of the present invention;

[0053] Figure 15 This is the schematic diagram of the computer device in the embodiments of the present invention. Detailed implementation manners

[0054] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer and more understandable, the following further describes the embodiments of the present invention in detail with reference to the accompanying drawings. Herein, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but not to limit the present invention.

[0055] In the scenario where the general architecture based on the distributed trusted execution environment exits the trusted execution environment node, that is, when the trusted execution environment enters the deletion life cycle, the following problems exist: The distributed system does not provide relevant information such as cryptographic proofs to indicate that the private data in the trusted execution environment has been deleted, and the owner of the private data cannot verify that it has entered the deletion life cycle. When the distributed node exits, insufficient consideration is given to the deletion proof of the private data. It is easy for an attacker to disguise the situation where the private data has been deleted, leaving the private data in the trusted execution environment of the node, so that the attacker can privately initiate attacks such as side-channel attacks, putting the private data at risk of continuous malicious attacks.

[0056] In addition to the scenario of trusted execution environment deletion caused by the exit of the trusted execution environment node as described above, other scenarios that cause the deletion of the trusted execution environment are as follows: First, when the distributed trusted execution environment system completes the required computing tasks, the owner of the private data hopes to end the use of the trusted execution environment service and delete the private data in the trusted execution environment; Second, when the distributed node currently providing the trusted execution service frequently experiences host anomalies such as power outages, the owner of the private data hopes to switch the trusted execution environment node, resulting in the deletion of the original trusted execution environment; Third, the management of the nodes by the administrator of the distributed trusted execution environment system, that is, when the administrator makes the node currently used by the data owner exit the distributed system, resulting in the deletion of the trusted execution environment on the exiting node.

[0057] The method proposed in the embodiments of the present invention mainly includes four parts: a heartbeat mechanism, a trusted execution environment status perception mechanism, a trusted execution environment deletion, and a deletion proof generation and verification mechanism. The owner of the private data realizes the secure deletion of the executable environment in various scenarios by verifying the proof generated after deletion.

[0058] The following introduces the terms related to the embodiments of the present invention.

[0059] Trusted execution environment instance: Represented by E. A secure isolation environment created by the CPU in the trusted execution environment. The trusted execution environment ensures that the code and data within this trusted execution environment instance are protected from interference or tampering by the host operating system or other software. It implements strict access control and encryption measures to maintain the integrity and confidentiality of the content of the trusted execution environment instance.

[0060] Heartbeat mechanism: A communication protocol used to periodically detect and confirm whether a system or service is operating normally and to maintain the network connection status.

[0061] Figure 1 This is a schematic structural diagram of a distributed execution environment security deletion system applicable to privacy smart contracts in an embodiment of the present invention, including a distributed trusted execution environment system D, a data owner client U, a remote verification service V, and a blockchain B; the distributed trusted execution environment system D includes at least one trusted execution environment node N;

[0062] The data owner client is used to query the first status table at a first preset moment, obtain trusted execution environment instances with a normal exit status, generate a deletion request for each queried trusted execution environment instance, and send it to the trusted execution environment node where the trusted execution environment instance is located;

[0063] The trusted execution environment node is used to delete the trusted execution environment instance according to the received deletion request, obtain a deletion result, and generate a deletion proof; send the deletion proof to the blockchain for evidence storage; and feedback the deletion return information composed of the deletion results of the trusted execution environment to the data owner client;

[0064] The data owner client is used to update the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information; query the first status table at a second preset moment, obtain trusted execution environment instances with a deletion success status, and send the deletion proof of the trusted execution environment instance with a deletion success status to the remote verification service after obtaining it from the blockchain;

[0065] The remote verification service is used to verify the received deletion proof and return the verification result to the data owner client.

[0066] Among them, the first preset moment and the second preset moment can be determined according to the actual situation. It can be a regular query or some fixed moments every day to query. Generally, the first status table and the second status table are regularly queried.

[0067] Figure 2 This is a detailed architecture diagram of a distributed execution environment security deletion system applicable to privacy smart contracts for privacy smart contracts. The participants mainly include privacy data owners, trusted execution environment owners, distributed trusted execution environment system (TEE) managers, blockchain managers, remote authentication service managers, and challengers. Among them:

[0068] Privacy data owner: It ensures the privacy and security of the data it owns with the help of the trusted execution environment and sends an initialization request to the trusted execution environment. The trusted execution environment node obtains the initial contract state from the blockchain, decrypts and executes the privacy smart contract within the trusted hardware, and updates the latest state after execution to the blockchain in an encrypted manner.

[0069] Trusted Execution Environment Owner: It can control the server where the trusted execution environment nodes are located. The trusted execution environment nodes participate as nodes in the distributed system of the trusted execution environment. While being responsible for the entire life cycle of the trusted execution environment, they also need to maintain communication with the states of other nodes and safeguard the security and liveness of the distributed system of the trusted execution environment.

[0070] Distributed Trusted Execution Environment (TEE) System Administrator: Maintains the node list of the distributed trusted execution environment system and the information of the trusted execution environment instances in the nodes. It has permissions related to system configurations such as node management (including exit and join).

[0071] Blockchain Administrator: When the blockchain is a consortium blockchain or a permissioned blockchain, the blockchain administrator can be one or a group of users, and has permissions related to system configurations such as managing the exit and join of blockchain nodes.

[0072] Challenger: The challenger initiates challenges to the remote authentication of the trusted execution environment and verifies the signature returned by the trusted execution environment through the remote verification service. Among them, the privacy data owner can also act as the challenger.

[0073] Remote Verification Service Administrator: It maintains the remote verification service and allows the challenger to verify the identity and integrity of the trusted execution environment.

[0074] In the embodiments of the present invention, the distributed execution environment security deletion system applicable to privacy smart contracts includes 4 major component modules, among which:

[0075] Distributed Trusted Execution Environment System: Represented by D. D consists of multiple trusted execution environment nodes. Figure 2 An example of four nodes is shown and represented by N1, N2, N3, and N4. Then D is overall described as D = {N1, N2, N3, N4}. D achieves state consistency among nodes through a consensus algorithm. Nodes provide trusted execution environment services externally. The trusted hardware therein includes the private code and private data in the trusted execution environment instances, as well as non-trusted software outside the trusted execution environment instances. The trusted execution environment can instantiate multiple trusted execution environment instances, and the trusted execution environment nodes include at least one trusted execution environment instance. Figure 2 In it, N1 includes two trusted execution environment instances, E1 and E2.

[0076] Blockchain: Represented by B. B mainly provides an evidence storage service as persistent storage to ensure the integrity and immutability of data, and can be optionally a consortium blockchain or a permissioned blockchain. Figure 2 All the squares in the blockchain B represent the nodes on the blockchain.

[0077] Data Owner User Client: Represented by U. U is a system controlled by the private data owner, using the privacy smart contract services provided by the Trusted Execution Environment and the evidence storage services provided by B. U primarily includes three functions: initialization, contract execution, and result verification.

[0078] Remote Attestation Service: Represented by V. V can prove the identity of the trusted execution environment instance to the challenger by verifying the authentication of the trusted execution environment.

[0079] Figure 2 The main process of executing privacy smart contracts in the architecture is as follows: Figure 2 Numbers 1-10 in:

[0080] 1. U sends a request to initialize the trusted execution environment (TEE) to the trusted execution environment node. For example, N1, the request includes information related to the privacy contract. N1 initializes the privacy contract information into the trusted execution environment instance.

[0081] 2. N1 sends the initialization-related information to B, which creates the address and other information required for the initialization of the privacy contract and stores the initial state of the privacy smart contract.

[0082] 3. U, as the challenger, now initiates a remote authentication challenge to N1 to confirm the identity of the trusted execution environment instance in N1.

[0083] 4. The challenger obtains the authentication verification result of the information through V based on the response information to the challenge, such as the signature received from N1.

[0084] 5. U sends a privacy computing request to N1, which is a request to call the privacy smart contract.

[0085] 6. N1 obtains the initial contract state from the blockchain (other calls use the latest state of the current blockchain).

[0086] 7. After N1 completes the calculation of this privacy smart contract, it encrypts the latest contract status and sends it to B, completing the status update on B.

[0087] 8. U receives the result of the computation from N1. Optionally, N1 encrypts the result using U's public key (assuming N1 knows U's public key).

[0088] 9. U obtains the updated contract status from B and verifies the result.

[0089] 10. Other nodes N2, N3, and N4 in D synchronize the latest status from B respectively.

[0090] The embodiments of the present invention mainly describe a secure deletion system for a distributed execution environment applicable to privacy smart contracts, and this system is a system applicable to privacy smart contracts.

[0091] Figure 2 It is the overall architecture diagram of the secure deletion method for a distributed execution environment applicable to privacy smart contracts in the embodiments of the present invention. As Figure 2 shown, in addition to executing privacy smart contracts, each component module also needs to additionally execute deletion-related operations, where:

[0092] Distributed trusted execution environment system D: Its nodes are added with functions related to the deletion of the trusted execution environment, including functions such as deletion, generating deletion proofs, and storing and synchronizing deletion proofs.

[0093] Blockchain B: It is added with the part for storing deletion proofs.

[0094] Data owner client U: It is added with functions related to the deletion of the trusted execution environment.

[0095] Remote authentication service V: It is added with functions related to verifying deletion proofs.

[0096] Each participant adds a part related to the secure deletion of the trusted execution environment on the basis of the original execution of privacy smart contracts. Among them:

[0097] Privacy data owner: It sends a deletion request for the privacy data it owns when the operation in the trusted execution environment is completed or an exception occurs, and after receiving the deletion return information indicating successful deletion, it obtains the deletion proof from B and verifies it through V.

[0098] Trusted execution environment owner: After receiving the deletion request sent by the data owner, optionally, it forwards the deletion request among the nodes of the trusted execution environment. This deletion request is stored in D and maintained by the administrator of the distributed trusted execution environment system. The trusted execution environment completes the deletion operation, optionally, forwards the deletion return information among the nodes of the trusted execution environment, and stores it in D, which is maintained by the administrator of D. After successful deletion, the trusted execution environment generates a deletion proof and sends it to B for storage.

[0099] Administrator of the distributed trusted execution environment system: It maintains the deletion requests and deletion return information regarding the deletion of the trusted execution environment in the system. When all the instances of the trusted execution environment in the nodes are deleted, it can choose to perform the exit management of the nodes. Optionally, the relevant process of node exit is stored after consensus and the node list is maintained.

[0100] Blockchain administrator: No change.

[0101] Challenger: No change.

[0102] Remote verification service manager: It maintains a deletion proof verification service, allowing the challenger to complete the verification of the validity of the deletion proof.

[0103] Figure 2 Taking the deletion of E2 as an example, the steps of secure deletion are numbered 11 - 16, where:

[0104] 11. U sends a deletion request for the trusted execution environment to N1, requesting to delete the trusted execution environment instance E2. Optionally, forward this deletion request to other trusted execution environment nodes, and store it after consensus.

[0105] 12. N1 completes the deletion of the trusted execution environment instance E2 and generates a deletion proof, and then sends this deletion proof to B for evidence storage.

[0106] 13. N1 simultaneously returns the deletion return information of the trusted execution environment to U.

[0107] 14. U obtains the deletion proof from B according to the deletion return information.

[0108] 15. Optionally, other nodes N2, N3, and N4 in D synchronize the deletion proof of E from B and delete the status information of E2 according to the deletion proof.

[0109] 16. D performs verification of the deletion proof from V.

[0110] Figure 3 This is the technical architecture diagram of the secure deletion method for the distributed execution environment applicable to privacy smart contracts in the embodiments of the present invention, as Figure 3 shown, where:

[0111] D is composed of multiple trusted execution environment nodes, and achieves state consistency among the trusted execution environment nodes through a consensus algorithm. The trusted execution environment nodes provide trusted execution environment services externally. Taking N1 as an example, N1 is composed of three parts:

[0112] (1) Application: Represented by A. A includes a trusted execution environment instance (represented by E) for storing private contract data and code, a normal exit sensing module and an abnormal exit sensing module, a network and node management module related to the distributed system, a heartbeat mechanism and a daemon related to state sensing, and a blockchain client for interacting with B.

[0113] (2) Operating system kernel OS Kernel: Represented by OS. OS includes memory management related to the trusted execution environment, and memory-related operations corresponding to the life cycle such as initialization and deletion of the trusted execution environment.

[0114] (3) Instruction Set Architecture: Represented by ISA. ISA includes extended instructions related to generating deletion proofs, etc. For multiple trusted execution environments based on different instruction set architectures, separate adaptations are required.

[0115] U is controlled by the data owner, uses the services of the privacy smart contract provided by the trusted execution environment, and at the same time uses the evidence storage service provided by B. U consists of two parts:

[0116] (1) Core part: It provides the core functions related to the privacy smart contract, including initialization, privacy smart contract execution, trusted execution environment deletion, and verification mechanisms for the execution results and deletion proofs of the smart contract.

[0117] (2) Non-core part: It includes a heartbeat mechanism related to perception, timeout settings, a status table (represented by S1, S2, S3) for recording contract execution and deletion situations, and a blockchain client for interacting with B. The blockchain client includes functions such as sending transactions to B, obtaining relevant data from B, and listening to the status of B.

[0118] B mainly provides an evidence storage service for deletion proofs, etc., and is a consortium chain or a permissioned chain.

[0119] The secure deletion method proposed in the embodiments of the present invention mainly includes a heartbeat mechanism, trusted execution environment status perception (including normal exit and abnormal exit, this example takes normal exit as an example), trusted execution environment deletion and proof generation, and deletion proof verification when the trusted execution environment exits normally or abnormally. The following introduces this method in detail through Embodiment 1.

[0120] Embodiment 1:

[0121] I. Heartbeat mechanism

[0122] In one embodiment, the method further includes (executed by the trusted execution environment node):

[0123] After receiving the heartbeat data sent by the data owner client, if a heartbeat response is fed back to the data owner client U within a preset duration, it is determined that the trusted execution environment node is in a secure state; otherwise, it is determined that the trusted execution environment node is in a non-secure state, and the unresponsive information is fed back to the manager of the distributed trusted execution environment system D.

[0124] Among them, the data owner client U sends heartbeat data to each trusted execution environment node; the heartbeat mechanism between U and D is used to confirm that the system is in a normal running and secure state. Specifically, heartbeat detection is performed separately with each node {N = N1, N2, N3, N4} (optionally, the currently available distributed trusted execution environment nodes are obtained through the D manager), and then U selects a specific trusted execution environment node from the available node list (optionally, it can be randomly selected). In this embodiment, N1 is taken as an example. If a certain trusted execution environment node fails to feedback a heartbeat response within a preset duration, it indicates that there may be a problem and further detection may be required.

[0125] After U selects N1, relevant operations such as the initialization of the trusted execution environment instance E2 and the invocation and execution of the privacy smart contract are carried out.

[0126] II. Perception of the trusted execution environment status (including normal exit and abnormal exit, and this embodiment takes normal exit as an example);

[0127] In one embodiment, the data owner client is also used for:

[0128] Construct a call request for the privacy smart contract;

[0129] Sign the call request using a private key, where the private key corresponds to the public key of the distributed trusted execution environment system;

[0130] After serializing the call request group formed by the call request and the corresponding signature, a serialized call request group is obtained and sent to a trusted execution environment node;

[0131] Such as Figure 4 This is the flowchart for perceiving the normal exit status of the trusted execution environment in the embodiment of the present invention. Refer to Figure 4 , taking the perception of the trusted execution environment instance E2 as an example, the trusted execution environment node N1 includes at least one application A, and the application A is used for: deserializing the serialized signature group to obtain a call request group and performing checks. After the checks pass, it invokes the privacy contract to a trusted execution environment instance E2. After the invocation and execution are completed, the call execution result is obtained, and the encrypted call execution result is sent to the blockchain B for deposit. At the same time, it waits for the call execution receipt returned from the blockchain B, generates a call execution result based on the call execution receipt, and serializes it to generate a serialized call execution result, which is sent to the data owner client U;

[0132] The data owner client U is also used for: deserializing the serialized call execution result to obtain the call execution result; if the call execution result is successful and there are no other call requirements, determine that the status of the trusted execution environment instance E2 is a normal exit; update the exit status of the trusted execution environment instance E2 in the first status table.

[0133] Specifically, assume that operations such as the initialization of the trusted execution environment instance E2 have been completed. The perception of the normal exit state of the trusted execution environment is that after the execution of the privacy smart contract is completed and U has no other call requirements, the subsequent process deletes the relevant privacy data in the trusted execution environment.

[0134] First, U constructs a call request for the privacy smart contract and describes the request as Q1 = {Request_id, From_ip, To_ip, Private_en_id, Func_id, Parameters}.

[0135] Request_id: The call request number for this privacy smart contract.

[0136] From_ip: The network address of U (optionally filled in when forwarded by a node).

[0137] To_ip: The network address of the destination trusted execution environment node to be sent to.

[0138] Private_en_id: The trusted execution environment instance number in the node (optionally replaced by the same attribute value of the specific trusted execution environment, such as a measurement value, etc.), which can locate the privacy environment where the privacy smart contract is specifically executed. In this example, it is the number of the trusted execution environment instance E2.

[0139] Func_id: The function number (optionally replaced by the hash value of the function declaration), which can locate the specific function within the privacy smart contract.

[0140] Parameters: The function input parameters, the parameters of the function to be requested for execution.

[0141] Sig_user1: The signature of U, used to prove that U has the permission to call the privacy smart contract (recorded by the corresponding node when creating the trusted execution environment, optionally recorded in the privacy smart contract).

[0142] U signs the call request using the private key (the distributed trusted execution environment has the corresponding public key), and describes the signature process as Sig_user1 = sig(Private_U, Q1). The signature is intended to prove U's identity, and the trusted execution environment or the privacy smart contract determines whether it has the permission to call the smart contract through the signature. Then, U serializes the call request group {Q1, Sig_user1} formed by the call request Q1 and the corresponding signature to obtain the serialized call request group and sends it to N1.

[0143] Application A in N1 deserializes the received serialized call request group and parses out the call request group {Q1, Sig_user1}, and then performs some basic checks such as format. The specific check items are as follows:

[0144] Whether From_ip meets the network address format.

[0145] Whether Private_en_id meets the trusted execution environment instance number format and whether the number exists.

[0146] Whether Func_id meets the function number format.

[0147] Whether the Sig_user1 signature is correct and whether U has the permission to call the privacy contract.

[0148] If any of the above checks fails, the corresponding error message is returned to U. After the checks pass, the privacy contract is called to the trusted execution environment instance E2. Optionally, the call request is forwarded to other trusted execution environment nodes and stored after consensus. During the execution of the privacy contract in E2, there may be multiple mutual calls between the privacy contract and the public contract according to the specific program logic. When the current call is completed, the call execution result is obtained, and the encrypted call execution result is sent to the blockchain B for evidence storage, and at the same time, the call execution receipt returned by B is awaited (which is a transaction receipt, proving that B has generated a new block and the latest state has been successfully stored). After A receives the call execution receipt, it generates the call execution result (optionally encrypted by the trusted execution environment), and after serialization, it generates the serialized call execution result and sends it to the data owner client U. The call execution result is described as R1 = {Request_id, From_ip, To_ip, Success, Result}, and some of the attributes are described as follows:

[0149] Request_id: The number of the call request for this privacy smart contract.

[0150] From_ip: The network address of the trusted execution environment node.

[0151] To_ip: The network address of the destination user U.

[0152] Success: Boolean, true indicates successful execution, and false indicates failed execution.

[0153] Result: The execution result (optionally, the execution result is encrypted by a key negotiated with the user in advance).

[0154] After U deserializes the execution result of the serialized call and parses it into R1, it judges the Success field therein. If the Success field is true, it means that the execution of the smart contract in the trusted execution environment this time is completed. If there is no subsequent execution requirement, it successfully senses a normal exit. If the Success field is false, it means that the execution of the privacy contract call this time fails. U thus completes the state sensing of the normal exit and records it in the first state table S1 (if there are subsequent call requirements, S1 is not updated). The first state table is described as S1 = {Request_id, Private_en_id, TEE_ip, State_tee}, and some attribute descriptions are as follows:

[0155] Request_id: The number of the call request of the privacy smart contract this time.

[0156] Private_en_id: The instance number of the trusted execution environment used in this call.

[0157] TEE_ip: The network address of the trusted execution environment node used in this call.

[0158] State_tee: The state, which can be a normal exit or an abnormal exit.

[0159] After U updates S1, it completes the state sensing of E2. U asynchronously performs subsequent deletion operations according to the information in S1. Optionally, after the state sensing is completed (that is, after receiving R1 and judging it as a normal exit), subsequent deletion operations are performed synchronously.

[0160] III. Deletion of the trusted execution environment and generation of a deletion certificate;

[0161] In one embodiment, the data owner client is further used for:

[0162] After generating a deletion request for each queried trusted execution environment instance, sign the deletion request with a private key corresponding to the public key of the distributed trusted execution environment system;

[0163] After serializing the deletion request group formed by the deletion request and the corresponding signature, a serialized deletion request group is obtained;

[0164] Send the serialized deletion request group to a trusted execution environment node;

[0165] An application of the trusted execution environment node is used for: deserializing the serialized deletion request group to obtain a deletion request, checking the deletion request, and deleting the trusted execution environment instance after passing the check.

[0166] In one embodiment, the trusted execution environment node further includes an operating system kernel and an instruction set architecture;

[0167] The application is also used for: after the deletion request is checked and passed, constructing a new deletion request according to the deletion request and sending it to the operating system kernel;

[0168] The operating system kernel is used for: when it is determined according to the new deletion request that the application has the permission to call the deletion instruction, and no other application is using the memory space of the trusted execution environment instance to be deleted, and the memory space is not locked, triggering the deletion instruction of the trusted execution environment instance of the instruction set architecture;

[0169] The instruction set architecture is used for: executing the deletion instruction, deleting the trusted execution environment instance involved in the new deletion request, and feeding back the deletion result to the operating system kernel;

[0170] The operating system kernel is also used for: if it is determined that the deletion is successful according to the received deletion result, triggering the instruction set architecture to delete the extension instruction;

[0171] The instruction set architecture is also used for: executing the deletion extension instruction, signing the deletion result to form a deletion result signature, and feeding it back to the operating system kernel;

[0172] The operating system kernel is also used for: constructing a deletion certificate according to the received deletion result signature.

[0173] In one embodiment, the operating system kernel is also used for: sending the deletion certificate to the application;

[0174] The application is also used for:

[0175] Constructing a deletion transaction according to the received deletion certificate;

[0176] Sending the deletion transaction to the blockchain for evidence storage, and waiting for the deletion transaction receipt of the blockchain;

[0177] Generating deletion return information according to the deletion result and the deletion transaction receipt;

[0178] Sending the deletion return information to the data owner client U.

[0179] Specifically, U can periodically query the first status table S1 and trigger the deletion of the trusted execution environment instance and the generation of the deletion certificate. For example, Figure 5 is the flowchart of the deletion of the trusted execution environment instance and the generation of the deletion certificate in the embodiment of the present invention. U queries the trusted execution environment instance with the exit status recorded in S1 as normal exit, constructs a deletion request for a trusted execution environment instance, and describes the request as Q2 = {Request_id, Private_en_id, TEE_ip, Sig_user2}. Some attribute descriptions are as follows:

[0180] Request_id: The number of the deletion request for the current trusted execution environment instance.

[0181] Private_en_id: The number of the trusted execution environment instance used.

[0182] TEE_ip: The network address of the target trusted execution environment node.

[0183] Sig_user2: The signature of U, used to prove that the user has the permission to delete the trusted execution environment (recorded by the corresponding node when creating the trusted execution environment instance).

[0184] U uses the private key (corresponding to the public key of the distributed executable environment) to sign the deletion request. Describe the signature process as Sig_user2 = sig(Private_U, Q2). The signature aims to prove U's identity, and the trusted execution environment determines whether it has the permission to delete the trusted execution environment through the signature. After that, U serializes the deletion request group {Q2, Sig_user2} formed by the deletion request and the corresponding signature to obtain a serialized deletion request group, and sends it to the trusted execution environment node corresponding to TEE_ip, which is N1 in this embodiment.

[0185] The application A in N1 deserializes the received serialized deletion request group and parses out {Q2, Sig_user2}, and then performs some basic checks such as format. The specific check items are as follows:

[0186] Whether TEE_ip meets the network address format and whether it is the local host address.

[0187] Whether Private_en_id meets the trusted execution environment instance number format and whether the number exists.

[0188] Whether Sig_user2 indicates that the user U has the permission to delete the trusted execution environment.

[0189] If any of the above checks fails, the corresponding error message is returned to U. After the check passes, A constructs a new deletion request using some fields in Q2, described as Q3 = {Request_id, Private_en_id}. A sends Q3 to the OS in N1, and optionally forwards the new deletion request to other trusted execution environment nodes for storage after consensus.

[0190] After the OS in N1 receives the new deletion request Q3, it determines whether A has the permission to call the deletion instruction. At the same time, it ensures that no other application is using the memory space (page) related to the trusted execution environment instance to be deleted, and the memory space is not locked (if the above two validations are not performed, subsequent deletions will fail). After the above judgments are passed, the deletion instruction of the corresponding trusted execution environment instance of the ISA is triggered (corresponding to the deletion life cycle of the trusted execution environment, generally the instruction set architecture includes instructions with corresponding functions, and is called by the system software with appropriate permissions). The ISA executes the deletion instruction to delete the trusted execution environment instance E involved in the new deletion request. If the execution fails, a hardware error is triggered. After the deletion instruction is completed, the deletion result is returned to the OS, and the deletion result is described as R2 = {Request_id, Private_en_id, Success}, and some attribute descriptions are as follows:

[0191] Request_id: The deletion request number of the current trusted execution environment instance.

[0192] Private_en_id: The trusted execution environment instance number used.

[0193] Success: Whether the deletion is successful.

[0194] The OS judges the Success field of R2. If the Success field is false, corresponding exception handling is performed according to the error information triggered during the deletion process. If the Success field is true, the deletion extension instruction SIG_REMOVE of the ISA is triggered. The deletion extension instruction SIG_REMOVE includes a check on whether the privacy environment number is deleted, confirms the deletion situation in the signature request, and calls the general signature service to sign the deletion result (optionally, the SIG_REMOVE instruction internally calls the deletion-related instruction and signs the returned deletion result).

[0195] The deletion extension instruction signs the deletion result, reusing the private key of the remote authentication function in the general trusted execution environment (this private key is usually generated inside the trusted execution environment instance and remains confidential during the life cycle of the trusted execution environment instance). After signing, the deletion result signature is formed, and the formed deletion result signature Signature is returned to the OS. The deletion result signature is described as Signature = sig(Private_attestation, Private_en_id, Success).

[0196] The OS constructs a deletion proof based on the received Signature and sends it to Application A. The deletion proof is described as Proof_remove = {Private_en_id, Success, Signature}, and some of its attributes are described as follows:

[0197] Private_en_id: The instance number of the trusted execution environment used.

[0198] Success: Whether the deletion was successful.

[0199] Signature: The signature of the deletion result.

[0200] After receiving Proof_remove, A constructs a deletion transaction for the blockchain with this deletion proof as the transaction payload and sends it for notarization of Proof_remove at B. A waits for the deletion transaction receipt returned by B (this deletion transaction receipt proves that B has generated a new block and the latest status has been successfully notarized), and then generates deletion return information with the deletion result and the transaction ID in the deletion transaction receipt. The deletion return information is described as R3 = {Request_id, Private_en_id, Success, Tx_id, Proof_remove} (obtaining the deletion proof by querying from B, and optionally returning the deletion proof Proof_remove together), and some of its attributes are described as follows:

[0201] Request_id: The deletion request number for the current trusted execution environment instance.

[0202] Private_en_id: The instance number of the trusted execution environment to be deleted.

[0203] Success: The deletion result of the trusted execution environment instance.

[0204] Tx_id: The transaction number, used to query the deletion proof from B later.

[0205] After receiving the deletion return information R3 from A, U stores it in the second status table S2. The second status table is described as S2 = {Request_id, Private_en_id, Tx_id, Proof_remove, State_remove}, and some of its attributes are described as follows:

[0206] Request_id: The deletion request number for the current trusted execution environment instance.

[0207] Private_en_id: The instance number of the trusted execution environment to be deleted.

[0208] Tx_id: Transaction ID, used to query the deletion proof from B later.

[0209] Proof_remove: Deletion proof, initially empty.

[0210] State_remove: Deletion status, optional values are deletion success and deletion failure.

[0211] After U updates the second status table S2, the deletion of E2 and the declaration of the deletion proof are completed. U asynchronously performs subsequent deletion proof verification operations based on the information in S2. Optionally, after the trusted execution environment instance deletion and proof generation are completed (i.e., after receiving R3 and determining it as deletion success), subsequent deletion proof verification operations are performed synchronously.

[0212] IV. Deletion Proof Verification

[0213] In one embodiment, the data owner client is used for:

[0214] After obtaining the deletion proof of the trusted execution environment instance with successful deletion from the blockchain, constructing a remote verification request and sending it to the remote verification service, so that the remote verification service, upon receiving the remote verification request, parses out the deletion proof and verifies the validity of the signature of the deletion result signature group in the deletion proof, obtains the verification result, and returns the verification result to the data owner client;

[0215] After receiving the verification result R4, updating the verification status of the trusted execution environment instance E in the third status table according to the verification result.

[0216] Figure 6 This is the flowchart for verifying the deletion proof in the embodiment of the present invention. U reads the list of successful deletions from the second status table S2 and processes them sequentially. For the deletion proof that needs to be verified after the trusted execution environment is successfully deleted, first read the Tx_id field in S2. U sends a request to obtain the deletion proof to B according to the information in the Tx_id field. This request is an access interface supported by B. B queries the corresponding deletion proof according to Tx_id and returns it to U. The data owner client U updates the received deletion proof to the Proof_remove field in S2.

[0217] U constructs a remote verification request Q4 according to Proof_remove, and describes this remote verification request as Q4 = {Request_id, Proof_remove}. After receiving the remote verification request, V parses the validity of the deletion result signature in the Proof_remove verification deletion proof, obtains the verification result R4, and returns it to U, and describes this verification result as R4 = {Request_id, Proof_remove, Success}. Where the Success field being true indicates that the deletion proof is valid, and the Success field being false means that the deletion proof is invalid.

[0218] After U receives the verification result R4, it records it in the third state table S3. Describe the third state table as S3 = {Request_id, Proof_remove, State_Attestation}, and the descriptions of some attributes are as follows:

[0219] Request_id: The deletion request number of the current trusted execution environment instance.

[0220] Proof_remove: Deletion proof.

[0221] State_Attestation: Without deletion proof, deletion proof is valid, and deletion proof is invalid.

[0222] In one embodiment, the trusted execution environment nodes in the distributed trusted execution environment system are integrated as nodes of the blockchain.

[0223] Specifically, Figure 7 This is the architecture diagram of the trusted execution environment node integrated as a node of the blockchain in the embodiment of the present invention. In this architecture, the distributed trusted execution environment system can reuse modules related to distributed systems such as consensus and network of the blockchain, and focus on providing trusted execution services. When a user uses a privacy smart contract, the trusted execution environment node is embedded in the process of the original blockchain system to replace the blockchain virtual machine. When the data owner client U calls a deletion request, it is also in the form of a transaction, and the deletion proof generated after the trusted execution environment is deleted is stored on the blockchain at the same time.

[0224] In one embodiment, the operating system kernel is further used for:

[0225] When, according to a new deletion request, it is determined that the application has the permission to call the deletion instruction, and no other application is using the memory space of the trusted execution environment instance to be deleted, and the memory space is not locked, delete the trusted execution environment instance involved in the new deletion request, generate a deletion result, sign the deletion result to form a deletion result signature, and construct a deletion proof according to the received deletion result signature.

[0226] Specifically, Figure 8 This is the timing diagram for the normal exit of the operating system kernel signature mode in the embodiments of the present invention. Figure 8 Taking the normal exit of the embodiment as an example, when the operating system kernel determines, according to the new deletion request Q3, that the application A has the permission to call the deletion instruction, and no other application is using the memory space of the trusted execution environment instance to be deleted, and the memory space is not locked, it directly deletes the trusted execution environment instance E involved in the new deletion request. After the deletion is completed, it directly performs signature by the operating system kernel and constructs a deletion proof. In this way, there is no need to adapt to the instruction architectures of multiple trusted execution environments, and there will be stronger compatibility. However, at the same time, since the signature is not performed inside the trusted execution environment, the security will be reduced, that is, the user needs to trust the operating system kernel side.

[0227] In one embodiment, the trusted execution environment node N1 is further configured to:

[0228] Synchronize the deletion proofs of the deleted trusted execution environment instances E from other trusted execution environment nodes in the blockchain B;

[0229] Delete the status information of the deleted trusted execution environment instance E according to the synchronized deletion proof.

[0230] Embodiment 2:

[0231] In this embodiment, the two processes of deleting the trusted execution environment and generating the deletion proof, and obtaining and verifying the deletion proof are the same as those in Embodiment 1, but the status awareness part is different.

[0232] In one embodiment, the application is further configured to: after the call request group passes the check, if the host of the distributed trusted execution environment system restarts, then restart the daemon process, and then restart the trusted execution environment instance, and obtain the call execution result after the trusted execution environment instance re-executes the privacy smart contract in the call request group;

[0233] The data owner client U is further configured to: if the call execution result is a failure, determine that the status of the trusted execution environment instance E is an abnormal exit; update the exit status of the trusted execution environment instance E in the first status table.

[0234] Specifically, Figure 9This is the abnormal exit timing diagram of the trusted execution environment instance in the embodiment of the present invention. This abnormal perception takes the host exception as an example. After the host restarts due to power failure or crashing and halting, the daemon process of the application will restart with the host. After the daemon process restarts, it will start and resume the execution of the trusted execution environment instance, and at the same time obtain the result of whether the trusted execution environment instance restarts successfully. The application returns this result to the data owner client U, and the data owner client U perceives the abnormal exit and records the status of the abnormal exit. Then it is the same as in Embodiment 1, and the subsequent process continues.

[0235] Embodiment 3:

[0236] In this example, the two processes of deleting the trusted execution environment and generating the deletion proof and obtaining and verifying the deletion proof are the same as those in Embodiment 1, but the status perception part is different.

[0237] In one embodiment, the data owner client U is further used for:

[0238] Listening to the node list of the distributed trusted execution environment system D, and when the node list changes, updating the exit status of the trusted execution environment instance E in the first status table.

[0239] Specifically, Figure 10 This is another timing diagram of the abnormal exit of the trusted execution environment instance in the embodiment of the present invention. This abnormal perception takes the node exit as an example. U listens to the latest node list of D. When the node where the trusted execution environment is located is removed by the D administrator from the latest node list, U perceives the abnormal state caused by the node exit and records the status of the abnormal exit. Then it is the same as in Embodiment 1, and the subsequent process continues. Optionally, a timeout period can be defined. If there is still a trusted execution environment that has not been deleted by U for the node to be exited after this timeout period, the D administrator makes a corresponding deletion request according to the recorded node list.

[0240] The embodiment of the present invention also proposes a secure deletion method for the distributed execution environment applicable to privacy smart contracts, which is applied to any trusted execution environment node in the distributed trusted execution environment system, and will not be elaborated here.

[0241] Figure 11 The flowchart of the secure deletion method for the distributed execution environment applicable to privacy smart contracts in the embodiment of the present invention includes:

[0242] Step 1101, receiving a deletion request, where the deletion request is generated by the data owner client for the obtained trusted execution environment instance after querying the first status table at the first preset moment and obtaining a trusted execution environment instance with a normal exit status;

[0243] Step 1102: Delete the trusted execution environment instance, obtain a deletion result, and generate a deletion proof.

[0244] Step 1103: Send the deletion proof to the blockchain for evidence storage.

[0245] Step 1104: Feed back the deletion return information composed of the deletion result of the trusted execution environment to the data owner client, so that the data owner client updates the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information, and queries the first status table at the second preset moment to obtain the trusted execution environment instance with the deletion status of successful deletion. After obtaining the deletion proof of the trusted execution environment instance E with successful deletion from the blockchain, call the remote verification service to verify the deletion proof.

[0246] An embodiment of the present invention also proposes a secure deletion device for a distributed execution environment applicable to privacy smart contracts, which is applied to any trusted execution environment node in the distributed trusted execution environment system and will not be elaborated here.

[0247] Figure 12 The structural schematic diagram of the secure deletion device for a distributed execution environment applicable to privacy smart contracts in an embodiment of the present invention includes:

[0248] A deletion request receiving module 1201, configured to receive a deletion request, where the deletion request is generated by the data owner client after querying the first status table at the first preset moment to obtain a trusted execution environment instance with a normal exit status.

[0249] A deletion module 1202, configured to delete the trusted execution environment instance, obtain a deletion result, and generate a deletion proof.

[0250] A deletion proof sending module 1203, configured to send the deletion proof to the blockchain for evidence storage.

[0251] A deletion return information sending module 1204, configured to feed back the deletion return information composed of the deletion result of the trusted execution environment to the data owner client, so that the data owner client updates the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information, and queries the first status table at the second preset moment to obtain the trusted execution environment instance with the deletion status of successful deletion. After obtaining the deletion proof of the trusted execution environment instance with successful deletion from the blockchain, call the remote verification service to verify the deletion proof.

[0252] An embodiment of the present invention also proposes another secure deletion method for a distributed execution environment applicable to privacy smart contracts, which is applied to the data owner client in the distributed trusted execution environment system and will not be elaborated here.

[0253] Figure 13 In an embodiment of the present invention, a flowchart of another secure deletion method for a distributed execution environment applicable to a privacy smart contract includes:

[0254] Step 1301: Query the first status table at a first preset moment to obtain a trusted execution environment instance with a normal exit status.

[0255] Step 1302: Generate a deletion request for each queried trusted execution environment instance and send it to the trusted execution environment node where the trusted execution environment instance is located, so that the trusted execution environment node deletes the trusted execution environment instance according to the received deletion request, obtains a deletion result, generates a deletion proof, sends the deletion proof to the blockchain for evidence storage, and feeds back deletion return information composed of the deletion results of the trusted execution environment.

[0256] Step 1303: Update the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information.

[0257] Step 1304: Query the first status table at a second preset moment to obtain a trusted execution environment instance with a deletion success status, obtain the deletion proof of the trusted execution environment instance with a deletion success from the blockchain, and then call the remote verification service to verify the deletion proof.

[0258] An embodiment of the present invention also proposes another secure deletion device for a distributed execution environment applicable to a privacy smart contract, which is applied to the data owner client in the distributed trusted execution environment system and will not be elaborated here.

[0259] Figure 14 In an embodiment of the present invention, a structural diagram of another secure deletion device for a distributed execution environment applicable to a privacy smart contract includes:

[0260] A trusted execution environment instance query module 1401, configured to query the first status table at a first preset moment to obtain a trusted execution environment instance with a normal exit status.

[0261] A deletion request generation module 1402, configured to generate a deletion request for each queried trusted execution environment instance and send it to the trusted execution environment node where the trusted execution environment instance is located, so that the trusted execution environment node deletes the trusted execution environment instance according to the received deletion request, obtains a deletion result, generates a deletion proof, sends the deletion proof to the blockchain for evidence storage, and feeds back deletion return information composed of the deletion results of the trusted execution environment.

[0262] The second status table update module 1403 is configured to update the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information;

[0263] The verification module 1404 is configured to query the first status table at a second preset moment to obtain the trusted execution environment instance with the deletion status of successful deletion, and after obtaining the deletion proof of the trusted execution environment instance E with successful deletion from the blockchain, call the remote verification service to verify the deletion proof.

[0264] In summary, the system, method, and device proposed in the embodiments of the present invention have the following beneficial effects:

[0265] 1. Solve the problem that when a distributed trusted execution environment instance is deleted, the data owner client cannot verify that the trusted execution environment has been deleted.

[0266] 2. Adopt the method of instruction set extension. Without affecting the original instruction set function of the trusted execution environment, a new extended instruction for signing the deletion result of the trusted execution environment instance is added, and this signature is used to generate the subsequent secure deletion proof of the trusted execution environment. Optionally, this method can be replaced by signing at the operating system kernel level, which can seamlessly be compatible with various trusted execution environment technologies based on different instruction set architectures.

[0267] 3. By generating a deletion proof after the trusted execution environment instance is deleted, the user (i.e., the privacy data owner) can confirm that the trusted execution environment instance to be deleted has been securely deleted by verifying the deletion proof.

[0268] 4. Two types of distributed trusted execution environment state perception mechanisms are proposed. The two types of states include the normal exit state of the trusted execution environment node after completing the computing task and the abnormal exit state of the trusted execution environment node caused by situations such as host power-off and node exit. The user (i.e., the privacy data owner) can select the secure deletion of the trusted execution environment at an appropriate time according to the perceived state.

[0269] 5. It can be applied to privacy smart contract architectures of different technical types. The distributed trusted execution environment system acts as an independent system to execute privacy smart contracts. Optionally, the distributed trusted execution environment system can also be integrated into the blockchain node as a part of the blockchain system.

[0270] The embodiments of the present invention also provide a computer device, Figure 15A schematic diagram of a computer device in an embodiment of the present invention. The computer device 1500 includes a memory 1510, a processor 1520, and a computer program 1530 stored on the memory 1510 and executable on the processor 1520. When the processor 1520 executes the computer program 1530, the above-mentioned secure deletion method for a distributed execution environment applicable to privacy smart contracts is implemented.

[0271] An embodiment of the present invention also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned secure deletion method for a distributed execution environment applicable to privacy smart contracts is implemented.

[0272] An embodiment of the present invention also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the above-mentioned secure deletion method for a distributed execution environment applicable to privacy smart contracts is implemented.

[0273] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0274] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the specified functions in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0275] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implements the specified functions in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0276] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide for implementing the steps in the process Figure 1 one process or multiple processes and / or blocks Figure 1 steps of the functions specified in one block or multiple blocks.

[0277] The specific embodiments described above further elaborate on the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A secure deletion method for a distributed execution environment applicable to privacy smart contracts, characterized in that, Applied to any trusted execution environment node in a distributed trusted execution environment system, the method includes: Receiving a deletion request, which is generated by the data owner client after querying the first status table at a first preset moment to obtain a trusted execution environment instance with a normal exit status, and then generating a deletion request for the obtained trusted execution environment instance; Deleting the trusted execution environment instance, obtaining a deletion result, and generating a deletion proof; Sending the deletion proof to the blockchain for evidence storage; Feeding back deletion return information composed of the deletion result of the trusted execution environment to the data owner client, so that the data owner client can update the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information, and query the first status table at a second preset moment to obtain a trusted execution environment instance with a deletion status of successful deletion, and then call the remote verification service to verify the deletion proof after obtaining the deletion proof of the trusted execution environment instance with successful deletion from the blockchain.

2. The method according to claim 1, wherein It further includes: After receiving the heartbeat data sent by the data owner client, if a heartbeat response is fed back to the data owner client within a preset duration, it is determined that the trusted execution environment node is in a safe state; Otherwise, it is determined that the trusted execution environment node is in an unsafe state, and the unresponsive information is fed back to the administrator of the distributed trusted execution environment system.

3. The method according to claim 1, characterized in that It further includes: Synchronizing the deletion proofs of other trusted execution environment nodes for the deleted trusted execution environment instances from the blockchain; Deleting the status information of the deleted trusted execution environment instance according to the synchronized deletion proof.

4. The method according to claim 1, characterized in that, The trusted execution environment node in the distributed trusted execution environment system is integrated as a node of the blockchain.

5. A secure deletion method for the distributed execution environment applicable to privacy smart contracts, characterized in that, Applied to the data owner client in a distributed trusted execution environment system, the method includes: Querying the first status table at a first preset moment to obtain a trusted execution environment instance with a normal exit status; Generating a deletion request for each queried trusted execution environment instance and sending it to the trusted execution environment node where the trusted execution environment instance is located, so that the trusted execution environment node can delete the trusted execution environment instance according to the received deletion request, obtain a deletion result, generate a deletion proof, send the deletion proof to the blockchain for evidence storage, and feed back the deletion return information composed of the deletion result of the trusted execution environment; Updating the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information; Querying the first status table at a second preset moment to obtain a trusted execution environment instance with a deletion status of successful deletion, and then calling the remote verification service to verify the deletion proof after obtaining the deletion proof of the trusted execution environment instance with successful deletion from the blockchain.

6. The method according to claim 5, wherein It further includes: Constructing a call request for the privacy smart contract; Signing the call request with a private key, where the private key corresponds to the public key of the distributed trusted execution environment system; After serializing the call request group formed by the said call request and the corresponding signature, a serialized call request group is obtained and sent to a trusted execution environment node, so that at least one application in the trusted execution environment node deserializes the serialized signature group, obtains the call request group and conducts an inspection. After the inspection passes, a privacy contract is called to a trusted execution environment instance. After the call execution is completed, a call execution result is obtained. The encrypted call execution result is sent to the blockchain for evidence storage. At the same time, wait for the call execution receipt returned by the blockchain, generate a call execution result according to the call execution receipt, and serialize it to generate a serialized call execution result, which is sent to the data owner client; Deserialize the serialized call execution result to obtain the call execution result; If the call execution result includes successful execution and no other call requirements, determine that the status of this trusted execution environment instance is normal exit; Update the exit status of this trusted execution environment instance in the first status table.

7. The method according to claim 6, wherein It also includes: If the call execution result is execution failure, determine that the status of this trusted execution environment instance is abnormal exit; Update the exit status of this trusted execution environment instance in the first status table.

8. The method according to claim 6, wherein It also includes: Monitor the node list of the distributed trusted execution environment system, and update the exit status of this trusted execution environment instance in the first status table when the node list changes.

9. The method according to claim 6, wherein It also includes: After generating a deletion request for each queried trusted execution environment instance, sign the deletion request with a private key, and the private key corresponds to the public key of the distributed trusted execution environment system; After serializing the deletion request group formed by the said deletion request and the corresponding signature, a serialized deletion request group is obtained; Send the serialized deletion request group to a trusted execution environment node, so that an application of the trusted execution environment node deserializes the serialized deletion request group to obtain a deletion request and then checks the deletion request. After the inspection passes, delete the said trusted execution environment instance.

10. The method according to claim 6, characterized in that, It also includes: After obtaining the deletion proof of the trusted execution environment instance with successful deletion from the blockchain, construct a remote verification request and send it to the remote verification service, so that the remote verification service, upon receiving the remote verification request, parses out the deletion proof and verifies the validity of the signature of the deletion result signature group in the deletion proof to obtain a verification result, and returns the said verification result to the data owner client; After receiving the verification result, update the verification status of the trusted execution environment instance in the third status table according to the verification result.

11. A distributed execution environment security deletion device applicable to privacy smart contracts, characterized in that, Applied to any trusted execution environment node in the distributed trusted execution environment system, the device includes: A deletion request receiving module, configured to receive a deletion request, which is generated by the data owner client after querying the first status table at a first preset moment to obtain a trusted execution environment instance with a normal exit status; A deletion module, configured to delete the said trusted execution environment instance, obtain a deletion result, and generate a deletion proof; A deletion proof sending module, configured to send the said deletion proof to the blockchain for evidence storage; The deletion return information sending module is used to feedback the deletion return information composed of the deletion results of the trusted execution environment to the data owner client, so that the data owner client can update the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information, and query the first status table at the second preset moment to obtain the trusted execution environment instance with the deletion status of successful deletion. After obtaining the deletion proof of the trusted execution environment instance with successful deletion from the blockchain, it calls the remote verification service to verify the deletion proof.

12. A secure deletion device for a distributed execution environment applicable to privacy smart contracts, characterized in that, Applied to the data owner client in the distributed trusted execution environment system, the device includes: The trusted execution environment instance query module is used to query the first status table at the first preset moment to obtain the trusted execution environment instance with the exit status of normal exit; The deletion request generation module is used to generate a deletion request for each queried trusted execution environment instance and send it to the trusted execution environment node where the trusted execution environment instance is located, so that the trusted execution environment node can delete the trusted execution environment instance according to the received deletion request, obtain the deletion result, generate a deletion proof, send the deletion proof to the blockchain for deposit, and feedback the deletion return information composed of the deletion results of the trusted execution environment; The second status table update module is used to update the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information; The verification module is used to query the first status table at the second preset moment to obtain the trusted execution environment instance with the deletion status of successful deletion. After obtaining the deletion proof of the trusted execution environment instance with successful deletion from the blockchain, it calls the remote verification service to verify the deletion proof.

13. A distributed execution environment security deletion system applicable to privacy smart contracts, characterized in that, Including a distributed trusted execution environment system, a data owner client, a remote verification service, and a blockchain; the distributed trusted execution environment system includes at least one trusted execution environment node; The data owner client is used to query the first status table at the first preset moment to obtain the trusted execution environment instance with the exit status of normal exit, generate a deletion request for each queried trusted execution environment instance, and send it to the trusted execution environment node where the trusted execution environment instance is located; The trusted execution environment node is used to delete the trusted execution environment instance according to the received deletion request, obtain the deletion result, and generate a deletion proof; Send the deletion proof to the blockchain for deposit; Feedback the deletion return information composed of the deletion results of the trusted execution environment to the data owner client; The data owner client is used to update the deletion status of the trusted execution environment instance in the second status table according to the received deletion return information; query the first status table at the second preset moment to obtain the trusted execution environment instance with the deletion status of successful deletion, and send the deletion proof of the trusted execution environment instance with successful deletion obtained from the blockchain to the remote verification service; The remote verification service is used to verify the received deletion proof and return the verification result to the data owner client.

14. The system according to claim 13, wherein The data owner client is also used for: Construct a call request for the privacy smart contract; Sign the call request using the private key corresponding to the public key of the distributed trusted execution environment system; After serializing the call request group formed by the call request and the corresponding signature, obtain a serialized call request group and send it to a trusted execution environment node; The trusted execution environment node includes at least one application, and the application is used for: deserializing the serialized signature group, obtaining the call request group and performing checks, after passing the checks, calling a privacy contract from a trusted execution environment instance, after the call execution is completed, obtaining the call execution result, sending the encrypted call execution result to the blockchain for evidence storage, while waiting for the call execution receipt returned from the blockchain, generating a call execution result based on the call execution receipt, and serializing to generate a serialized call execution result and sending it to the data owner client; The data owner client is also used for: deserializing the serialized call execution result to obtain the call execution result; if the call execution result includes successful execution and no other call requirements, determine that the status of the trusted execution environment instance is normal exit; update the exit status of the trusted execution environment instance in the first status table.

15. The system according to claim 14, wherein The trusted execution environment node also includes an operating system kernel and an instruction set architecture; The application is also used for: after passing the check on the deletion request, constructing a new deletion request according to the deletion request and sending it to the operating system kernel; The operating system kernel is used for: when, according to the new deletion request, it is determined that the application has the permission to call the deletion instruction, and no other application is using the memory space of the trusted execution environment instance to be deleted, and the memory space is not locked, triggering the deletion instruction of the trusted execution environment instance of the instruction set architecture; The instruction set architecture is used for: executing the deletion instruction, deleting the trusted execution environment instance involved in the new deletion request, and feeding back the deletion result to the operating system kernel; The operating system kernel is also used for: if it is determined that the deletion is successful according to the received deletion result, triggering the deletion extension instruction of the instruction set architecture; The instruction set architecture is also used for: executing the deletion extension instruction, signing the deletion result to form a deletion result signature group, and feeding it back to the operating system kernel; The operating system kernel is also used for: constructing a deletion proof according to the received deletion result signature group.

16. The system according to claim 15, wherein, The operating system kernel is also used for: When, according to the new deletion request, it is determined that the application has the permission to call the deletion instruction, and no other application is using the memory space of the trusted execution environment instance to be deleted, and the memory space is not locked, deleting the trusted execution environment instance involved in the new deletion request, generating a deletion result, signing the deletion result to form a deletion result signature group, and constructing a deletion proof according to the received deletion result signature group.

17. The system according to claim 15, wherein The operating system kernel is also used for: sending the deletion proof to the application; The application is also used for: Constructing a deletion transaction according to the received deletion proof; Sending the deletion transaction to the blockchain for evidence storage, and waiting for the deletion transaction receipt of the blockchain; Generating deletion return information according to the deletion result and the deletion transaction receipt; Sending the deletion return information to the data owner client.

18. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the method according to any one of claims 1 to 10 is implemented.

19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.

20. A computer program product, characterized in that, The computer program product includes a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.