CN-122020712-A - Power data safe sharing method and system based on zero knowledge proof
Abstract
The invention provides a method and a system for safely sharing electric power data based on zero knowledge proof, which relate to the technical field of data processing and comprise the steps of receiving electric power intelligent contracts and executing input data, constructing an execution result containing state change after local execution, and capturing a calculation track; the method comprises the steps of constructing an arithmetic circuit structure based on a calculation track to generate a polynomial constraint system, deriving a promise value and generating a zero knowledge proof, injecting the proof and the result into a verification node for verification, and copying an execution result to a distributed account book after the verification is passed to form a contract credible execution closed loop. The invention ensures the privacy protection and execution correctness of the electric power data sharing process and improves the system reliability.
Inventors
- WANG SINING
- Xia Baobing
- HAN YUXIN
- ZHANG JIE
- ZHAO ZHENXIA
- ZHANG LUFENG
- WANG YAQIAN
Assignees
- 北京国网信通埃森哲信息技术有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260122
Claims (10)
- 1. The power data safe sharing method based on zero knowledge proof is characterized by comprising the following steps: receiving an electric power intelligent contract to be executed and corresponding execution input data thereof, reconstructing transaction rules and state conversion logic related in the electric power intelligent contract, and performing local execution operation on the execution input data based on the transaction rules and the state conversion logic; Constructing an arithmetic circuit structure based on the projection of the calculation track, and tracing the arithmetic circuit structure to generate a polynomial constraint system; Deriving a promise value based on the polynomial constraint system, and weaving with the promise value and a random challenge value to generate a zero knowledge proof capable of proving the correctness of the execution process; the zero knowledge proof and the corresponding execution result link are injected into a verification node, and the verification node performs proof verification according to the promise value and the execution correctness verification condition; After the verification node completes the verification and passes the verification, the execution result mirror image is copied to a distributed account book, and the state evolution of the electric power intelligent contract is activated in a cascading manner to form a trusted execution closed loop of the electric power intelligent contract.
- 2. The method of claim 1, wherein receiving a power smart contract to be executed and corresponding execution input data thereof, reconstructing transaction rules and state transition logic involved in the power smart contract, and performing local execution operations on the execution input data based on the transaction rules and state transition logic comprises: Receiving code representation and execution input data of an electric power intelligent contract to be executed, analyzing the code representation to extract transaction rules and state conversion logic, carrying out validity check on the execution input data based on the transaction rules, and determining an execution branch of the state conversion logic according to a check result; And according to a state change path indicated by the execution branch, applying the state transition logic to the execution input data, gradually completing the local execution operation and generating an execution track containing a state evolution process.
- 3. The method of claim 1, wherein constructing an execution result including a state change record from the locally executed operation while capturing a computation trace generated during the execution operation, constructing an arithmetic circuit structure based on the computation trace projection, and generating a polynomial constraint system based on the arithmetic circuit structure trace source comprises: Tracking each state change operation in the local execution operation, deeply deconstructing a state identifier and a change value related to the state change operation, correlating the state identifier and the change value to form a state change record, and constructing an execution result; capturing an operand, an operation type and an operation output of each atomic operation in the local execution operation while tracking the state change operation, and reorganizing the operand, the operation type and the operation output into calculation tracks according to an execution dependency relationship; Performing space projection on the calculation track, reconstructing the operation type to be defined as an arithmetic gate type, dynamically converting the operand and the operation output into an input port and an output port, and constructing an arithmetic circuit structure according to the execution dependency relationship; And recursively restoring and deducing algebraic constraint expressions between the input port and the output port according to each arithmetic gate type in the arithmetic circuit structure, and reconstructing a polynomial form, and tracing and merging all polynomial forms to generate a polynomial constraint system.
- 4. The method of claim 3, wherein spatially projecting the computation trace, defining the operation type reconstruction as an arithmetic gate type, dynamically enforcing the operand and the operation output as an input port and an output port, and constructing an arithmetic circuit structure based on the execution dependency relationship comprises: establishing a mapping rule from the calculated track to a circuit representation space, performing space projection on the calculated track according to the mapping rule, and projecting operation types in the calculated track into an arithmetic gate type set; identifying an operation type corresponding to each atomic operation in the calculation track, selecting an arithmetic gate type semantically equivalent to the operation type from the arithmetic gate type set according to the mapping rule, and completing reconstruction definition from the operation type to the arithmetic gate type; Extracting an operand and an operation output associated with the atomic operation, dynamically converting the operand into an input port of the arithmetic gate type, and dynamically converting the operation output into an output port of the arithmetic gate type; analyzing the execution dependency relationship recorded in the calculation track, determining the data dependency direction between the arithmetic gate types according to the execution dependency relationship, and establishing a connection line between the output port of the arithmetic gate type and the input port of the subsequent arithmetic gate type based on the data dependency direction to construct an arithmetic circuit structure.
- 5. The method of claim 1, wherein deriving a commitment value based on the polynomial constraint system and generating a zero-knowledge proof capable of proving correctness of the execution process using the commitment value and a random challenge value weave, wherein injecting the zero-knowledge proof and its corresponding execution result link into a verification node, and performing proof verification by the verification node according to the commitment value and the execution correctness verification condition comprises: performing promise operation on a constraint polynomial in the polynomial constraint system to generate promise values for hiding specific coefficients of the constraint polynomial; capturing an externally provided random challenge value, embedding and fusing the random challenge value into the constraint polynomial, and calculating an evaluation result of the constraint polynomial at the random challenge value; And carrying out association binding on the zero knowledge proof and the execution result, mapping and implanting the bound data into a verification node, constructing a verification equation based on the promise value and the execution correctness verification condition, and completing the correctness verification of the zero knowledge proof by solving the verification equation.
- 6. The method of claim 1, wherein after the authentication node completes attestation authentication and passes authentication, mirroring the execution result to a distributed ledger and cascading to activate state evolution of the power smart contract, forming a trusted execution closed loop of the power smart contract comprises: After the verification node completes the correctness verification of the zero knowledge proof, judging that the verification result meets the execution correctness verification condition, marking the verification passing, and generating a verification certificate containing the hash abstract of the execution result; starting a mirror image copying process based on the verification certificate, converting a state change record in the execution result into a block data format, and mirror-copying the block data format to a distributed account book through a consensus protocol of the distributed account book; After the distributed account book completes the consensus confirmation of the block data format, positioning a state storage position of the electric power intelligent contract based on the state identifier according to the changed state value and the state identifier contained in the state change record, and writing the changed state value into the state storage position; And updating the current state of the electric power intelligent contract after the writing of the changed state value is completed, cascading and activating a subsequent contract execution flow, and establishing an association relation between the verification certificate, the storage position of the execution result and the updated current state of the electric power intelligent contract and recording the association relation in the distributed account book to form a trusted execution closed loop.
- 7. The method of claim 6, wherein initiating a mirror copy flow based on the validation script, converting a state change record in the execution result to a block data format, and mirror copying the block data format to a distributed ledger via a consensus protocol of the distributed ledger comprises: after the verification certificate is judged to be effective, extracting a state change record in an execution result, carrying out serialization processing on the state change record and attaching signature information of the verification certificate to generate a block data format; The block data format is packaged into a data packet to be recognized, the data packet to be recognized is broadcast to a common node set in a distributed account network through a common protocol of the distributed account, and common verification is carried out on the data packet to be recognized by the common node set; And generating a consensus confirmation result after finishing the consensus verification according to the consensus node set, writing the block data format into a storage layer of the distributed account book based on the consensus confirmation result, and finishing mirror image replication.
- 8. A power data secure sharing system based on zero knowledge proof for implementing the method of any of the preceding claims 1-7, comprising: The system comprises a first unit, a second unit and a third unit, wherein the first unit is used for receiving an electric power intelligent contract to be executed and corresponding execution input data thereof, reconstructing transaction rules and state conversion logic related in the electric power intelligent contract, and carrying out local execution operation on the execution input data based on the transaction rules and the state conversion logic; the second unit is used for constructing an execution result containing a state change record according to the local execution operation, and capturing a calculation track generated in the execution operation process; The third unit is used for deriving a promise value based on the polynomial constraint system, and weaving the promise value and a random challenge value to generate zero knowledge proof capable of proving the correctness of the execution process; and the fourth unit is used for copying the execution result mirror image to the distributed account book after the verification node completes the verification and passes the verification, and cascading and activating the state evolution of the electric power intelligent contract to form a trusted execution closed loop of the electric power intelligent contract.
- 9. An electronic device, comprising: A processor; A memory for storing processor-executable instructions; Wherein the processor is configured to invoke the instructions stored in the memory to perform the method of any of claims 1 to 7.
- 10. A computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of any of claims 1 to 7.
Description
Power data safe sharing method and system based on zero knowledge proof Technical Field The invention relates to a data processing technology, in particular to a method and a system for safely sharing electric power data based on zero knowledge proof. Background As power systems evolve towards intelligent, informative directions, secure sharing and trading of power data is becoming increasingly important. In a traditional power system, data interaction among all parties mainly depends on a centralized platform for management, and with the rise of novel power system architectures such as distributed energy sources, smart grids and the like, the sharing requirement of power data is remarkably increased. The intelligent electric power contract is used as an automatically executed computer protocol, can automatically execute the contracted operation when the preset condition is met, and provides technical support for the scenes such as data transaction, energy transaction and the like in the electric power market. However, in the process of sharing electric power data, both ensuring correct execution of transaction rules and protecting data privacy of participants are required, which puts higher demands on the technology of secure sharing of electric power data. The traditional power data sharing mechanism lacks an effective execution process verification means, and is difficult to prove that the execution result of the intelligent contract truly follows a preset transaction rule, and transaction disputes and trust crisis are easily caused. Each participant cannot confirm whether the system is executing according to the agreed rules, and especially in the case of sensitive data, it is more difficult to establish a trust mechanism. The problem of insufficient data privacy protection generally exists in the power data sharing method in the prior art, and the original data of the participants often need to be exposed in the process of executing the contract, so that sensitive power data is exposed, and the depth and breadth of multiparty data collaboration are limited. Particularly when business secret or critical infrastructure data is involved, participants often are reluctant to share data due to privacy concerns. Disclosure of Invention The embodiment of the invention provides a method and a system for safely sharing electric power data based on zero knowledge proof, which can solve the problems in the prior art. In a first aspect of the embodiment of the present invention, a method for securely sharing power data based on zero knowledge proof is provided, including: receiving an electric power intelligent contract to be executed and corresponding execution input data thereof, reconstructing transaction rules and state conversion logic related in the electric power intelligent contract, and performing local execution operation on the execution input data based on the transaction rules and the state conversion logic; Constructing an arithmetic circuit structure based on the projection of the calculation track, and tracing the arithmetic circuit structure to generate a polynomial constraint system; Deriving a promise value based on the polynomial constraint system, and weaving with the promise value and a random challenge value to generate a zero knowledge proof capable of proving the correctness of the execution process; the zero knowledge proof and the corresponding execution result link are injected into a verification node, and the verification node performs proof verification according to the promise value and the execution correctness verification condition; After the verification node completes the verification and passes the verification, the execution result mirror image is copied to a distributed account book, and the state evolution of the electric power intelligent contract is activated in a cascading manner to form a trusted execution closed loop of the electric power intelligent contract. Receiving an electric power intelligent contract to be executed and corresponding execution input data thereof, reconstructing transaction rules and state conversion logic related in the electric power intelligent contract, and carrying out local execution operation on the execution input data based on the transaction rules and the state conversion logic, wherein the steps comprise: Receiving code representation and execution input data of an electric power intelligent contract to be executed, analyzing the code representation to extract transaction rules and state conversion logic, carrying out validity check on the execution input data based on the transaction rules, and determining an execution branch of the state conversion logic according to a check result; And according to a state change path indicated by the execution branch, applying the state transition logic to the execution input data, gradually completing the local execution operation and generating an execution track containing a state evolution proce