Energy data cross-chain intercommunication privacy enhancement method and system based on homomorphic encryption
By building a blockchain network with multiple application chains and relay chains, combining cross-chain smart contracts and homomorphic encryption technology, the problems of data silos, insufficient privacy protection and insufficient scalability in energy data interoperability are solved, and the efficient, secure and sustainable circulation of energy data is achieved.
Patent Information
- Application Number
- CN202411889546.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-04
AI Technical Summary
Current energy data interoperability technology has problems such as data silos, imperfect privacy protection and insufficient scalability, which limits the efficient, safe and sustainable circulation of energy data.
By building a blockchain network composed of multiple application chains and relay chains, deploying cross-chain smart contracts and cross-chain gateways, using homomorphic encryption technology to ensure data privacy, and achieving cross-chain interoperability of energy data.
It realizes efficient interoperability of energy data among multi-blockchain systems, ensures data privacy protection and system scalability, and solves the problems of data silos, insufficient privacy protection and poor scalability.
Smart Images

Figure CN119766414A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data privacy computing technology, and specifically to a method and system for enhancing the privacy of energy data cross-chain intercommunication based on homomorphic encryption. Background Art
[0002] In the current energy data interoperability technology, although there has been some research and application progress, there are still many technical defects and bottlenecks that limit its widespread application and development. First of all, one of the biggest problems facing energy data interoperability is the "data island" phenomenon. Existing blockchain technology is mostly used to build independent distributed ledgers, each running an independent consensus mechanism, resulting in the inability to share or exchange data between different blockchain systems. Since each energy platform adopts different standards and protocols, it is difficult for energy data to circulate and exchange between platforms, resulting in the dispersion and fragmentation of energy data. There is no unified mechanism for cross-chain data interoperability, which makes it impossible for different regions and different entities to effectively cooperate and share data, thereby limiting the liquidity and integration value of energy data.
[0003] Secondly, in terms of energy data security, although existing technologies use common encryption and protection measures, they face the problem of insufficient data privacy protection. Energy data not only involves users' electricity usage behavior, but also includes sensitive data such as energy market transaction information and equipment operating status. Traditional encryption algorithms often fail to balance data availability and privacy protection while ensuring data security.
[0004] In addition, existing blockchain technology has significant limitations in scalability. In traditional blockchain systems, all nodes need to save a complete copy of the ledger, which leads to high storage costs and computing overhead. Especially in the scenarios of large-scale energy data storage and high-frequency transactions, the performance and processing efficiency of blockchain are difficult to meet actual needs.
[0005] In summary, the current energy data interoperability technology still has problems such as data silos, imperfect privacy protection and insufficient scalability. It is urgent to solve these challenges through the introduction and innovation of new technologies to promote the efficient, secure and sustainable circulation of energy data. Summary of the invention
[0006] In view of the above-mentioned problems, the present invention is proposed.
[0007] Therefore, the technical problem solved by the present invention is: how to achieve efficient intercommunication of energy data among multiple blockchain systems while ensuring data privacy protection and system scalability.
[0008] In order to solve the above technical problems, the present invention provides the following technical solution: a method for enhancing the privacy of energy data cross-chain intercommunication based on homomorphic encryption, which comprises the following steps:
[0009] Build a blockchain network consisting of multiple application chains and relay chains, deploy cross-chain smart contracts and cross-chain gateways, and establish an infrastructure for cross-chain transmission of energy data;
[0010] The data demander initiates a registration request to the application chain through the cross-chain gateway. The data provider verifies the identity and authority, completes the registration and generates access permission information.
[0011] The data demander generates a homomorphic encryption public-private key pair and initiates a data access request. The data provider uses the public key to encrypt the data and generate ciphertext, digital signature, and hash value.
[0012] The data provider transmits the relevant information of the encrypted data to the application chain where the demander is located through the relay chain. The relay chain verifies the legitimacy of the data and then forwards it to the target chain;
[0013] After receiving the data, the data demander verifies the integrity and origin, decrypts the ciphertext with the private key to obtain the original data, and realizes the secure interaction of energy data.
[0014] As a preferred solution of the energy data cross-chain intercommunication privacy enhancement method based on homomorphic encryption described in the present invention, wherein: the construction of a blockchain network consisting of multiple application chains and relay chains, the deployment of cross-chain smart contracts and cross-chain gateways, and the establishment of an infrastructure for cross-chain transmission of energy data include:
[0015] For different energy data providers and demanders, each deploys an independent application chain to manage local energy data, complete in-chain data storage and processing, and deploys a relay chain between application chains as the core hub for cross-chain transmission to manage cross-chain data interaction requests and verify legitimacy;
[0016] Deploy cross-chain smart contracts in the application chain, define the rules and permission management mechanism for cross-chain data interaction, process cross-chain requests from data demanders, and coordinate the response operations of data providers;
[0017] Combined with the cross-chain gateway, it receives, forwards and manages requests for cross-chain data transmission, passes cross-chain data from the demander to the provider or relay chain, and completes synchronization between multiple chains.
[0018] As a preferred solution of the energy data cross-chain intercommunication privacy enhancement method based on homomorphic encryption described in the present invention, the data demander initiates a registration request to the application chain through the cross-chain gateway, the data provider verifies the identity and authority, completes the registration and generates access permission information including:
[0019] The data demander sends a registration request to the designated application chain through the cross-chain gateway to clarify the need to access energy data and related identity information;
[0020] After receiving the registration request, the cross-chain gateway will pass it to the application chain where the data provider is located through the relay chain, so that the request can be correctly routed to the target node;
[0021] After receiving the registration request, the data provider will review the identity information of the requester to verify the legitimacy of the identity and the scope of access rights;
[0022] Based on the verification results, the data provider classifies the demander into the corresponding permission user group and assigns access permission information. The data provider returns the registration result to the demander through the relay chain.
[0023] The registration result includes whether the review is passed and the specific authority information assigned. The cross-chain gateway will pass the feedback result to the demander to complete the registration process.
[0024] As a preferred solution of the energy data cross-chain intercommunication privacy enhancement method based on homomorphic encryption described in the present invention, the data demander generates a homomorphic encryption public-private key pair and initiates a data access request, and the data provider uses the public key to encrypt the data, and generates a ciphertext, a digital signature and a hash value, including:
[0025] The data demander generates a public-private key pair through a homomorphic encryption algorithm. The data demander carries the generated public key and initiates a data access request to the application chain where the data provider is located through the cross-chain gateway, clearly defining the data scope and requirements to be accessed. The access request is forwarded by the cross-chain gateway to the relay chain and then routed to the data provider of the target application chain;
[0026] After receiving the access request, the data provider verifies the identity and access rights of the requester, and uses the public key of the requester to perform homomorphic encryption on the data according to the data scope requested by the requester to generate encrypted ciphertext;
[0027] The data provider uses a digital signature algorithm to generate a signature, attaches it to the encrypted data, and calculates a hash value for the encrypted data as the basis for data integrity verification;
[0028] The data provider packages the encrypted ciphertext, digital signature, and hash value as a data packet for cross-chain transmission and sends it to the application chain where the demander is located through the relay chain.
[0029] As a preferred solution of the energy data cross-chain intercommunication privacy enhancement method based on homomorphic encryption described in the present invention, wherein: the data provider transmits the relevant information of the encrypted data to the application chain where the demander is located through the relay chain, and the relay chain verifies the legitimacy of the data and then forwards it to the target chain, including:
[0030] The data provider packages the generated encrypted ciphertext, digital signature and hash value into a data transmission package, and submits it to the relay chain through the cross-chain gateway in the application chain as a request for cross-chain transmission;
[0031] After receiving the data transmission package, the relay chain confirms the legitimacy of the data according to the verification rules of the cross-chain protocol. After completing the verification, the relay chain records the metadata of the data package on the chain;
[0032] After the relay chain verification is completed, the legal data packet is forwarded to the target application chain where the demander is located, and the target application chain where the demander is located receives the data packet through the cross-chain gateway.
[0033] As a preferred solution of the energy data cross-chain intercommunication privacy enhancement method based on homomorphic encryption described in the present invention, wherein: the data demander verifies the integrity and origin after receiving the data, decrypts the ciphertext with a private key to obtain the original data, and realizes the secure interaction of energy data, including:
[0034] The data demander receives the encrypted data packet transmitted by the data provider through the relay chain through the cross-chain gateway of the application chain where it is located, verifies the validity of the signature using the digital signature public key of the data provider, calculates the hash value of the received ciphertext, and compares it with the hash value in the data packet;
[0035] After passing the integrity and origin verification, the data demander uses its own private key to homomorphically decrypt the received ciphertext, restore the original energy data, and further process or analyze the data according to actual needs.
[0036] As a preferred solution of the energy data cross-chain intercommunication privacy enhancement method based on homomorphic encryption described in the present invention, wherein: the use of the digital signature public key of the data provider to verify the validity of the signature includes:
[0037] If the signature verification confirms that the data indeed comes from the data provider;
[0038] If the verification fails, the demander refuses to process the data packet and generates an exception warning;
[0039] The step of calculating the hash value of the received ciphertext and comparing it with the hash value in the data packet includes:
[0040] If the hash values are consistent, it means that the data has not been tampered with during transmission;
[0041] If there is any inconsistency, the demander will consider the data invalid and record the exception.
[0042] Another object of the present invention is to provide an energy data cross-chain intercommunication privacy enhancement system based on homomorphic encryption, which can realize the safe and efficient circulation of data by using homomorphic encryption technology, relay chain architecture and hybrid storage solution, and solve the problems of data silos, insufficient privacy protection and poor system scalability in the prior art.
[0043] In order to solve the above technical problems, the present invention provides the following technical solutions: a cross-chain intercommunication privacy enhancement system for energy data based on homomorphic encryption, comprising: an application chain module, a relay chain module, a cross-chain smart contract module, a cross-chain gateway module and a homomorphic encryption and verification module;
[0044] The application chain module is a local blockchain platform for data providers and data demanders, which stores, processes and manages data, provides a receiving endpoint for registration requests, stores user authority information, and supports the deployment and execution of smart contracts;
[0045] The relay chain module receives and verifies the cross-chain data packets from the data provider, forwards the verified data packets to the application chain where the demander is located, and records the metadata of the cross-chain data transmission;
[0046] The cross-chain smart contract module is used to assign user permissions and return information to the requester during the user registration phase, and to perform data access permission verification and control data encryption and transmission processes during the data interaction phase;
[0047] The cross-chain gateway module is a module where the data demander initiates a registration request and a data access request through the cross-chain gateway, the data provider submits an encrypted data packet through the cross-chain gateway, and the relay chain sends the verified data packet to the target chain through the cross-chain gateway;
[0048] The homomorphic encryption and verification module is a data demander that generates a homomorphic encryption public-private key pair. The data provider uses the public key to encrypt the data, generate a digital signature and hash value, and the data demander verifies the signature and hash value.
[0049] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the above-mentioned method for enhancing the privacy of cross-chain intercommunication of energy data based on homomorphic encryption are implemented.
[0050] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned method for privacy enhancement of cross-chain intercommunication of energy data based on homomorphic encryption.
[0051] Beneficial effects of the present invention: The present invention realizes a decentralized trust mechanism through relay chain and smart contract technology, replacing the traditional model of relying on third-party intermediaries, so that blockchain nodes can trust each other, thereby reducing transaction costs and improving transparency and security; cross-chain technology is used to break the isolation barriers between blockchains, realize the rapid and secure circulation of energy data, and solve the problem of data islands; combined with homomorphic encryption technology, while ensuring data privacy, it supports data calculation and exchange in an encrypted state, effectively preventing data leakage or tampering; by deploying the energy data interaction model on the smart contract, the automatic matching of demand and supply is realized, manual intervention is reduced, transaction efficiency is improved and operational risks are reduced; at the same time, through the IPFS off-chain storage and homomorphic encryption off-chain calculation, the storage and computing pressure of the blockchain is reduced, and the performance and scalability of the system are significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0053] Figure 1 An overall flow chart of the energy data cross-chain intercommunication privacy enhancement method based on homomorphic encryption provided in the first embodiment of the present invention;
[0054] Figure 2 A timing diagram of the data interaction phase in the energy data cross-chain intercommunication privacy enhancement method based on homomorphic encryption provided in the first embodiment of the present invention;
[0055] Figure 3 A timing diagram of the user registration phase of the energy data cross-chain intercommunication privacy enhancement method based on homomorphic encryption provided in the first embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0057] Example 1, reference Figure 1 As an embodiment of the present invention, a method for enhancing privacy of energy data cross-chain intercommunication based on homomorphic encryption is provided, comprising:
[0058] Build a blockchain network consisting of multiple application chains and relay chains, deploy cross-chain smart contracts and cross-chain gateways, and establish an infrastructure for cross-chain transmission of energy data;
[0059] The data demander initiates a registration request to the application chain through the cross-chain gateway. The data provider verifies the identity and authority, completes the registration and generates access permission information.
[0060] The data demander generates a homomorphic encryption public-private key pair and initiates a data access request. The data provider uses the public key to encrypt the data and generate ciphertext, digital signature, and hash value.
[0061] The data provider transmits the relevant information of the encrypted data to the application chain where the demander is located through the relay chain. The relay chain verifies the legitimacy of the data and then forwards it to the target chain;
[0062] After receiving the data, the data demander verifies the integrity and origin, decrypts the ciphertext with the private key to obtain the original data, and realizes the secure interaction of energy data.
[0063] Reference Figure 1 , further explained is:
[0064] The cross-chain privacy enhancement scheme for energy data based on homomorphic encryption is divided into three parts: the startup phase, the user registration phase, and the data interaction phase.
[0065] (1) Startup phase: The startup phase of cross-chain energy data interoperability builds the infrastructure for cross-chain data interaction by deploying application chains, relay chains, cross-chain smart contracts, and cross-chain gateways.
[0066] (2) User registration stage:
[0067] 1) Initiate a request: The data demander initiates a registration request to application chain A through the cross-chain gateway and relay chain.
[0068] 2) Review authority: The data provider reviews the registration request, verifies the identity and assigns it to the authorized user group.
[0069] 3) Result feedback: The registration result is returned to the data demander through the relay chain to complete the registration confirmation.
[0070] (3) Data interaction stage
[0071] 1) Generate keys: The data demander generates a homomorphically encrypted public-private key pair.
[0072] 2) Initiate a request: The data demander initiates a data access request with the public key, which is passed to application chain A through the cross-chain gateway and relay chain.
[0073] 3) Verify permissions: The data provider verifies the identity and permissions of the data requester to ensure that access requirements are met.
[0074] 4) Data encryption and cross-chain transaction transmission: After the data provider performs homomorphic encryption on the data to be transmitted, it generates a digital signature public-private key pair, digitally signs the ciphertext, and calculates the hash value of the encrypted data. The ciphertext and related information are sent to the data demander, and the ciphertext hash value and digital signature public key are passed to application chain B through the cross-chain platform.
[0075] 5) Relay chain forwarding: After the relay chain verifies the validity of the cross-chain data interaction request, it forwards the request to application chain B.
[0076] 6) Decryption processing: After receiving the ciphertext in application chain B, the data demander verifies the digital signature and hash value, and uses the private key to decrypt and obtain the original data.
[0077] For different energy data providers and demanders, each deploys an independent application chain to manage local energy data, complete in-chain data storage and processing, and deploys a relay chain between application chains as the core hub for cross-chain transmission to manage cross-chain data interaction requests and verify legitimacy;
[0078] Deploy cross-chain smart contracts in the application chain, define the rules and permission management mechanism for cross-chain data interaction, process cross-chain requests from data demanders, and coordinate the response operations of data providers;
[0079] Combined with the cross-chain gateway, it receives, forwards and manages requests for cross-chain data transmission, passes cross-chain data from the demander to the provider or relay chain, and completes synchronization between multiple chains.
[0080] It is further explained that:
[0081] Realize cross-chain data transmission and collaborative processing based on the relay chain: Connect application chain A and application chain B through the relay chain, allowing energy data to flow freely between different chains, ensuring efficient and secure transmission of data between different blockchains, and breaking down barriers between chains.
[0082] Build cross-chain smart contracts and gateway mechanisms: deploy cross-chain business contracts on the application chain, and combine with the cross-chain gateway to realize the forwarding and management of cross-chain requests.
[0083] A hybrid storage solution is implemented in conjunction with the InterPlanetary File System: data providers store large amounts of data in the InterPlanetary File System, and store homomorphic encryption calculations off-chain, so that the blockchain only stores key information, further reducing on-chain computing overhead.
[0084] Output efficient data interaction process: realize cross-chain data security verification, permission control and decryption processing, and complete the communication between data providers and data demanders.
[0085] Reference Figure 2 2. The data demander sends a registration request to the designated application chain through the cross-chain gateway to clarify the need to access energy data and related identity information;
[0086] After receiving the registration request, the cross-chain gateway will pass it to the application chain where the data provider is located through the relay chain, so that the request can be correctly routed to the target node;
[0087] After receiving the registration request, the data provider will review the identity information of the requester to verify the legitimacy of the identity and the scope of access rights;
[0088] Based on the verification results, the data provider classifies the demander into the corresponding permission user group and assigns access permission information. The data provider returns the registration result to the demander through the relay chain.
[0089] The registration result includes whether the review is passed and the specific authority information assigned. The cross-chain gateway will pass the feedback result to the demander to complete the registration process.
[0090] It is further explained that:
[0091] The privacy enhancement solution for cross-chain interoperability of energy data based on homomorphic encryption is mainly divided into the following four core functions, namely cross-chain interoperability of energy data, data privacy protection, integrity and origin protection, and storage optimization and encryption efficiency improvement.
[0092] Cross-chain intercommunication of energy data: The current mainstream cross-chain technologies include hash locking mechanism, notary mechanism and side chain / relay chain mechanism. Based on the advantages of relay chain in data transmission efficiency, system scalability and data security, this patent chooses the relay chain form to realize efficient and stable interaction of energy data between different blockchains. The connection between different energy data blockchains is realized through relay chain and cross-chain protocol, allowing energy data to flow freely between different chains, breaking down barriers between chains and improving the efficiency and flexibility of data circulation. This mechanism enables various types of energy data (such as electricity, carbon emissions, etc.) to interact seamlessly across different platforms, which not only promotes data sharing, but also improves the interoperability of the system. In this way, energy data can be transmitted quickly and accurately while ensuring privacy and security, greatly improving the transparency and coordination efficiency of the energy market.
[0093] Data privacy protection: The data provider encrypts the data through homomorphic encryption to ensure that the plain text is not leaked during data transmission and storage. The data provider takes the hash value of the encrypted data and then uploads the hash value to application chain A to ensure that the subsequent verification data is not tampered with during the transmission process. The data provider digitally signs the encrypted data to verify the source of the message and ensure the integrity and credibility of the data.
[0094] Integrity and origin protection: Data integrity and origin verification refers to the verification by the data demander after receiving the data packet whether the data is sent by the data provider and whether the data has been tampered with during the transmission process. First, the data demander obtains the Hash value of the data uploaded by the data provider by querying the application chain B, recalculates the Hash value based on the received ciphertext, and compares the two Hash values to see if they are consistent. If they are consistent, it means that the data has not been tampered with during the transmission process. The data demander compares the digital signature through the public key decryption. If the signature verification is successful, it means that the data was sent by the data provider.
[0095] Storage optimization and encryption efficiency improvement: The Interplanetary File System (IPFS) is a network protocol that supports distributed storage and file sharing. It combines technologies such as distributed hash tables, BitTorrent protocol, and Git version control. When combined with blockchain, it can achieve persistent storage and sharing of data. In order to reduce the storage pressure of blockchain, this patent can transfer the storage pressure of large-scale data from the blockchain by introducing the Interplanetary File System, so that the blockchain only stores key information, thereby saving storage space. At the same time, the use of off-chain homomorphic encryption calculations further reduces the on-chain computing overhead and improves the overall operating efficiency of the system.
[0096] The data demander generates a public-private key pair through a homomorphic encryption algorithm. The data demander carries the generated public key and initiates a data access request to the application chain where the data provider is located through the cross-chain gateway, clearly defining the data scope and requirements to be accessed. The access request is forwarded by the cross-chain gateway to the relay chain, and then routed to the data provider of the target application chain;
[0097] After receiving the access request, the data provider verifies the identity and access rights of the requester, and uses the public key of the requester to perform homomorphic encryption on the data according to the data scope requested by the requester to generate encrypted ciphertext;
[0098] The data provider uses a digital signature algorithm to generate a signature, attaches it to the encrypted data, and calculates a hash value for the encrypted data as the basis for data integrity verification;
[0099] The data provider packages the encrypted ciphertext, digital signature, and hash value as a data packet for cross-chain transmission and sends it to the application chain where the demander is located through the relay chain.
[0100] The data provider packages the generated encrypted ciphertext, digital signature and hash value into a data transmission package, and submits it to the relay chain through the cross-chain gateway in the application chain as a request for cross-chain transmission;
[0101] After receiving the data transmission package, the relay chain confirms the legitimacy of the data according to the verification rules of the cross-chain protocol. After completing the verification, the relay chain records the metadata of the data package on the chain;
[0102] After the relay chain verification is completed, the legal data packet is forwarded to the target application chain where the demander is located, and the target application chain where the demander is located receives the data packet through the cross-chain gateway.
[0103] Using the data provider's digital signature public key to verify the validity of the signature includes
[0104] If the signature verification confirms that the data indeed comes from the data provider;
[0105] If the verification fails, the demander refuses to process the data packet and generates an exception warning;
[0106] The step of calculating the hash value of the received ciphertext and comparing it with the hash value in the data packet includes:
[0107] If the hash values are consistent, it means that the data has not been tampered with during transmission;
[0108] If there is any inconsistency, the demander will consider the data invalid and record the exception.
[0109] It is further explained that:
[0110] Data providers and data demanders are used to represent the two roles involved in cross-chain data intercommunication, and application chain A and application chain B represent the two blockchains for data transmission. In this scenario, the data provider is located in application chain A, the data demander is located in application chain B, and the data provider transmits its data to the data demander.
[0111] Startup phase:
[0112] (1) Each energy data provider deploys its own application chain.
[0113] (2) Deploy the relay chain.
[0114] (3) Start the deployment and execution of cross-chain smart contracts.
[0115] (4) Start the cross-chain gateway.
[0116] User registration stage:
[0117] (1) The data demander initiates a user registration request, which is first forwarded through the cross-chain gateway and then passed to application chain A through the relay chain for processing.
[0118] (2) The data provider reviews the registration request, verifies the identity information of the data requester, and classifies it into the corresponding permission user group to ensure that it has appropriate access rights in subsequent interactions.
[0119] (3) The execution result of user registration is returned to the data demander through the relay chain, completing the feedback and confirmation of the registration process.
[0120] Reference Figure 3 , Data interaction stage:
[0121] (1) Homomorphic encryption key generation
[0122] The Paillier algorithm is selected as the homomorphic encryption algorithm used. First, the data demander generates a public-private key pair for encrypting data, as shown in formula (1):
[0123]
[0124] Among them, p and q are two randomly generated large prime numbers, n represents an integer obtained by multiplying two large prime numbers p and q, lcm(,) is a function for finding the least common multiple of p-1 and q-1, g is a random positive integer and represents the multiplication group modulo n2, that is, the set of all integers less than n2 and coprime to n2. mod represents the modulo operation, that is, calculating the remainder after dividing two numbers. For any number x, the L(x) function is defined as
[0125] At this point, the public and private key pair of the Paillier homomorphic encryption algorithm is obtained, and the public key is pk d =(n,g), the private key is sk d =(λ,μ).
[0126] (2) Initiate a request
[0127] The data demander initiates a data access request and carries its public key, which is then forwarded to application chain A through the cross-chain gateway and relay chain platform to ensure that the request can be accurately delivered to the data provider.
[0128] (3) Permission Verification
[0129] The data provider authenticates the request and confirms whether the data requester's permissions meet the access requirements. During this process, the data provider will check the permission group to which the requester belongs based on the requester's identity information to ensure that only authorized users can access the data.
[0130] (4) Data encryption and cross-chain transaction transmission
[0131] (a) Data encryption
[0132] The data provider uses the public key pkd to encrypt the original data stored in the Interstellar File System to obtain the ciphertext, as shown in formula (2):
[0133] S=g M r n (modn 2 ) (2)
[0134] Wherein, M represents original data, S represents ciphertext, r is a random number, and r<n.
[0135] (b) The data provider generates a digital signature public-private key pair
[0136] Key Generation:
[0137] The data provider uses the DSA algorithm to generate a public-private key pair (pk s ,sk s ), use the private key sks to sign the ciphertext S sigS = sig(sk s ,S).
[0138] First, select a hash function SHA-256, then select a key length L = 2048 and a prime length N. Select a prime number q1 of length N bits; N must be less than or equal to the length of the hash output. Select a number p1 of length L bits so that p1-1 is a multiple of q1. Calculate the public and private key pair of the signature algorithm, as shown in formula (3).
[0139] {y≡g1 h (modp1) (3)
[0140] Where: q1 is a prime number of length N, p1 is of length L, and p1 makes p1-1 a multiple of q1, and g1 is obtained. h is a random number selected between 0<x<q1, and y is calculated. The public key pk is obtained s =(p1,q1,g1,y) and private key sk s =h.
[0141] Ciphertext signature:
[0142] The data provider uses the generated public and private keys to sign the ciphertext, as shown in formula (4):
[0143] {s≡k -1 (H(S)+hr)(modq1) (4)
[0144] Where: k is a random number, and 0<k<q1, S refers to the ciphertext after homomorphic encryption, H(S) is the process of taking the hash value of the ciphertext, and the digital signature sigS=(e,s) is obtained. And the obtained hash value Hash s =H(S), uploaded to the blockchain network.
[0145] (c) Cross-chain transaction sending
[0146] After the data provider performs homomorphic encryption on the data to be transmitted, it digitally signs the ciphertext and calculates the hash value of the encrypted data. Subsequently, the encrypted data, digital signature and hash value are packaged together and sent to the data demander. The ciphertext hash value and public key are sent to application chain B through the cross-chain platform for further processing. The specific steps are as follows: the data provider uses the encrypted data hash value as a contract parameter on application chain A and calls the cross-chain transaction initiation method of the cross-chain business contract in application chain A. After the cross-chain business contract is called, the cross-chain management contract is called through the cross-contract to formally initiate a cross-chain request. Once the cross-chain request is triggered, it will be captured by the periodic retrieval mechanism connected to application chain A and the cross-chain gateway, and the request will be submitted to the gateway to complete the preliminary operation of cross-chain data interaction.
[0147] (5) Relay chain forwards cross-chain transactions
[0148] After the relay link receives the cross-chain data interaction request from application chain A, it verifies it and forwards it to application chain B to ensure that the data transmission between chains is not hindered. The specific steps are: when application chain A submits the cross-chain request to the gateway, the gateway will encapsulate the received request into a cross-chain transmission protocol and send the encapsulated request to the relay chain. After receiving the request, the relay link first needs to verify the validity of the transaction: determine whether the transaction is credible through the cross-chain transaction proof in the cross-chain transmission protocol, and confirm whether the destination chain specified in the protocol has been registered. After verifying the validity of the transaction, the relay chain records the transaction and submits it to the gateway connected to the transaction application chain B to continue to complete the cross-chain operation.
[0149] (6) Receive cross-chain transactions and perform decryption
[0150] (a) After the gateway of application chain B receives the cross-chain transaction from application chain A, it is first passed to the cross-chain management contract on chain B through the cross-chain gateway connected to application chain B. The cross-chain management contract then calls the cross-chain business contract through the cross-contract and passes the request to the data demander. At this time, the data demander receives the ciphertext hash value and digital signature public key transmitted from the cross-chain transaction.
[0151] After receiving the cross-chain transaction, the data demander first verifies the digital signature and hash value to ensure the integrity and origin of the data.
[0152] (b) Data origin verification
[0153] After receiving the data packet C, the data demander verifies whether the ciphertext is sent by the data provider, that is, verifies the validity of the signature. As shown in formula (5):
[0154]
[0155] Where ω represents the value calculated by the inverse element of s, which is used for signature authentication, u1 represents the value calculated by ω and the ciphertext hash value H(S), and u2 represents the value calculated by ω and e. Both u1 and u2 are used to check the validity of the signature.
[0156] If v=e, the signature validity verification is passed, which means that the data packet comes from the data provider and the data origin verification is completed.
[0157] (c) Data integrity verification
[0158] After the data identity verification is passed, the data integrity is verified. The hash value of the ciphertext data is verified to be consistent with the stored value on the chain. If inconsistency is found during the verification, it means that the data has been tampered with by the attacker or lost during the data transmission process, and the data demand direction sends an abnormal warning to the application chain B; if the comparison is successful, it means that the data has not been tampered with during the transmission process, and the data integrity verification is completed.
[0159] (d) Subsequently, the data demander uses the corresponding private key to homomorphically decrypt the encrypted data, restore the data before encryption, complete the transaction process and verify the accuracy of the data.
[0160] Use the homomorphic private key to decrypt the ciphertext, as shown in formula (6):
[0161]
[0162] At this point, the transaction recipient successfully receives the data sent by the transaction sender, and the data is encrypted when transmitted on the relay chain.
[0163] Embodiment 2 is an embodiment of the present invention, which provides a system for a method for enhancing the privacy of energy data cross-chain intercommunication based on homomorphic encryption, including: an application chain module, a relay chain module, a cross-chain smart contract module, a cross-chain gateway module, and a homomorphic encryption and verification module;
[0164] The application chain module is a local blockchain platform for data providers and data demanders. It stores, processes and manages data, provides a receiving endpoint for registration requests, stores user permission information, and supports the deployment and execution of smart contracts.
[0165] The relay chain module receives and verifies the cross-chain data packets from the data provider, forwards the verified data packets to the application chain where the demander is located, and records the metadata of the cross-chain data transmission;
[0166] The cross-chain smart contract module allocates user permissions and returns information to the requester during the user registration phase. During the data interaction phase, it performs data access permission verification and controls data encryption and transmission processes.
[0167] The cross-chain gateway module is a module where data demanders initiate registration requests and data access requests through the cross-chain gateway, data providers submit encrypted data packets through the cross-chain gateway, and the relay chain sends the verified data packets to the target chain through the cross-chain gateway;
[0168] The homomorphic encryption and verification module is where the data demander generates a homomorphic encryption public-private key pair. The data provider uses the public key to encrypt the data, generate a digital signature and hash value, and the data demander verifies the signature and hash value.
[0169] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0170] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0171] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0172] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0173] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A privacy enhancement method for cross-chain energy data communication based on homomorphic encryption, characterized in that: include: Build a blockchain network consisting of multiple application chains and relay chains, deploy cross-chain smart contracts and cross-chain gateways, and establish an infrastructure for cross-chain transmission of energy data; The data demander initiates a registration request to the application chain through the cross-chain gateway. The data provider verifies the identity and authority, completes the registration and generates access permission information. The data demander generates a homomorphic encryption public-private key pair and initiates a data access request. The data provider uses the public key to encrypt the data and generate ciphertext, digital signature, and hash value. The data provider transmits the relevant information of the encrypted data to the application chain where the demander is located through the relay chain. The relay chain verifies the legitimacy of the data and then forwards it to the target chain; After receiving the data, the data demander verifies the integrity and origin, decrypts the ciphertext with the private key to obtain the original data, and realizes the secure interaction of energy data.
2. The method for enhancing privacy of energy data cross-chain intercommunication based on homomorphic encryption as claimed in claim 1, characterized in that: The construction of a blockchain network consisting of multiple application chains and relay chains, deployment of cross-chain smart contracts and cross-chain gateways, and establishment of an infrastructure for cross-chain transmission of energy data include: For different energy data providers and demanders, each deploys an independent application chain to manage local energy data, complete in-chain data storage and processing, and deploys a relay chain between application chains as the core hub for cross-chain transmission to manage cross-chain data interaction requests and verify legitimacy; Deploy cross-chain smart contracts in the application chain, define the rules and permission management mechanism for cross-chain data interaction, process cross-chain requests from data demanders, and coordinate the response operations of data providers; Combined with the cross-chain gateway, it receives, forwards and manages requests for cross-chain data transmission, passes cross-chain data from the demander to the provider or relay chain, and completes synchronization between multiple chains.
3. The method for enhancing privacy of energy data cross-chain intercommunication based on homomorphic encryption as claimed in claim 2 is characterized by: The data demander initiates a registration request to the application chain through the cross-chain gateway, and the data provider verifies the identity and authority, completes the registration and generates access permission information including: The data demander sends a registration request to the designated application chain through the cross-chain gateway to clarify the need to access energy data and related identity information; After receiving the registration request, the cross-chain gateway will pass it to the application chain where the data provider is located through the relay chain, so that the request can be correctly routed to the target node; After receiving the registration request, the data provider will review the identity information of the requester to verify the legitimacy of the identity and the scope of access rights; Based on the verification results, the data provider classifies the demander into the corresponding permission user group and assigns access permission information. The data provider returns the registration result to the demander through the relay chain. The registration result includes whether the review is passed and the specific authority information assigned. The cross-chain gateway will pass the feedback result to the demander to complete the registration process.
4. The method for enhancing privacy of energy data cross-chain communication based on homomorphic encryption as claimed in claim 3 is characterized by: The data demander generates a homomorphic encryption public-private key pair and initiates a data access request. The data provider uses the public key to encrypt the data and generate ciphertext, digital signature and hash value, including: The data demander generates a public-private key pair through a homomorphic encryption algorithm. The data demander carries the generated public key and initiates a data access request to the application chain where the data provider is located through the cross-chain gateway, clearly defining the data scope and requirements to be accessed. The access request is forwarded by the cross-chain gateway to the relay chain and then routed to the data provider of the target application chain; After receiving the access request, the data provider verifies the identity and access rights of the requester, and uses the public key of the requester to perform homomorphic encryption on the data according to the data scope requested by the requester to generate encrypted ciphertext; The data provider uses a digital signature algorithm to generate a signature, attaches it to the encrypted data, and calculates a hash value for the encrypted data as the basis for data integrity verification; The data provider packages the encrypted ciphertext, digital signature, and hash value as a data packet for cross-chain transmission and sends it to the application chain where the demander is located through the relay chain.
5. The method for enhancing privacy of energy data cross-chain intercommunication based on homomorphic encryption as claimed in claim 4 is characterized by: The data provider transmits the relevant information of the encrypted data to the application chain where the demander is located through the relay chain. The relay chain verifies the legitimacy of the data and then forwards it to the target chain, including: The data provider packages the generated encrypted ciphertext, digital signature and hash value into a data transmission package, and submits it to the relay chain through the cross-chain gateway in the application chain as a request for cross-chain transmission; After receiving the data transmission package, the relay chain confirms the legitimacy of the data according to the verification rules of the cross-chain protocol. After completing the verification, the relay chain records the metadata of the data package on the chain; After the relay chain verification is completed, the legal data packet is forwarded to the target application chain where the demander is located, and the target application chain where the demander is located receives the data packet through the cross-chain gateway.
6. The method for enhancing privacy of energy data cross-chain intercommunication based on homomorphic encryption as claimed in claim 5 is characterized by: After receiving the data, the data demander verifies the integrity and source, decrypts the ciphertext with a private key to obtain the original data, and realizes the secure interaction of energy data, including: The data demander receives the encrypted data packet transmitted by the data provider through the relay chain through the cross-chain gateway of the application chain where it is located, verifies the validity of the signature using the digital signature public key of the data provider, calculates the hash value of the received ciphertext, and compares it with the hash value in the data packet; After passing the integrity and origin verification, the data demander uses its own private key to homomorphically decrypt the received ciphertext, restore the original energy data, and further process or analyze the data according to actual needs.
7. The method for enhancing privacy of energy data cross-chain communication based on homomorphic encryption as claimed in claim 6 is characterized by: The use of the data provider's digital signature public key to verify the validity of the signature includes If the signature verification confirms that the data indeed comes from the data provider; If the verification fails, the demander refuses to process the data packet and generates an exception warning; The step of calculating the hash value of the received ciphertext and comparing it with the hash value in the data packet includes: If the hash values are consistent, it means that the data has not been tampered with during transmission; If there is any inconsistency, the demander will consider the data invalid and record the exception.
8. A system using the energy data cross-chain intercommunication privacy enhancement method based on homomorphic encryption as described in any one of claims 1 to 7, characterized in that: Including application chain module, relay chain module, cross-chain smart contract module, cross-chain gateway module and homomorphic encryption and verification module; The application chain module is a local blockchain platform for data providers and data demanders, which stores, processes and manages data, provides a receiving endpoint for registration requests, stores user authority information, and supports the deployment and execution of smart contracts; The relay chain module receives and verifies the cross-chain data packets from the data provider, forwards the verified data packets to the application chain where the demander is located, and records the metadata of the cross-chain data transmission; The cross-chain smart contract module is used to assign user permissions and return information to the requester during the user registration phase, and to perform data access permission verification and control data encryption and transmission processes during the data interaction phase; The cross-chain gateway module is a module where the data demander initiates a registration request and a data access request through the cross-chain gateway, the data provider submits an encrypted data packet through the cross-chain gateway, and the relay chain sends the verified data packet to the target chain through the cross-chain gateway; The homomorphic encryption and verification module is a data demander that generates a homomorphic encryption public-private key pair. The data provider uses the public key to encrypt the data, generate a digital signature and hash value, and the data demander verifies the signature and hash value.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for enhancing privacy of cross-chain intercommunication of energy data based on homomorphic encryption as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for enhancing privacy of cross-chain intercommunication of energy data based on homomorphic encryption as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Block chain cross-chain data processing method, relay chain, application chain and cross-chain network
CN114615095A
Cross-chain data security sharing method and system based on multi-key homomorphic encryption
CN117640077A
Cross-chain data interaction privacy protection method based on homomorphic encryption
CN119026170A