A trusted, private, verifiable and traceable data flow method applied in a network environment composed of a data provider, a cloud service provider, n oracles, a data user, a trusted execution environment, wherein n is an integer greater than 1, a privacy smart contract and a blockchain platform, wherein the data flow method is carried out according to the following steps:
- step 1, system initialization:
- step 1.1, selecting t oracles from the n oracles as committee oracles respectively, and the t oracles jointly initialize the blockchain platform, comprising:
- setting up a consensus mechanism of the blockchain platform;
- and
- the i-th committee oracle generates an i-th asymmetric encryption key pair, an i-th signature key pair and an i-th accountable threshold signature (ATS) key pair;
- step 1.2, the cloud service provider initializes a proxy processor, the trusted execution environment, and the privacy smart contract, comprising:
- setting a cloud service blockchain wallet, generating a remote authentication key pair of the trusted execution environment, an asymmetric encryption key pair of the trusted execution environment, a signature key pair of the trusted execution environment, and establishing an index structure;
- the privacy smart contract registers with any one of the committee oracles to obtain a trusted verifiable computation key pair and a watermark key;
- step 1.3, the data user generates a data usage asymmetric key pair, obtains a digital certificate and an identity identifier after interacting with the committee oracle, and sets up a data usage blockchain wallet at the same time;
- step 1.4, the data provider generates a data providing asymmetric key pair and obtains a verifiable computation key pair after interacting with any one of the committee oracles;
- step 2, data collection:
- step 2.1, the data provider determines whether held real data belongs to computable data or traceable data;
- and if the held real data is the computable data, a private key in the verifiable computation key pair is used to perform a verifiable computation signature on the held real data to obtain a verifiable computation signature, then a public key in the asymmetric encryption key pair of the committee oracle is used to encrypt the held real data and the verifiable computation signature together to obtain the processed data;
- otherwise, the public key in the asymmetric encryption key pair of the committee oracle processor is used to directly encrypt the held real data to obtain the processed data;
- so as to send the processed data to the t committee oracles, respectively;
- step 2.2, the i-th committee oracle decrypts the received processed data by using a private key in the i-th asymmetric encryption key pair, so as to obtain the decrypted data, and verify an authenticity of the decrypted data;
- and if the decrypted data is authentic, the decrypted data is stored as a data record and a public key in the asymmetric encryption key pair of the trusted execution environment is used to perform secondary encryption on the decrypted data, and then a private key in the signature key pair in the committee oracle is used to sign the secondary encrypted data to obtain one-time signature data, and then a private key in the ATS signature key pair of the committee oracle is used to perform an ATS signature on the secondary encrypted data, thereby forming encrypted signature data together with the one-time signature data, and then sending the encrypted signature data to the cloud service provider;
- otherwise, the decrypted data is discarded;
- step 2.3, the cloud service provider verifies the encrypted signature data by using a public key in the signature key pair of the committee oracle;
- and if the verification is successful, the encrypted signature data is forwarded to the trusted execution environment, and after the trusted execution environment decrypts the encrypted signature data by using a private key in its own asymmetric encryption key pair, the real data is obtained and forwarded to the privacy smart contract;
- otherwise, the encrypted signature data is discarded;
- step 2.4, after receiving at least t pieces of real data, the privacy smart contract generates a data ATS aggregation signature and a data aggregation public key, and verifies the data ATS aggregation signature by using the data aggregation public key;
- and if the verification is successful, all real data is used to update the index structure, and all real data is returned to the trusted execution environment;
- otherwise, at least t pieces of real data is received again;
- step 2.5, the trusted execution environment encrypts and stores all real data, computes hash values of all real data at the same time, and signs the hash values using a private key in its own signature key pair, thereby returning the signature of the hash values and the hash values of all real data to the cloud service provider, so that a data uploading transaction is generated by the cloud service provider according to the signature of the hash values and the hash values of all real data, and is submitted to the blockchain platform;
- step 2.6, the blockchain platform verifies an authenticity of the data uploading transaction through the consensus mechanism;
- and if the data uploading transaction is authentic, the data uploading transaction is recorded;
- otherwise, the data uploading transaction discarded;
- step 3, data requesting:
- step 3.1, the data user first constructs a remote attestation generation request containing the digital certificate and the identity identifier and sends the remote attestation generation request to the trusted execution environment, and the trusted execution environment verifies the digital certificate and the identity identifier after receiving the remote attestation generation request;
- and if the verification is successful, a remote attestation is generated by using the remote authentication key pair of the trusted execution environment and is returned to the data user;
- otherwise, the remote authentication generation request is discarded;
- step 3.2, the data user verifies the remote attestation;
- and if the verification is successful, an original data request is generated according to its own required data and a computation method, and the original data request is encrypted by using the public key in the asymmetric encryption key pair of the trusted execution environment processor, so that a data request transaction containing the encrypted original data request is constructed, and is submitted to the blockchain platform through the data usage blockchain wallet;
- otherwise, the current data request process is ended;
- step 3.3, the block chaining platform verifies a validity of the data request transaction through the consensus mechanism, and if the verification is successful, a unique number of the data request transaction is generated and the encrypted original data request is extracted from the data request transaction, then a data request message containing the unique number and the encrypted original data request is constructed and sent to the cloud service provider;
- otherwise, the corresponding data request transaction is discarded;
- step 3.4, the cloud servicer verifies a validity of the data request message, and if the verification is valid, the data request message is forwarded to the trusted execution environment, and the original data request is obtained and forwarded to the privacy smart contract after the trusted execution environment decrypts the encrypted original data request in the data request message using the private key in its own asymmetric encryption key pair;
- step 3.5, the privacy smart contract determines whether the data requested by the data user itself is computable data or traceable data according to the original data request;
- and if the data is computable data, proceed to step 3.6;
- otherwise, proceed to step 3.7;
- step 3.6, after receiving the original data request representing the computable data, the privacy smart contract searches on the index structure to obtain the data required by the data user and computes the data required by the data user by using a computation method, so as to obtain a processing result and send the processing result to the trusted execution environment;
- step 3.7, after receiving the original data request representing the traceable data, the privacy smart contract uses the watermark key to perform watermark embedding to obtain watermark data, so as to return the watermark data as the processing result to the trusted execution environment;
- step 3.8, the trusted execution environment encrypts the processing result by using the public key in its own asymmetric encryption key pair and signs the encrypted processing result by using the private key in its own signature key pair, so that the encrypted and signed processing result is obtained and returned to the cloud service provider, and a data response transaction is constructed by the cloud service provider by using the encrypted and signed processing result, and is submitted to the blockchain platform through the cloud service blockchain wallet;
- step 3.9, the blockchain platform confirms a legality of the data response transaction through the consensus mechanism;
- and if the data response transaction is legal, the data response transaction is recorded;
- otherwise, the data response transaction is discarded;
- step 3.10, the data user queries the data response transaction from the blockchain platform and parses the data response transaction to obtain the encrypted and signed processing result;
- step 4, data tracing:
- step 4.1, when the traceable data is leaked, the data user generates a trace message based on the leaked traceable data, and the trace message is encrypted and then sent to the t committee oracle processors, respectively;
- step 4.2, after decrypting the encrypted trace message, the i-th committee oracle computes a partial sensitive hash of the leaked traceable data, and matches the partial sensitive hash of the leaked traceable data with the data record;
- and if all committee oracles match successfully, the trusted execution environment encrypts the trace message by using the public key in its own asymmetric encryption key pair to obtain the re-encrypted trace message, and sends the re-encrypted trace message to the cloud service provider;
- otherwise, the current trace process is ended;
- step 4.3, the cloud service provider verifies the re-encrypted trace message;
- and if the verification is successful, the re-encrypted trace message is forwarded to the trusted execution environment and is decrypted by the trusted execution environment to obtain the trace message, and the trace message is forwarded to the privacy smart contract processor;
- otherwise, the re-encrypted trace message is discarded;
- step 4.4, after receiving at least t trace messages, the privacy smart contract generates a trace ATS aggregate signature and a trace aggregate public key, and verifies the trace ATS aggregate signature by using the trace aggregate public key;
- and if the verification is successful, the watermark information is extracted from the trace message by using the watermark key and then returned to the trusted execution environment;
- the trusted execution environment generates a hash of the watermark information and signs the hash of the watermark information to obtain a watermark signature, thereby returning the watermark signature and the hash of the watermark information to the cloud service provider;
- step 4.5, the cloud service provider constructs a trace transaction by using the watermark signature and the hash of the watermark information and submits the trace transaction to the blockchain platform through the cloud service blockchain wallet;
- and
- step 4.6, the blockchain platform verifies an authenticity of the trace transaction through the consensus mechanism;
- and if the trace transaction is authentic, the trace transaction is recorded;
- otherwise, the trace transaction is discarded.