Privacy computing method and system with verifiable computing process and traceable original data
Through zero-knowledge proof and blockchain technology, the calculation process and original data in privacy computing are verified, ensuring the credibility of the calculation results and the authenticity of the data, and solving the problems of unverifiable calculation process and non-traceable data in privacy calculation. Achieving trusted execution of data transactions.
Patent Information
- Application Number
- CN202410970865.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-19
AI Technical Summary
In privacy computing, the problems of unverifiable computing processes and untraceable original data result in data users being unable to ensure the credibility of calculation results and the authenticity of data, which in turn affects the quality of multi-party privacy calculation results.
Using zero-knowledge proof technology and blockchain technology, by designing the zero-knowledge proof circuit and verification key corresponding to the calculation steps, the task initiator verifies the calculation proof of the computing power provider and the data proof of the data provider to ensure that the calculation process is consistent with the original The credibility of the data is verified and fees are locked on the blockchain through smart contracts to achieve trusted execution of data transactions.
It realizes the verifiability of the calculation process and the traceability of the original data, ensures the credibility of the privacy calculation results and the authenticity of the data, solves the problems of non-verification of the calculation process and non-traceability of the data in privacy calculations, and opens up the process of data transactions. The intermediate link solves the dispute of "pay first or calculate first".
Smart Images

Figure CN118520516B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security, and in particular to a privacy computing method and system with verifiable computing process and traceable original data. Background Art
[0002] In the scenario of shared circulation of data elements, privacy computing is an important technology to protect private data from being exposed and to achieve "data available but invisible". However, relying solely on privacy computing to realize data transactions is far from enough. Because in the case of "data available but invisible", the data users cannot verify the correctness of the data results because they do not participate in the data calculation process. In addition, the data users cannot obtain the original data and therefore cannot check the quality of the data, and thus cannot guarantee that the final calculation results are credible.
[0003] Specifically, the following problems may occur during the use of data: 1) concerns about privacy data exposure; 2) all parties use fake data to perform tasks; 3) data falsification is difficult to detect and prove. For example, the intermediate information exchanged by federated learning is highly condensed statistical information. The data lacks redundancy and interpretability, making it difficult to confirm whether these intermediate results are fake data. Even if falsification is discovered, it is difficult to distinguish whether it is malicious fake data or noise caused by random sampling. Privacy computing (including multi-party secure computing, trusted computing, and federated learning) can be applied to scenarios where data is available but invisible to solve the problem of data owners falsifying data and falsifying computing tasks.
[0004] The Chinese patent application with publication number CN114841363A discloses a privacy-preserving and verifiable federated learning method based on zero-knowledge proof, whose main steps include: the task publisher generates a proof generation key and a proof verification key, and sends the proof generation key to the task executor; the task executor completes training with local privacy data to obtain intermediate data; the task executor uses the execution result, the intermediate data of execution, and the proof generation key issued by the task publisher, and uses the proof generation algorithm of zero-knowledge proof to generate a zero-knowledge proof about the task execution process, and sends the execution result and the corresponding zero-knowledge proof back to the task publisher; the publisher uses the proof verification key, the execution result given by the executor, and the zero-knowledge proof, and uses the proof verification algorithm of zero-knowledge proof to verify the correctness of the execution result.
[0005] In this patent application, the task publisher mainly verifies the execution process of the task to the task executor. In order to prove the correctness of the task execution process without disclosing the privacy data of the task executor, the proof generation technology of zero-knowledge proof is used to generate zero-knowledge proof for the execution result and intermediate data of the task executor, and the proof verification technology of zero-knowledge proof is used by the task publisher to verify the proof, so as to verify that the task execution result is calculated through the given training task. This patent application does not clearly express whether the correctness of the execution process is the verification of the data used for execution, and the task publisher does not verify the data used by the task executor, but verifies whether the result sent back by the task executor is the execution of the task.
[0006] In privacy computing tasks, it is necessary to verify the correctness of the task, which can ensure that the task executor is trustworthy and the execution results and intermediate data sent back are valid. However, verifying the correctness of the task alone cannot ensure the authenticity and traceability of the data during the task execution. The task executor may use toxic data to perform the task, or hide and filter sensitive data to perform the task, which will inevitably reduce the quality of the multi-party privacy computing results. Summary of the invention
[0007] The technical problem to be solved by the present invention is: in view of the technical problems existing in the prior art, the present invention provides a privacy computing method and system with verifiable computing process and traceable original data, which uses zero-knowledge proof technology and blockchain technology to ensure that the computing process in privacy computing is verifiable and the original data is traceable without exposing the original data. A closed loop of data element sharing and circulation is formed, which realizes the simultaneous verifiability and credibility of computing and data in the scenario of "data available but invisible".
[0008] In order to solve the above technical problems, the technical solution proposed by the present invention is:
[0009] A privacy computing method with verifiable computing process and traceable original data includes the following steps:
[0010] The task initiator formulates the calculation steps, designs the first zero-knowledge proof circuit corresponding to the calculation steps, and generates the first verification key of the first zero-knowledge proof circuit. The computing power provider performs calculation analysis on the data provided by the data provider according to the calculation steps to obtain the calculation result, generates the calculation proof through the first zero-knowledge proof circuit, and then provides the calculation result and the calculation proof to the task initiator; the task initiator verifies the calculation proof through the first verification key.
[0011] The task initiator publishes the data requirements required for the calculation, designs a second zero-knowledge proof circuit corresponding to the data requirements, generates a second verification key for the second zero-knowledge proof circuit and a smart contract for this task, and deploys the second verification key and the smart contract on the blockchain. The data provider provides the data to the computing power provider according to the data requirements, generates a data proof through the second zero-knowledge proof circuit, and then provides the data proof to the task initiator; the task initiator verifies the data proof by calling the second verification key on the blockchain through the smart contract.
[0012] Further, after generating the first verification key of the first zero-knowledge proof circuit, it also includes: uploading the first verification key to the blockchain;
[0013] When the task initiator verifies the calculation proof through the first verification key, it includes: the task initiator obtains the first verification key from the blockchain and verifies the validity of the zero-knowledge proof Proof in the calculation proof.
[0014] Furthermore, it also includes: the task initiator pledges fees on the blockchain for data transactions;
[0015] After the task initiator obtains the first verification key from the blockchain to verify the calculation proof, it includes: if the verification is passed, the fee pledged by the task initiator is transferred to the computing power provider;
[0016] After the task initiator verifies the data proof through the second verification key on the blockchain, the following steps are included: if the verification is successful, the fee pledged by the task initiator is transferred to the data provider.
[0017] Furthermore, before the task initiator releases the data requirements required for calculation, it also includes: the data provider uploads the characteristics of each data to the blockchain;
[0018] When the task initiator calls the second verification key on the blockchain through a smart contract to verify the data proof, it includes: the task initiator takes the task number and the zero-knowledge proof Proof in the data proof as input parameters, calls the deployed smart contract to anchor the corresponding second verification key according to the task number and verifies the validity of the zero-knowledge proof Proof, and searches the blockchain for the data features corresponding to the public parameter file in the data proof. If there is a search result and the zero-knowledge proof Proof is valid, the data used for this privacy calculation is credible.
[0019] Further, if the calculation step is a calculation step of distributed joint computing, the secret input of the first zero-knowledge proof circuit includes the privacy data of the data provider, the public input of the first zero-knowledge proof circuit includes the computing node number of the computing power provider and the task number of the task initiator, the circuit calculation of the first zero-knowledge proof circuit includes the calculation of the intermediate process of the distributed joint computing, and the public output of the first zero-knowledge proof circuit includes the computing node number, the task number and the trusted proof mark of the computing process.
[0020] Furthermore, if the calculation step is a calculation step of federated learning, the secret input of the first zero-knowledge proof circuit includes the weight calculated in the previous round of federated learning, the public input of the first zero-knowledge proof circuit includes the computing node number of the computing power provider and the task number of the task initiator, and also includes the characteristics of the privacy data of the data provider, the circuit calculation of the first zero-knowledge proof circuit includes the calculation of the gradient value of the computing power provider in the last round of federated learning, and the public output of the first zero-knowledge proof circuit includes the data characteristics of the computing node number, task number, gradient value and weight calculated in the previous round.
[0021] Furthermore, the secret input of the second zero-knowledge proof circuit includes the privacy data of the data provider, the public input of the second zero-knowledge proof circuit includes the computing node number of the data provider and the task number of the task initiator, the circuit calculation of the second zero-knowledge proof circuit includes the calculation of the characteristics of each secret input, and the public output of the second zero-knowledge proof circuit includes the computing node number, task number and data characteristics.
[0022] Furthermore, the computation proof includes a zero-knowledge proof Proof and public parameters. The public parameters in distributed joint computing are trusted markers of the computation process, and the public parameters in federated learning are gradient values of the last round of training.
[0023] Furthermore, after the task initiator verifies the computational proof by using the first verification key, the following steps are also included:
[0024] If the calculation step is a distributed joint calculation step, after verification, the calculation results sent back by each computing power provider are aggregated and analyzed;
[0025] If the calculation step is a calculation step of federated learning, after verification, the model is updated with the gradient value to determine whether the global model converges, so that the federated learning task ends or the next round of training starts.
[0026] The present invention also proposes a privacy computing system with verifiable computing process and traceable original data, including:
[0027] The task initiator is used to formulate the calculation steps, design the first zero-knowledge proof circuit corresponding to the calculation steps, generate the first verification key of the first zero-knowledge proof circuit, publish the data requirements required for the calculation, design the second zero-knowledge proof circuit corresponding to the data requirements, generate the second verification key of the second zero-knowledge proof circuit and the smart contract of this task, and deploy the second verification key and the smart contract on the blockchain;
[0028] The computing power provider is used to perform computing analysis on the data provided by the data provider according to the computing steps to obtain a computing result, generate a computing proof through the first zero-knowledge proof circuit, and then provide the computing result and computing proof to the task initiator;
[0029] A data provider, configured to provide data to a computing power provider according to the data requirements, generate a data proof through a second zero-knowledge proof circuit, and then provide the data proof to a task initiator;
[0030] The task initiator is also used to verify the calculation proof through the first verification key, and to verify the data proof by calling the second verification key on the blockchain through the smart contract.
[0031] Compared with the prior art, the advantages of the present invention are:
[0032] 1. This invention uses zero-knowledge proof technology to design a set of verifiable computing process methods. The task initiator uses a zero-knowledge proof circuit to express the computing process that needs to be verified; the computing power provider generates a zero-knowledge proof Proof accordingly; the task initiator verifies the validity of the zero-knowledge proof through a verification key, that is, verifies whether the zero-knowledge proof is generated using a circuit, and whether the result of the zero-knowledge proof expresses a credible computing step, thereby verifying the credibility of the computing process. This solves the problem that the computing process of privacy computing cannot be verified.
[0033] 2. This invention uses zero-knowledge proof technology to design a set of original data verifiable methods. The task initiator expresses the original data verification method through a zero-knowledge proof circuit; the data provider uses a zero-knowledge proof protocol and tool to generate a zero-knowledge proof Proof; the task initiator verifies the validity of the zero-knowledge proof through a blockchain smart contract, that is, verifies whether the zero-knowledge proof is generated using a circuit and whether it is valid. The task initiator traces the data features output by the circuit through the blockchain to verify whether the original data used in the calculation is credible. This solves the problem of the original data being untraceable in privacy computing.
[0034] 3. The present invention uses zero-knowledge proof technology to implement transaction verification that protects privacy in the privacy computing process. When the task initiator proposes a data transaction request (initiates a task), the fee is locked through the blockchain. After the calculation is completed, the technical steps and original data are judged to be credible based on the results of the verification proof based on zero-knowledge proof technology. After the verification is passed, the smart contract forces the fee to be transferred to the computing power provider or data provider. It opens up the intermediate links of the data user fee pledge and the data provider and computing power provider service provision in the privacy data transaction process, and solves the dispute of "pay first or calculate first" in the circulation and transaction of data elements. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is an overall flow chart of an embodiment of the present invention.
[0036] Figure 2 It is a timing diagram of the proof generation and verification process of the computing process in an embodiment of the present invention.
[0037] Figure 3 Schematic diagram of a zero-knowledge proof circuit for a distributed joint computing process in an embodiment of the present invention.
[0038] Figure 4 Schematic diagram of a zero-knowledge proof circuit for a federated learning computing process in an embodiment of the present invention.
[0039] Figure 5 It is a timing diagram of the original data trusted tracing process in an embodiment of the present invention.
[0040] Figure 6 Schematic diagram of a zero-knowledge proof circuit for original data verification in an embodiment of the present invention.
[0041] Figure 7 This is a schematic diagram of a blockchain-based data transaction model constructed in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The present invention is further described below in conjunction with the accompanying drawings and specific preferred embodiments, but the protection scope of the present invention is not limited thereby.
[0043] Before introducing the specific embodiments of the present invention, related concepts are first explained.
[0044] Zero-knowledge proof technology:
[0045] Zero-Knowledge Proof (ZKP) is a cryptographic concept used to prove the correctness of a statement without revealing any specific information about the statement. In a zero-knowledge proof, the prover (usually a computer program) tries to prove to the verifier that a certain assertion is true, and the verifier only gets the correctness of the proof without any other information about the assertion.
[0046] The core idea of zero-knowledge proof is that through a mutual interaction process, the prover can prove to the verifier that he has some specific information without revealing this information directly to the verifier. In this process, the prover uses some special protocols and algorithms to generate the proof and ensure that the verifier can verify the validity of the proof, but cannot obtain any information about the proof.
[0047] Zero-knowledge proofs are used in many fields, including cryptography, security protocols, blockchain, etc. It can be used to solve some privacy and security issues, such as identity authentication, anonymous transactions, data privacy, etc. By using zero-knowledge proofs, the correctness of an assertion can be proved to other parties without leaking sensitive information, thereby improving privacy protection and security.
[0048] Blockchain Technology:
[0049] Blockchain is a chain database consisting of multiple data blocks linked together and jointly built and maintained by computing nodes in a distributed peer-to-peer network. Currently, blockchain technology has integrated many cutting-edge technologies such as distributed network technology, consensus algorithm, smart contract technology, and cryptographic algorithm, and has the following characteristics:
[0050] The blockchain is immutable. The modification of one block of data will lead to a drastic change in all subsequent block data, and this change cannot form a new consensus in the distributed network;
[0051] A non-completely centralized organizational method. A distributed peer-to-peer network maintained by a consensus algorithm breaks through the current Internet’s absolute authoritative model of centralized control;
[0052] Openness and privacy. The cryptographic and signature algorithms include the privacy of user data, while also ensuring the openness of desensitized data. Therefore, blockchain technology is the optimal solution for many scenarios where multiple parties are involved and a trust mechanism needs to be established.
[0053] Embodiment 1
[0054] In traditional data analysis and calculation, the task initiator uses its own computing power to analyze and calculate the data strictly according to the calculation steps it has formulated. In privacy computing, the computing power is not provided by the task initiator. The task initiator can only obtain the results after each computing node executes the calculation process, and the task initiator cannot effectively supervise and verify the calculation process, so the task initiator cannot guarantee that the calculation results are credible.
[0055] In traditional data analysis and calculation, the task initiator can obtain the original data, perform quality inspection on the data, and perform calculations to obtain the results. The results obtained in this way are credible to the task initiator. In privacy computing, the original data is not provided by the task initiator. The task initiator can only obtain the results after the calculation is executed. The task initiator cannot know whether the data used by the data provider in the task is its real data, and the data used in the task cannot be traced. Therefore, the results obtained by the calculation are unreliable.
[0056] In order to solve the above problems, this embodiment proposes a privacy computing method with verifiable computing process and traceable original data. It adopts zero-knowledge proof technology. The privacy computing platform (task initiator) designs the calculation steps (i.e., the circuit in the zero-knowledge proof) and generates a verification method; the data provider / computing power provider generates a corresponding proof based on the zero-knowledge proof circuit during the calculation process, and then provides the proof to the task initiator; the task initiator verifies the proof of the data provider / computing power provider according to the verification method. If the computing power provider fails to strictly follow the technical steps, i.e., the circuit, or the data provider fails to generate the zero-knowledge proof Proof as required, the proof verification fails.
[0057] like Figure 1 As shown, the privacy computing method of this embodiment involves two processes: the proof and verification process of the calculation steps in the privacy computing process under the scenario of open sharing of data elements, and the proof and verification process of the original data used in the privacy computing. The following describes these two processes respectively:
[0058] The proof and verification process of the calculation steps is as follows Figure 1As shown in the right half, the task initiator formulates the calculation steps, designs the zero-knowledge proof circuit corresponding to the calculation steps (referred to as the first zero-knowledge proof circuit for distinction in this embodiment), and generates a verification key for the first zero-knowledge proof circuit (referred to as the first verification key for distinction in this embodiment). The computing power provider strictly follows the calculation steps during the calculation process, and generates a calculation proof according to the circuit. Specifically, the data provided by the data provider is analyzed and calculated according to the calculation steps to obtain the calculation result, and the calculation proof is generated through the first zero-knowledge proof circuit, and then the calculation result and the calculation proof are provided to the task initiator; the task initiator verifies the calculation proof through the first verification key. If the computing power provider fails to strictly follow the technical steps, i.e., the circuit, the verification fails.
[0059] The original data certification and verification process is as follows Figure 1 As shown in the left half, the task initiator publishes the data requirements required for the calculation, designs a zero-knowledge proof circuit corresponding to the data requirements (referred to as the second zero-knowledge proof circuit for distinction in this embodiment), generates a verification key for the second zero-knowledge proof circuit (referred to as the second verification key for distinction in this embodiment) and a smart contract for this task, deploys the second verification key and the smart contract on the blockchain, and the data provider provides the data to the computing power provider according to the data requirements, generates a data proof through the second zero-knowledge proof circuit, and then provides the data proof to the task initiator; the task initiator calls the second verification key on the blockchain through the smart contract to verify the data proof. If the data provider fails to generate the zero-knowledge proof as required, the proof verification fails.
[0060] The calculation process mentioned in this embodiment refers to the process in which the computing power provider in federated learning and distributed joint computing uses the original data to perform analytical calculations. For example, in federated learning, each computing node is a computing power provider, and each task needs to be executed by the computing power provider for multiple rounds until the updated model finally converges after the task initiator aggregates the multi-party gradients. The calculation process of the computing power provider in federated learning refers to: after obtaining the model weights of the task initiator, training on local privacy data, obtaining updated gradient values and sending the gradient values back to the task initiator. For example, in distributed joint computing, the task initiator formulates the calculation steps of each case provider, that is, the computing node (for example, data cleaning, row merging, column merging, data standardization processing, data aggregation, etc.), and the computing node performs calculation analysis according to the calculation steps, and sends the results of the calculation analysis to the task initiator. The calculation process of the computing power provider in distributed joint computing refers to: the process of performing calculation analysis according to the calculation steps formulated by the task initiator.
[0061] The original data mentioned in this embodiment refers to the data required in federated learning and distributed joint computing. The data is provided by the data provider, and the data is private data that can only be owned and used by the data provider and cannot be obtained by other parties.
[0062] like Figure 1 As shown, in the proof and verification process of the calculation step, after generating the first verification key of the first zero-knowledge proof circuit, it also includes: uploading the first verification key to the blockchain; correspondingly, when the task initiator verifies the calculation proof through the first verification key, it includes: the task initiator obtains the first verification key from the blockchain to verify the validity of the zero-knowledge proof Proof in the calculation proof. It should be noted that when the task initiator is the verifier, it has no motivation to cheat, and the completeness of the zero-knowledge proof technology can achieve trusted verification of the calculation process and original data even without the blockchain. In this case, the blockchain is not necessary in the proof and verification process of the calculation steps and the proof and verification process of the original data.
[0063] like Figure 2 As shown, in this embodiment, the proof and verification process of the calculation step specifically includes the following steps:
[0064] Step A1, the task initiator formulates the distributed computing rules for privacy computing, for example, specifying that the distributed joint computing task requires the computing nodes to perform data cleaning, row merging, column merging, averaging a column, obtaining the maximum (minimum) value of a column, and other computing steps, as well as the order of the computing steps; for example, specifying the modeling algorithm of federated learning, specifying feature extraction, missing value processing, feature normalization, feature encoding, feature selection and other feature engineering processing steps, and designing the gradient security aggregation process. The task initiator embeds the calculation process into the zero-knowledge proof circuit to obtain the first zero-knowledge proof circuit. In this embodiment, the zk-SNAKR protocol in the zero-knowledge proof is used to complete the relevant zero-knowledge proof design. Other protocols and tools for zero-knowledge proof can also achieve this purpose, which is not limited in this embodiment;
[0065] Step A2, the task initiator compiles the first zero-knowledge proof circuit into an R1CS constraint, and creates a proof generation key and a proof verification key (first verification key) for the first zero-knowledge proof circuit, wherein the proof generation key is used by the data provider or the computing power provider to generate the zero-knowledge proof Proof and public parameters (public parameters are specified in the zero-knowledge proof circuit). In this embodiment, the circom compiler in the zero-knowledge proof is used to compile the first zero-knowledge proof circuit. Other protocols and tools for zero-knowledge proof can also achieve this purpose, which is not limited in this embodiment;
[0066] Step A3: The task initiator publishes the verification key and task number to the blockchain for evidence storage, thereby building a trust system without trusted third parties through the blockchain. The verification key and task number are first stored in the blockchain, and when the verification is proved, the verification key is removed from the blockchain. Because the data on the blockchain cannot be tampered with, the authenticity and credibility of the verification key are guaranteed. If the verifier is the task initiator, the blockchain role can be omitted, and the verification key can be saved by the task initiator.
[0067] Step A4: The task initiator sends the intermediate code of the calculation steps and the zero-knowledge proof circuit to each computing power provider (computing node);
[0068] Step A5: The computing power provider calculates and analyzes the data according to the calculation steps to obtain the final result, and uses the data required for each calculation step as the secret input of the first zero-knowledge proof circuit, and generates a witness file (witness.wtns) through the zero-knowledge proof circuit intermediate encoding;
[0069] Step A6, the computing power provider uses the proof generation key of the first zero-knowledge proof circuit to generate a zero-knowledge proof Proof and a public parameter as a computing proof for the computing process. In the distributed joint computing, the public parameter is a trusted mark of the computing process. The trusted mark of the computing process is an integer value, marking whether the computing power provider strictly follows the computing steps to perform the calculation. 1 means that the computing process is credible, otherwise it is untrustworthy. The public parameter in federated learning is the gradient value of the last round of training. The task initiator will update the model according to the gradient value to determine whether the global model converges.
[0070] Step A7: The computing power provider sends the calculation results, zero-knowledge proof and public parameters to the task initiator.
[0071] Step A8, the task initiator obtains the first verification key of the corresponding first zero-knowledge proof circuit from the blockchain according to the task number;
[0072] In step A9, the task initiator uses the first verification key, public parameters, and zero-knowledge proof Proof of the first zero-knowledge proof to verify whether the proof is valid. If valid, it means that the computing power provider has strictly performed the calculation analysis in accordance with the calculation rules of the task initiator, and the calculation process is credible.
[0073] After the task initiator verifies the zero-knowledge proof Proof, the next business processing of privacy computing can be carried out. If it is a joint analysis computing scenario (that is, the calculation steps of proof and verification are the calculation steps of distributed joint computing), after verification, the data sent back by each computing power provider (that is, the calculation results) will be aggregated and analyzed; if it is a federated learning scenario (that is, the calculation steps of proof and verification are the calculation steps of federated learning), after verification, the gradient value will be used to update the model to determine whether the global model converges, so that the federated learning task ends or the next round of training starts.
[0074] In this embodiment, the proof and verification process of the calculation steps is based on a zero-knowledge proof circuit system. The steps in the calculation process and the requirements for intermediate results are expressed through the circuit system. Next, the design of the zero-knowledge proof circuit (i.e., the first zero-knowledge proof circuit) for proof and verification in the privacy calculation process is described in detail.
[0075] Zero-knowledge proof can be abstracted into the components of input, circuit calculation and public output, where input is divided into secret input and public input (input visible to the outside world). In response to the two scenarios of "data available but invisible", zero-knowledge proof circuits for distributed joint computing processes and zero-knowledge proof circuits for federated learning are designed respectively. The purpose of the two types of designs is to allow the computing power provider to input secret input and public input (computing node number) and obtain output according to the circuit requirements (computation steps set by the task provider). The output allows the task initiator to verify the validity without knowing the secret input of the computing power provider.
[0076] Zero-knowledge proof circuit for distributed joint computing process Figure 3 As shown in the figure, the proof object is the computing power provider, the verifier is the task initiator, and the proof content is the calculation steps of distributed joint computing. The designed zero-knowledge proof includes:
[0077] (1) Input design
[0078] The input of the distributed joint computing zero-knowledge proof circuit is the private data, computing node number and task number used for joint computing. Among them, the private data of the data provider is a secret input, that is, the input that cannot be obtained by any party through task means and media, and the input can only be used for circuit calculation; the computing node number and task number are public inputs, that is, the input will appear in the public.json file generated after the circuit is executed. The public output is used by the verifier to anchor the verification key on the blockchain, and then verify the validity of the zero-knowledge proof Proof.
[0079] (2) Design of circuit calculation
[0080] In view of the complex business and large amount of data in distributed joint computing, this embodiment will not embed the complete computing process into the computing circuit of zero-knowledge proof, because according to the current research results, the expression ability of the circuit system of any zero-knowledge proof tool is limited. The computing circuit designed in this embodiment is used to prove whether the intermediate process of the calculation meets the requirements of the task initiator. For example, a scenario of an economic development zone needs to calculate the per-mu profit within the jurisdiction of the economic development zone. The computing power provider in this demand is the parks within the jurisdiction. The parks calculate the per-mu profit based on their annual revenue and the area of the park. That is, the calculation steps are 1) the annual revenue of each department of the park is used as a secret input, 2) verify that the input value is not missing and has no singular values, 3) calculate the total annual revenue of each department, 4) calculate the result through the formula "per-mu profit = annual revenue / area of the park", then the circuit of zero-knowledge proof in this example includes steps 1), 2), 3), 4).
[0081] (3) Public output design
[0082] The circuit output of the distributed joint computing zero-knowledge proof includes the computing node number, task number and computing process trusted proof mark. Among them, the computing node number is used to verify the validity of the computing node providing the proof; the task number is used to anchor the verification key of the zero-knowledge proof Proof in the blockchain; the computing process trusted proof mark is used to express to the task initiator that the computing power provider has completed the calculation strictly in accordance with the steps it has established; the verification key downloaded from the blockchain can prove the validity of the zero-knowledge proof Proof, that is, the zero-knowledge proof Proof is generated by the circuit designed by the computing task initiator.
[0083] To summarize, if the computational steps of proof and verification are computational steps of distributed joint computing, the secret input of the first zero-knowledge proof circuit includes the privacy data of the data provider, the public input of the first zero-knowledge proof circuit includes the computing node number of the computing power provider and the task number of the task initiator, the circuit calculation of the first zero-knowledge proof circuit includes the calculation of the intermediate process of the distributed joint computing, and the public output of the first zero-knowledge proof circuit includes the computing node number, the task number and the computing process trusted proof mark.
[0084] Zero-knowledge proof circuit for federated learning computing process Figure 4 As shown, the proof object is the computing power provider, the verifier is the task initiator, and the proof content is that the gradient value contributed by the computing power provider can make the global model converge, and the gradient value is obtained through rounds of local training and model updates. The designed zero-knowledge proof includes input, circuit calculation and public output.
[0085] (1) Input design
[0086] The input of the federated learning zero-knowledge proof circuit is the privacy data features used for joint computing, the computing node number, the task number, and the weight of the previous round. Among them, the weight of the previous round is a secret input; the computing node number and the task number are public inputs, that is, the input will appear in the public.json file generated after the circuit is executed. The public output is used by the verifier to anchor the verification key on the blockchain, and then verify the validity of the zero-knowledge proof Proof; the privacy data features of the data provider are also public inputs, which will appear in the public.json generated after the circuit is executed, and are used to express that the model converges on the data desired by the task initiator.
[0087] (2) Design of circuit calculation
[0088] The circuit of the zero-knowledge proof of federated learning can be equivalently converted into a contribution proof of model convergence. Since the federated learning task is executed in rounds, the most direct verification process design is that the computing power provider generates a zero-knowledge proof for each round of calculation and submits it to the task initiator to prove that it has completed the calculation as required. However, the output of the computing power provider in each round of federated learning is an encrypted gradient value. If a zero-knowledge proof is generated for this gradient value, the entire process of security aggregation needs to be embedded in the circuit, which will cause the expression of the zero-knowledge proof to be too complicated, and the time and resources for proof generation are also high and the speed is very slow, and even the circuit system is unavailable. This embodiment does not require verification of the calculation process in every round. It only requires the computing power provider to submit a proof of model convergence in the last round of federated learning, as long as the final model converges and converges on the data required by the task initiator. In this way, during the entire task process, the computing power provider only needs to generate a zero-knowledge proof Proof once at the end and submit it to the task initiator, and the task initiator will verify whether it passes.
[0089] The method for judging the convergence of the global model is that the sum of the gradient values output by all computing power providers is less than a certain threshold. Therefore, the zero-knowledge proof generated by a single computing power provider cannot directly prove the convergence of the model. Therefore, it is necessary to publish the gradient value as a public output in the zero-knowledge proof. The task initiator obtains the gradient values of all computing power providers and sums them to determine whether the model has converged. Since only one round of zero-knowledge proof Proof is generated after the model converges, and only the gradient value of the last round is made public, the privacy data of the node will not be exposed.
[0090] (3) Public output design
[0091] The circuit output of the federated learning zero-knowledge proof includes the computing node number, task number, gradient value and the weight feature (hash value) of the previous round. Among them, the computing node number is used to verify the validity of the computing node providing the proof; the task number is used to anchor the verification key of the zero-knowledge proof Proof in the blockchain; the gradient value and the weight feature of the previous round are to provide the task initiator with a securely aggregated gradient value and to express that the global model converges on data that meets the requirements; the verification key downloaded from the blockchain can prove the validity of the zero-knowledge proof Proof, that is, the zero-knowledge proof Proof is generated by the circuit designed by the computing task initiator.
[0092] To summarize, if the computational steps of proof and verification are computational steps of federated learning computation, the secret input of the first zero-knowledge proof circuit includes the weight of the previous round of federated learning computation, the public input of the first zero-knowledge proof circuit includes the computing node number of the computing power provider and the task number of the task initiator, and also includes the characteristics of the privacy data of the data provider, the circuit calculation of the first zero-knowledge proof circuit includes the calculation of the gradient value of the computing power provider in the last round of federated learning, and the public output of the first zero-knowledge proof circuit includes the computing node number, task number, gradient value, and data characteristics of the weight of the previous round of calculation of the last round of federated learning.
[0093] like Figure 5 As shown, in this embodiment, the original data certification and verification process specifically includes the following steps:
[0094] Step B1: The data provider connects its own data to the privacy computing system (virtual access to data, the original data itself will not be stored in the privacy computing system), and uploads the characteristics of each piece of data (such as the summary calculated by SHA256) to the blockchain. That is, in the original data certification and verification process, before the task initiator releases the data requirements required for the calculation, it also includes: the data provider uploads the characteristics of each piece of data to the blockchain;
[0095] Step B2, the task initiator publishes the data requirements required for the calculation, for example, which parties' data are required for the calculation, what is the type of data source, and what are the target fields. The task initiator embeds the original data requirements into the zero-knowledge proof circuit to obtain a second zero-knowledge proof circuit. In this embodiment, the zk-SNAKR protocol in the zero-knowledge proof is used to complete the relevant zero-knowledge proof design. Other protocols and tools for zero-knowledge proof can also achieve this purpose, which is not limited in this embodiment.
[0096] Step B3, the task initiator compiles the zero-knowledge proof circuit into an R1CS constraint, and creates a proof generation key and a proof verification key (second verification key) for the circuit. In this embodiment, the circom compiler in the zero-knowledge proof is used to compile the second zero-knowledge proof circuit. Other protocols and tools of zero-knowledge proof can also achieve this purpose, which is not limited in this embodiment;
[0097] Step B4: The task initiator publishes the second verification key and task number to the blockchain for evidence storage, thereby building a trust system without trusted third parties through the blockchain. The verification key and task number are first stored in the blockchain. When the proof is to be verified, the blockchain verifies the validity of the zero-knowledge proof through a smart contract. Because the data on the blockchain cannot be tampered with, the authenticity and credibility of the verification key are guaranteed.
[0098] Step B5: The task initiator generates a smart contract for this task and deploys the smart contract on the blockchain. When the proof is verified, the smart contract will call the verification key on the chain to complete the verification of the zero-knowledge proof.
[0099] Step B6: The task initiator sends the data requirements and the intermediate code of the zero-knowledge proof circuit to each data provider (which can be the data source or the computing node attached to the source);
[0100] Step B7: The data provider provides the data to the computing power provider (in most scenarios, the data provider and the computing power provider are the same party), and inputs the private data into the second zero-knowledge proof circuit, and generates a knowledge witness file (witness.wtns) through the second zero-knowledge proof circuit.
[0101] Step B8, the data provider uses the proof generation key of the second zero-knowledge proof circuit to generate a zero-knowledge proof Proof and a public parameter (the public parameter is a feature of the input private data, which is calculated in the proof circuit) for the original data as data proof;
[0102] Step B9: The data provider sends the zero-knowledge proof Proof and public parameters to the task initiator;
[0103] Step B10: The task initiator uses the task number and zero-knowledge proof Proof as input parameters to call the smart contract deployed in the blockchain;
[0104] Step B11, the validity of the zero-knowledge proof Proof is verified by anchoring the corresponding second verification key according to the task number through the smart contract, and the data features in the public parameter file public.json are verified on the blockchain. In this embodiment, the specific verification method is to search for public data features on the blockchain. If the data feature verification passes, that is, the public data features have been uploaded to the chain and the zero-knowledge proof Proof is valid, then the data used for this privacy calculation is credible.
[0105] In this embodiment, the proof and verification process of the original data is also based on the zero-knowledge proof circuit system. The characteristics of the original data are expressed through the circuit system, and the characteristic values of the original data are used as circuit outputs. The design of the zero-knowledge proof circuit (i.e., the second zero-knowledge proof circuit) for proof and verification of original data in privacy computing is described in detail below.
[0106] The zero-knowledge proof circuit for original data proof verification in privacy computing is as follows Figure 6 As shown in the figure, the proof object is the data provider, the verifier is the task initiator, and the proof content is the original data of the data provider. The designed zero-knowledge proof includes:
[0107] (1) Input design
[0108] The input of the zero-knowledge proof circuit is the original data plaintext used for calculation, the computing node number and the task number. Among them, the original data is the private data provided only by the data provider. As a secret input, it is an input that cannot be obtained by any party through any means and media. This input can only be used for the calculation of data features in the circuit (data summary); the computing node number and task number are public inputs, that is, the input will appear in the public.json file generated after the circuit is executed. The public output is used to prove the verification of the smart contract anchor verification key, and then verify the validity of the proof.
[0109] (2) Design of circuit calculation
[0110] The proof circuit of the original data in privacy computing is relatively simple, that is, calculating the characteristics (hash value) of each secret input and using the characteristics as the public output of the circuit.
[0111] (3) Public output design
[0112] The circuit output of the zero-knowledge proof of the original data of the privacy computing includes the computing node number, task number and data features. Among them, the computing node number is used to verify the validity of the computing node providing the proof; the task number is used for the verification key of the smart contract to anchor the zero-knowledge proof Proof; the data features are used to express the original data used for privacy computing. During the verification process, the validity of the zero-knowledge proof Proof is first verified through the smart contract, and then the public data features are searched on the blockchain. If the zero-knowledge proof Proof is verified to be valid and the public data features have been uploaded to the chain, it proves that the data provider has performed privacy computing with the real data uploaded to the chain.
[0113] To summarize, the secret input of the second zero-knowledge proof circuit includes the original data, which is private data provided only by the data provider and cannot be obtained by other parties. The public input of the second zero-knowledge proof circuit includes the computing node number of the data provider and the task number of the task initiator. The circuit calculation of the second zero-knowledge proof circuit includes the calculation of the features of each secret input. The public output of the second zero-knowledge proof circuit includes the computing node number, task number and data features.
[0114] This embodiment also designs a privacy computing work proof and verification model around the above two processes, such as Figure 7 As shown in the figure, the task initiator and the data provider (computing power provider) respectively deploy blockchain nodes locally to form a blockchain network; when the task initiator initiates a calculation request, in addition to generating calculation rules, verifying the calculation process key on the chain, and verifying the original data key on the chain mentioned above, the task initiator also pledges the fees for data transactions on the blockchain. When the data provider (computing power provider) completes the calculation process, it provides the zero-knowledge proof Proof of the calculation process and the original data, and sends the proof to the task initiator after the calculation is completed; after receiving the zero-knowledge proof, the task initiator calls the smart contract to verify the zero-knowledge proof Proof. After the verification is passed, the smart contract transfers the fees pledged by the task initiator to the data provider (computing power provider). This model takes advantage of the characteristics of blockchain, that is, a weakly centralized trust system is established through consensus algorithms and smart contracts. After the proof is successfully verified, the smart contract method of fee transfer will be enforced.
[0115] Correspondingly, the privacy computing method of this embodiment further includes: the task initiator pledges the fees for data transactions on the blockchain;
[0116] After the task initiator obtains the first verification key from the blockchain to verify the calculation proof, it includes: if the verification is passed, the fee pledged by the task initiator is transferred to the computing power provider;
[0117] After the task initiator verifies the data proof through the second verification key on the blockchain, the following steps are included: if the verification is successful, the fee pledged by the task initiator is transferred to the data provider.
[0118] Embodiment 2
[0119] This embodiment proposes a privacy computing system with verifiable computing process and traceable original data, which corresponds to the first embodiment and includes a task initiator, a data provider and a computing power provider. The task initiator, the data provider and the computing power provider respectively deploy blockchain nodes locally to form a blockchain network, wherein:
[0120] The task initiator is used to formulate a calculation step, design a first zero-knowledge proof circuit corresponding to the calculation step, generate a first verification key for the first zero-knowledge proof circuit, and deploy the first verification key on the blockchain;
[0121] The task initiator is also used to publish the data requirements required for the calculation, design a second zero-knowledge proof circuit corresponding to the data requirements, generate a second verification key of the second zero-knowledge proof circuit and a smart contract for this task, and deploy the second verification key and the smart contract on the blockchain;
[0122] The computing power provider is used to perform computing analysis on the data provided by the data provider according to the computing steps to obtain a computing result, generate a computing proof through the first zero-knowledge proof circuit, and then provide the computing result and computing proof to the task initiator;
[0123] The data provider is used to provide the data to the computing power provider according to the data requirements, generate the data proof through the second zero-knowledge proof circuit, and then provide the data proof to the task initiator;
[0124] The task initiator is also used to obtain a first verification key verification calculation certificate from the blockchain, and call a second verification key verification data certificate on the blockchain through a smart contract.
[0125] In summary, the present invention provides a privacy computing method and system for data element circulation with verifiable computing process and traceable original data, which solves the following problems:
[0126] First, a trusted verification method for the computational process based on zero-knowledge proof is proposed. Before obtaining the data computation results, the data user needs to provide the computational steps and a set of zero-knowledge proof generation methods and result verification methods. When the data computation party completes the computation and delivers the computation results, it executes the generation method to generate the zero-knowledge proof, and the zero-knowledge proof and the computation results are sent together to the data user. The data user uses the verification method to verify the zero-knowledge proof data. If the verification is successful, it proves that the computational result is calculated according to the computational steps specified by the data user. This solves the problem that the computational process of privacy computing cannot be verified.
[0127] Secondly, a trusted tracing method for original data based on zero-knowledge proof is proposed. The privacy computing system designs the verification circuit for the original data. The user inputs the plaintext data into the circuit as a secret, and after the circuit operation, the relevant features and proof of the plaintext data are output. The data user extracts the original data features from the proof, and the proof data can prove that the calculation results obtained by the data user are calculated using the original data associated with these features, thereby realizing the tracing of the original data in privacy computing. The problem of the untraceability of original data in privacy computing is solved.
[0128] Third, a privacy computing proof and verification model based on blockchain was constructed. This model combines the global data management method, computing process verification technology, original data traceability technology and blockchain technology proposed in the present invention. It replaces the trusted third party in the data transaction link with blockchain, adopts consensus mechanism and smart contract to realize the cheat-free enforcement of data transaction rules, and adopts zero-knowledge proof technology to realize transaction verification that protects privacy in the privacy computing process. It opens up the intermediate links of fee pledge by data users and service provision by data providers and computing power providers in the privacy data transaction process, and solves the controversial issue of "pay first or calculate first" in the circulation and transaction of data elements.
[0129] The above is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment, it is not intended to limit the present invention. Therefore, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the content of the technical solution of the present invention shall fall within the scope of protection of the technical solution of the present invention.
Claims
1. A privacy computing method with verifiable computing process and traceable original data, characterized in that: The following steps are involved: The task initiator formulates the calculation steps, designs the first zero-knowledge proof circuit corresponding to the calculation steps, and generates the first verification key of the first zero-knowledge proof circuit. The computing power provider performs calculation analysis on the data provided by the data provider according to the calculation steps to obtain the calculation result, generates the calculation proof through the first zero-knowledge proof circuit, and then provides the calculation result and the calculation proof to the task initiator. The task initiator verifies the computation proof using the first verification key; The task initiator publishes the data requirements required for the calculation, designs a second zero-knowledge proof circuit corresponding to the data requirements, generates a second verification key for the second zero-knowledge proof circuit and a smart contract for this task, and deploys the second verification key and the smart contract on the blockchain. The data provider provides the data to the computing power provider according to the data requirements, generates a data proof through the second zero-knowledge proof circuit, and then provides the data proof to the task initiator; the task initiator verifies the data proof by calling the second verification key on the blockchain through the smart contract.
2. The privacy computing method with verifiable computing process and traceable original data according to claim 1, characterized in that: After generating the first verification key of the first zero-knowledge proof circuit, the method further includes: uploading the first verification key to the blockchain; When the task initiator verifies the calculation proof through the first verification key, it includes: the task initiator obtains the first verification key from the blockchain to verify the validity of the zero-knowledge proof Proof in the calculation proof.
3. The privacy computing method with verifiable computing process and traceable original data according to claim 1, characterized in that: Also includes: The task initiator pledges the fees for data transactions on the blockchain; After the task initiator obtains the first verification key from the blockchain to verify the calculation proof, it includes: if the verification is passed, the fee pledged by the task initiator is transferred to the computing power provider; After the task initiator verifies the data proof through the second verification key on the blockchain, the following steps are included: if the verification is successful, the fee pledged by the task initiator is transferred to the data provider.
4. The privacy computing method with verifiable computing process and traceable original data according to claim 1, characterized in that: Before the task initiator releases the data requirements for calculation, it also includes: the data provider uploads the characteristics of each data to the blockchain; When the task initiator calls the second verification key on the blockchain through a smart contract to verify the data proof, it includes: the task initiator takes the task number and the zero-knowledge proof Proof in the data proof as input parameters, calls the deployed smart contract to anchor the corresponding second verification key according to the task number and verifies the validity of the zero-knowledge proof Proof, and searches the blockchain for the data features corresponding to the public parameter file in the data proof. If there is a search result and the zero-knowledge proof Proof is valid, the data used for this privacy calculation is credible.
5. The privacy computing method with verifiable computing process and traceable original data according to claim 1, characterized in that: If the calculation step is a calculation step of distributed joint computing, the secret input of the first zero-knowledge proof circuit includes the privacy data of the data provider, the public input of the first zero-knowledge proof circuit includes the computing node number of the computing power provider and the task number of the task initiator, the circuit calculation of the first zero-knowledge proof circuit includes the calculation of the intermediate process of the distributed joint computing, and the public output of the first zero-knowledge proof circuit includes the computing node number, the task number and the trusted proof mark of the computing process.
6. The privacy computing method with verifiable computing process and traceable original data according to claim 1, characterized in that: If the calculation step is a calculation step of federated learning, the secret input of the first zero-knowledge proof circuit includes the weight calculated in the previous round of federated learning, the public input of the first zero-knowledge proof circuit includes the computing node number of the computing power provider and the task number of the task initiator, and also includes the characteristics of the privacy data of the data provider, the circuit calculation of the first zero-knowledge proof circuit includes the calculation of the gradient value of the computing power provider in the last round of federated learning, and the public output of the first zero-knowledge proof circuit includes the computing node number, task number, gradient value and data characteristics of the weight calculated in the previous round.
7. The privacy computing method with verifiable computing process and traceable original data according to claim 1, characterized in that: The secret input of the second zero-knowledge proof circuit includes the private data of the data provider, the public input of the second zero-knowledge proof circuit includes the computing node number of the data provider and the task number of the task initiator, the circuit calculation of the second zero-knowledge proof circuit includes the calculation of the characteristics of each secret input, and the public output of the second zero-knowledge proof circuit includes the computing node number, task number and data characteristics.
8. The privacy computing method with verifiable computing process and traceable original data according to claim 1, characterized in that: The computation proof includes a zero-knowledge proof Proof and public parameters. The public parameters in distributed joint computing are trusted markers of the computation process, and the public parameters in federated learning are the gradient values of the last round of training.
9. The privacy computing method with verifiable computing process and traceable original data according to claim 8, characterized in that: After the task initiator verifies the computational proof using the first verification key, it also includes: If the calculation step is a distributed joint calculation step, after verification, the calculation results sent back by each computing power provider are aggregated and analyzed; If the calculation step is a calculation step of federated learning, after verification, the model is updated with the gradient value to determine whether the global model converges, so that the federated learning task ends or the next round of training starts.
10. A privacy computing system with verifiable computing process and traceable original data, characterized in that: include: The task initiator is used to formulate the calculation steps, design the first zero-knowledge proof circuit corresponding to the calculation steps, generate the first verification key of the first zero-knowledge proof circuit, publish the data requirements required for the calculation, design the second zero-knowledge proof circuit corresponding to the data requirements, and generate the second verification key of the second zero-knowledge proof circuit; The computing power provider is used to perform computing analysis on the data provided by the data provider according to the computing steps to obtain a computing result, generate a computing proof through the first zero-knowledge proof circuit, and then provide the computing result and computing proof to the task initiator; A data provider, configured to provide data to a computing power provider according to the data requirements, generate a data proof through a second zero-knowledge proof circuit, and then provide the data proof to a task initiator; The task initiator is also used to verify the calculation proof through the first verification key and verify the data proof through the second verification key.
