Regional building group power transaction safety guarantee system
By constructing a trusted computing environment authentication module and employing asymmetric encryption and zero-knowledge proofs, the trustworthiness issue of off-chain computing processes was resolved, ensuring the security of regional building cluster power transactions, guaranteeing the correctness of calculation results and data confidentiality, and enhancing the system's security and fairness.
Patent Information
- Application Number
- CN202511517529.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-01-20
AI Technical Summary
In existing technologies for regional building cluster power trading, the reliability of off-chain computation processes is difficult to guarantee, and there is a risk of calculation errors or data tampering, which affects the fairness of the transaction and the security of the system.
By constructing a trusted computing environment authentication module, a transaction data encryption and commitment module, an off-chain privacy computing and verification module, and a computing process proof and settlement module, the traceability and verifiability of the off-chain computing environment are ensured. By utilizing blockchain record algorithm hash values and hardware remote authentication mechanisms, combined with asymmetric encryption and zero-knowledge proofs, a trusted closed loop of the end-to-end computing process is achieved.
It ensures the correctness of off-chain computation and the confidentiality of data, prevents data tampering and replay attacks, provides decentralized trust guarantees, and ensures the fairness of transactions and system security.
Smart Images

Figure CN121366041A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of power safety, in particular to a regional building group power transaction security guarantee system. BACKGROUND
[0002] The regional building group power transaction is a mode of integrating distributed photovoltaic, energy storage units and diversified power loads within a specific geographical range to realize on-site production, consumption and interaction of internal electric energy. This mode relies on a system that can safely and efficiently process transaction data of each participant to ensure the fairness of the transaction, the confidentiality of the data and the accuracy of the settlement. The core of the system is how to establish a trusted mechanism to process sensitive data such as bids and power consumption, and to execute market clearing and settlement.
[0003] To realize the transparency and automation of the transaction, the prior art scheme usually adopts blockchain technology. By deploying a smart contract, the settlement rules of the power transaction are chained, and the tamper-proof and decentralized characteristics of the blockchain are used to record the transaction results and automatically execute asset transfer. When dealing with complex calculations and private data, some schemes combine off-chain computing mode, i.e. shift the calculation-intensive tasks such as market clearing to off-chain servers for execution, and only submit the final settlement results to the blockchain for evidence and execution, in order to alleviate the performance bottleneck of the blockchain.
[0004] However, the above-mentioned technology scheme of shifting the calculation to the off-chain has the problem of insufficient reliability in guaranteeing the calculation process. The blockchain and its participants cannot effectively supervise the calculation process in the off-chain environment, and the correctness of the calculation result completely depends on the trust of the off-chain computing entity. There is a risk that the computing entity will execute incorrect algorithm logic or calculate based on incomplete or tampered data, and submit the incorrect result to the chain, while the on-chain smart contract cannot distinguish the authenticity, thereby damaging the fairness of the transaction and the overall security of the system. In view of this, we propose a regional building group power transaction security guarantee system. SUMMARY
[0005] In view of the deficiencies of the prior art, the present application provides a regional building group power transaction security guarantee system, which solves the problem that the computing entity may execute incorrect algorithm logic or calculate based on incomplete or tampered data.
[0006] To achieve the above purpose, the present application is implemented by the following technical scheme: a regional building group power transaction security guarantee system, comprising the following modules: A trusted computing environment authentication module configured to authenticate the off-chain computing environment based on the algorithm identifier recorded by the blockchain, and publish the encryption public key of the computing environment; a transaction data encryption and commitment module, an input of which is connected with an output of the trusted computing environment authentication module, configured to obtain the encryption public key, encrypt original transaction data to generate encrypted data, and generate a chain data commitment based on the encrypted data; an off-chain privacy computation and verification module, configured to receive the encrypted data generated by the transaction data encryption and commitment module in the computing environment authenticated by the trusted computing environment authentication module, and verify consistency of the encrypted data and the chain data commitment, and perform decryption and transaction computation after verification, to generate a computation result; a computation process proof and settlement module, an input of which is connected with an output of the off-chain privacy computation and verification module, configured to generate a zero-knowledge proof based on the computation result and the computation process, and submit the proof and the computation result to a blockchain for verification and settlement.
[0007] Preferably, the trusted computing environment authentication module is specifically configured to interact with a program registry contract deployed on the blockchain, the program registry contract records a hash value of an approved electricity transaction algorithm, and receives a hardware remote authentication report generated by the computing environment, which contains a hash value of an internal running program code, and compares the code hash value in the authentication report with the algorithm hash value recorded in the program registry contract. If they are consistent, the authentication is passed and the encryption public key is issued.
[0008] Preferably, the transaction data encryption and commitment module is specifically configured to combine the encrypted data with a random number and calculate a hash value thereof, and then submit the hash value as the chain data commitment to a data commitment contract deployed on the blockchain for recording.
[0009] Preferably, the off-chain privacy computation and verification module is specifically configured to recalculate the combined hash value of each piece of received encrypted data and its associated random number, and query the data commitment contract to verify that the recalculated combined hash value is consistent with the chain-recorded data commitment, and use the verification result as a prerequisite for executing transaction computation.
[0010] Preferably, the off-chain privacy computation and verification module is executed in a trusted execution environment of one or more computing nodes, the trusted execution environment holds a decryption private key for decrypting the encrypted data, and the decryption private key is not exposed to the untrusted environment of the computing node.
[0011] Preferably, the computing process proof and settlement module generates a zero-knowledge proof for jointly proving that the computing result is based on a set of private input data and is obtained by strictly performing operations according to the algorithm logic authenticated by the trusted computing environment authentication module, and that the encrypted data corresponding to the private input data after decryption is completely matched with the hash value of the random array combined with the on-chain data commitment generated by the transaction data encryption and commitment module.
[0012] Preferably, the computing process proof and settlement module is further configured to trigger a settlement contract to automatically execute the asset transfer defined in the computing result after the zero-knowledge proof is verified on the blockchain.
[0013] Preferably, any update of the power transaction algorithm hash value recorded in the program registry contract needs to be performed through an on-chain governance process.
[0014] Preferably, the operation sequence of the transaction participants is that the transaction data encryption and commitment module is first called to record data commitment on the blockchain, and then the encrypted data is transmitted to the off-chain private computing and verification module through an off-chain channel after the data commitment record is successful.
[0015] Preferably, the functions of the trusted computing environment authentication module, the transaction data encryption and commitment module, and the computing process proof and settlement module facing the blockchain are implemented through one or more smart contracts deployed on the blockchain.
[0016] The present application provides a regional building group power transaction security guarantee system. It has the following beneficial effects: 1、The present application combines the algorithm hash value recorded in the program registry contract with the remote authentication mechanism of the trusted execution environment to build the traceability and verifiability of the off-chain computing environment. The system uses the hardware built-in private key to digitally sign the report containing the algorithm code hash value and submits it to the on-chain contract for comparison. This mechanism ensures that any off-chain private computing task is executed in the specified algorithm environment approved by the blockchain consensus and the code is not tampered with, which fundamentally eliminates the security risks caused by untrusted computing environment or irregular algorithm logic and provides a basic guarantee for the correctness of subsequent computing results.
[0017] 2、The present application realizes the confidentiality and non-repudiation of transaction data in the whole life cycle through the synergistic effect of asymmetric encryption and on-chain data commitment. The transaction participants encrypt the original data using the public key of the authenticated trusted execution environment, ensuring the confidentiality of the data to any entity other than the trusted execution environment. At the same time, by submitting the hash value of the combination of encrypted data and random array to the data commitment contract, an unforgeable certificate is created on the chain for each input data. The mandatory check of the commitment before off-chain calculation effectively prevents data tampering and replay attacks, and ensures the authenticity and traceability of the calculation input.
[0018] 3、The present application uses zero-knowledge proof mechanism to associate and verify the on-chain data commitment, on-chain algorithm identification and off-chain calculation result, and constructs an end-to-end calculation process trusted closed loop. The generation of the proof takes the private input data, public calculation result, algorithm hash identification and data commitment hash as the input of the circuit, so as to prove to the on-chain verifier that the calculation result is strictly based on the authenticated algorithm logic and is obtained by operating on the original data that completely matches the on-chain commitment. This method provides a mathematically verifiable and decentralized trust guarantee for the integrity and correctness of off-chain complex calculation without revealing any original transaction data. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 Flow chart of the regional building group power transaction security protection system. DETAILED DESCRIPTION
[0020] The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the specification of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application. EMBODIMENT
[0021] Please refer to the drawings in the specification of the present application Figure 1 The embodiment of the present application provides a regional building group power transaction security protection system, which comprises the following modules: A trusted computing environment authentication module is configured to authenticate the off-chain computing environment based on the algorithm identification recorded by the block chain, and to issue the encryption public key of the computing environment; The trusted computing environment authentication module is specifically configured to interact with a program registry contract deployed on the blockchain. The program registry contract records the hash value of the approved power trading algorithm and receives a hardware remote authentication report generated by the computing environment, containing the hash value of its internal running program code. It also compares the code hash value in the authentication report with the algorithm hash value recorded in the program registry contract. If they match, authentication is successful and its encrypted public key is published, including the following algorithms: First, deploy the program registry smart contract and data commitment smart contract on the target blockchain. Then, the audited and approved electricity trading algorithm program code... By calculating its cryptographic hash value Register. This process is represented as follows:
[0022] in, The hash value of the algorithm code serves as a unique and immutable identifier for the algorithm on the blockchain; This represents a collision-resistant cryptographic hash function, such as SHA-256; This is the binary program code for the electricity trading algorithm; Subsequently, the compute node configured for off-chain privacy computation starts its Trusted Execution Environment (TEE). The TEE utilizes its hardware-embedded private key. For a hash value containing the currently running program code and the TEE's own public key Sign the report and generate remote authentication. This signature process is represented by the following function:
[0023] In this formula, It is the generated remote authentication report; Sign is a digital signature function; It is the device private key that is built into the TEE hardware and cannot be extracted; Report A report generated for TEE hardware that includes a summary of its internal state; It is the hash value of the algorithm code currently loaded inside the TEE; It is the public key generated by the TEE for this session and used for data encryption; Compute nodes will The program registry contract on the chain. The contract verifies the validity of the signature through the corresponding hardware public key, and compares the report with the official algorithm hash value recorded on the chain. After verification, the contract will associate with the address of the computing node, marked as authenticated status; The functions of the trusted computing environment authentication module, transaction data encryption and commitment module, and computing process proof and settlement module facing the blockchain are implemented through one or more smart contracts deployed on the blockchain, including the following algorithms: In each transaction cycle, the transaction participant preparing its original transaction data , and through interaction with the blockchain, creating an undeniable public certificate for the submission of the data; the participant first obtains the public key of the authenticated TEE from the program registry contract on the chain . Then, using the public key, the participant's original transaction data is encrypted using an asymmetric encryption algorithm to generate ciphertext data , and the encryption process is as follows:
[0024] where, is the encrypted ciphertext data; represents an asymmetric encryption function; is the TEE public key that passed the authentication in the first step; is the participant's original transaction data, such as containing quotes, power, etc; To prevent data replay attacks and establish an on-chain commitment, the participant generates a secure random number . Then, the ciphertext data is concatenated with the random number , and the hash value of the combination is calculated to generate the on-chain data commitment ;
[0025] In this formula, is the final generated on-chain data commitment; is the same hash function as in the first step; is the encrypted transaction data; || represents the concatenation operation of byte sequences; is a random number used only once. The participant will The encrypted data is submitted to the data commitment contract for recording. After successful recording, the encrypted data is transmitted to the authenticated computing node through an off-chain channel and a random number ; a transaction data encryption and commitment module, an input end of which is connected with an output end of the trusted computing environment authentication module, configured to obtain the encryption public key, encrypt original transaction data to generate encrypted data, and generate a on-chain data commitment based on the encrypted data; The transaction data encryption and commitment module is specifically configured to combine the encrypted data with a random number and calculate a hash value thereof, and then take the hash value as the on-chain data commitment and submit it to the data commitment contract deployed on the blockchain for recording; an off-chain privacy calculation and verification module, configured to receive the encrypted data generated by the transaction data encryption and commitment module in the computing environment authenticated by the trusted computing environment authentication module, and verify the consistency of the encrypted data and the on-chain data commitment, and perform decryption and transaction calculation after verification to generate a calculation result, including the following algorithms: After receiving the data, the computing node performs privacy calculation in its TEEE, and generates a cryptographic proof of the integrity of the calculation process without revealing any input data. The TEEE receives encrypted data packets from multiple parties For each piece of received data, the TEEE first re-computes its commitment hash value internally and queries the on-chain data commitment contract to verify whether the hash value is consistent with the on-chain record . Only data that passes the verification will be accepted. Subsequently, the TEEE uses its internally stored private key to decrypt all verified ciphertext data to recover the original transaction data
[0026]
[0027] wherein, is the decrypted original transaction data; is an asymmetric decryption function; is a private key paired with the public key and only exists in the TEEE; is the received ciphertext data. After obtaining the plaintext data set of all participants , the TEEE executes the power transaction algorithm identified by in the first step to calculate the settlement result of the transaction ;
[0028] In the formula, is the calculation result containing the details of each party's transaction and fund transfer instructions. After the calculation is completed, the TEE calls the zero-knowledge proof generation algorithm to generate a proof , which can prove the integrity and correctness of the calculation, and its generation process can be formalized as:
[0029] wherein, is the generated zero-knowledge proof; is the proof generation function; is an arithmetic circuit representing the entire process from data commitment verification to transaction algorithm execution; is a private input known only to the TEE, specifically is a public input visible to the outside, specifically ; The off-chain privacy calculation and verification module is specifically configured to recalculate the combined hash value of each received encrypted data and its associated random number, and query the data commitment contract to verify that the recalculated combined hash value is consistent with the data commitment recorded on the chain, and the verification result is used as a prerequisite for executing transaction calculation; The off-chain privacy calculation and verification module is executed in the trusted execution environment of one or more computing nodes, and the trusted execution environment holds a decryption private key for decrypting the encrypted data, and the decryption private key is not exposed to the untrusted environment of the computing node; As an optional implementation manner of the technical solution, the off-chain privacy calculation and verification module can also be constructed based on homomorphic encryption technology. In this manner, the transaction data encryption and commitment module will use a homomorphic encryption algorithm to encrypt the original transaction data, and the off-chain computing node will directly perform homomorphic operations such as homomorphic addition and multiplication on the encrypted data without decrypting the data to complete the power market clearing algorithm. After the calculation is completed, an encrypted state calculation result is generated, which can be decrypted by one or more key holders; The calculation process proof and settlement module is connected to the output end of the off-chain privacy calculation and verification module, and is configured to generate a zero-knowledge proof based on the calculation result and the calculation process, and submit the proof and the calculation result to the blockchain for verification and settlement; The computing process proof and settlement module generates a zero-knowledge proof, which is used to jointly prove the following two propositions: the computing result is obtained based on a set of private input data and strictly according to the algorithm logic authenticated by the trusted computing environment authentication module, and the encrypted data corresponding to the private input data after decryption is completely matched with the hash value of the random array combined with the on-chain data commitment generated by the transaction data encryption and commitment module; The computing process proof and settlement module is further configured to trigger a settlement contract to automatically execute the asset transfer defined in the computing result after the zero-knowledge proof is verified on the blockchain, including the following algorithms: The trusted result of off-chain computing is anchored back to the blockchain to complete the final verification and value transfer in a decentralized manner. The computing node submits the computing result and the zero-knowledge proof to the settlement contract deployed on the blockchain. After receiving the data, the settlement contract calls the verification function of the zero-knowledge proof to check the validity of the proof:
[0030] In this formula, isValid is a boolean value representing whether the verification is passed; is the proof verification function, which has low computational overhead and is suitable for execution in the smart contract environment; is the proof to be verified; is the public input consistent with the proof when it is generated
[0031]
[0032] If the Verify function returns true, it means that the computing result is trusted, that is, it is correctly calculated based on the data committed on the chain and through the registered algorithm on the chain. At this time, the settlement contract will accept the result and automatically execute the settlement terms contained therein to complete the transfer of power assets or funds between different participant accounts. If the verification fails, this settlement is rejected, and the corresponding exception handling mechanism can be triggered; The operation sequence of the transaction participants is as follows: first, call the transaction data encryption and commitment module to record data commitment on the blockchain, and then transmit the encrypted data to the off-chain private computing and verification module through an off-chain channel after the data commitment record is successful.
[0033] While embodiments of the application have been shown and described, it is to be understood that the embodiments described are merely exemplary of the principles and application of the present application. Numerous modifications and adaptions can be effected without departing from the spirit and scope of the present application, which is not limited to the exact construction and arrangement described. It is intended, therefore, to cover all modifications and adaptions that fall within the scope of the claims and their equivalents.
Claims
1. A regional building complex electric power transaction security assurance system characterized by comprising: The application comprises the following modules: A trusted computing environment authentication module configured to authenticate a computing environment off-chain based on an algorithm identification recorded in a blockchain and issue a public key of the computing environment; A transaction data encryption and commitment module connected to the output of the trusted computing environment authentication module, configured to obtain the public key, encrypt original transaction data to generate encrypted data, and generate a data commitment on-chain based on the encrypted data; An off-chain privacy computing and verification module configured to receive the encrypted data generated by the transaction data encryption and commitment module in a computing environment authenticated by the trusted computing environment authentication module, verify the consistency of the encrypted data and the data commitment on-chain, and perform decryption and transaction calculation after verification to generate a calculation result; A calculation process proof and settlement module connected to the output of the off-chain privacy computing and verification module, configured to generate a zero-knowledge proof based on the calculation result and the calculation process, and submit the proof and the calculation result to a blockchain for verification and settlement.
2. The regional building complex electric power transaction security assurance system according to claim 1, characterized by, The trusted computing environment authentication module is specifically configured to interact with a program registry contract deployed on the blockchain, the program registry contract records the hash value of an approved electricity transaction algorithm, receives a hardware remote authentication report generated by the computing environment containing the hash value of the internal running program code, and compares the code hash value in the authentication report with the algorithm hash value recorded in the program registry contract. If they are consistent, the authentication is passed and the public key is issued.
3. The regional building complex electric power transaction security assurance system according to claim 1, characterized by, The transaction data encryption and commitment module is specifically configured to combine the encrypted data with a random number and calculate the hash value thereof, and then submit the hash value as the data commitment on-chain to a data commitment contract deployed on the blockchain for recording.
4. The regional building complex electric power transaction security assurance system according to claim 1, characterized by, The off-chain privacy computing and verification module is specifically configured to recalculate the combined hash value of each received encrypted data and its associated random number, and query the data commitment contract to verify that the recalculated combined hash value is consistent with the data commitment recorded on-chain, and use the verification result as a prerequisite for executing transaction calculation.
5. The regional building complex electric power transaction security assurance system according to claim 1, characterized by, The off-chain privacy computing and verification module is executed in a trusted execution environment of one or more computing nodes, the trusted execution environment holds a decryption private key for decrypting the encrypted data, and the decryption private key is not exposed to the untrusted environment of the computing node.
6. The regional building complex electric power transaction security assurance system according to claim 1, characterized by, The zero-knowledge proof generated by the calculation process proof and settlement module is used to prove that the calculation result is based on a set of private input data and strictly executed according to the algorithm logic authenticated by the trusted computing environment authentication module, and that the encrypted data corresponding to the decrypted private input data and the hash value of the random number combination completely match the data commitment on-chain generated by the transaction data encryption and commitment module.
7. The regional building complex electric power transaction security assurance system according to claim 1, characterized by, The calculation process proof and settlement module is also configured to trigger a settlement contract to automatically execute the asset transfer defined in the calculation result after the zero-knowledge proof is verified on the blockchain.
8. The regional building complex electric power transaction security assurance system according to claim 2, characterized by, Any update of the power transaction algorithm hash value recorded in the program registry contract needs to be executed through an on-chain governance process.
9. The regional building complex electric power transaction security assurance system according to claim 1, characterized by, The operation sequence of the transaction participants, that is, first calling the transaction data encryption and commitment module to record data commitment on the blockchain, and then transmitting the encrypted data to the off-chain privacy calculation and verification module through an off-chain channel after the data commitment record is successful.
10. The regional building complex electric power transaction security assurance system according to claim 1, characterized by, The functions of the trusted computing environment authentication module, the transaction data encryption and commitment module, and the calculation process proof and settlement module facing the blockchain are implemented through one or more smart contracts deployed on the blockchain.
Citation Information
Cited By
Large language model privacy reasoning method and system capable of verifying log-free behavior and output integrity
CN122119998A