Block chain and threshold homomorphic encryption-based power transaction bilateral sealing auction method, storage medium and equipment

By using blockchain and threshold homomorphic encryption technology in bilateral auction of power transactions, encrypted bids and distributed decryption are generated, and the problems of insufficient privacy protection, large communication and computing overhead and low robustness in power transactions are solved, and efficient and secure bilateral sealed auction of power transactions are achieved.

CN120046172APending Publication Date: 2025-05-27SOUTHEAST UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510204117.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The existing bilateral auction mechanism for power transactions has insufficient privacy protection, resulting in the possibility of leakage of private information such as quotes and power volume of both parties, and the problems of high communication and computing overhead and low robustness.

Method used

The bilateral sealed auction method of power transactions based on blockchain and threshold homomorphic encryption is adopted. The threshold encryption parameters are generated through blockchain smart contracts. The buyer and seller encrypt the bid and upload it to the blockchain. The smart contracts are aggregated and calculated and distributed decrypted to ensure that only participants and power trading centers that meet the threshold requirements can decrypt and count.

Benefits of technology

It realizes the security protection of bid information throughout the process, reduces the interaction between participants, reduces communication and computing overhead, and improves the robustness and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120046172A_ABST
    Figure CN120046172A_ABST
Patent Text Reader

Abstract

The invention discloses a power transaction bilateral sealing auction method based on a block chain and threshold homomorphic encryption, a storage medium and equipment, and the method comprises the steps: firstly, carrying out the initialization, enabling a power transaction center to initiate the auction, enabling a power buyer and a seller to join the auction according to the needs, and jointly generating the information, such as a threshold encryption parameter, through a block chain intelligent contract; secondly, bidding is carried out, the buyer / seller selects the acceptable highest / low price and determines the required / supplied electric quantity, and the required / supplied electric quantity is uploaded to the block chain after encryption; then aggregation bidding is carried out, the intelligent contract executes aggregation calculation according to the on-chain encryption bidding, a demand vector and a supply vector are obtained, and decryption is executed by combining all parties with the threshold requirement to obtain a check; and finally, a result is revealed, and the smart contract performs counting calculation and decryption again to obtain a winner sequence and then publishes the winner sequence. According to the method, the characteristics of threshold homomorphic encryption are fully utilized, and the method has the advantages of high operation speed, insurance data privacy protection and high robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer privacy protection, and mainly relates to a bilateral sealed auction method, storage medium and device for power trading based on blockchain and threshold homomorphic encryption. Background Art

[0002] In the power market, the bilateral auction mechanism is widely used in the competitive trading between power buyers and sellers. The bilateral auction allows both buyers and sellers to submit bids simultaneously, and completes the transaction by matching the optimal buying and selling prices, which can more effectively discover the market price, reduce transaction costs, and improve market liquidity. However, the traditional bilateral auction mechanism has deficiencies in privacy protection, which may lead to some serious consequences. For example, if the privacy information such as the bids and electricity quantities of the two trading parties is leaked, it may cause market participants to face economic losses and the loss of competitive advantages. At present, although some blockchain-based energy auction and trading systems provide a decentralized, open, transparent, traceable and tamper-proof trading environment, they also make the on-chain energy auction data vulnerable to attacks, thus leaking user privacy. In order to overcome the deficiencies of the traditional bilateral auction mechanism in privacy protection, the bilateral sealed auction mechanism came into being. The bilateral sealed auction requires both buyers and sellers to submit sealed bids, and the auctioneer determines the transaction price and the two trading parties according to the preset rules. This mechanism has further improved the privacy protection of the two trading parties, but some current solutions use complex cryptographic technologies to build the trading system, which will lead to complex communication costs and computational overheads. At the same time, the dependence of some solutions on a trusted third party (such as an auctioneer) also makes it not completely privacy-protected, because the privacy information will ultimately be exposed to the third party. There are also some solutions that support distributed encryption and decryption, and their auction processes rely on the full participation of all members. When a single point of failure occurs, the robustness of the system will be greatly reduced. Therefore, how to design an efficient and stable bilateral sealed auction scheme that meets the requirements of power data privacy protection is an urgent problem to be solved.

[0003] The patent "Microgrid Power Allocation Method Based on Blockchain" with the publication (announcement) number CN114565320A realizes power allocation by building an information network based on blockchain technology and relying on the centralized management method of super nodes and the clearing mechanism of bilateral auctions. However, in the calculation process, this method only protects user data by using the alternating iteration method and the security of the blockchain itself, and the bid values of each user are still transmitted and calculated in plaintext. After the auction ends, there will be data leakage, which can be used by malicious adversaries to infer the privacy of failed bidders.

[0004] The patent "A Distributed Energy Auction Method and System Based on Blockchain and Privacy Protection" with the publication number CN113657978A realizes the identity authentication of both electricity buyers and sellers and encrypted bidding through homomorphic encryption technology. At the same time, based on the secure multi-party computing technology on the blockchain, the matching and clearing of bilateral auctions are realized, which solves the contradiction between the characteristics of public and transparent data on the blockchain and the privacy protection requirements of distributed energy transactions. However, in this method, the encryption keys are all generated by the auctioneer, and the final secure sorting is also carried out by the auctioneer. Therefore, the private bidding data will still be exposed to the auctioneer, which is not complete privacy protection. At the same time, the secure multi-party computing technology used has a large number of interaction rounds, which will cause an excessive efficiency burden.

[0005] The patent "Power Trading Quotation Privacy Protection Method and System Based on Individual Differential Privacy" with the publication number CN113706332A first obtains the quotation information of auction participants through the existing bilateral auction mechanism and conducts the auction. Then, it will calculate the privacy leakage probability of each participant by using Bayesian inference. For those with a high probability of privacy leakage, differential privacy technology will be used for privacy protection. However, this method only protects some high-risk participants in the auction, rather than all participants. The privacy leakage of unprotected participants may expose information such as their economic level and future plans.

[0006] The above work uses the blockchain as a public secure channel, and with the help of technologies such as homomorphic encryption, secure multi-party computing, and differential privacy, realizes the allocation of distributed energy based on the existing bilateral auction framework. However, these methods still have the following problems: (1) The protection of participants' private bidding information is not comprehensive and throughout the process: The bidding information of some participants is not protected during the auction process, or the private bidding information of participants will be decrypted and exposed to third parties in the subsequent process of the auction, which will cause privacy leakage; (2) Low efficiency: A large number of interaction rounds and the communication and computing overhead caused by identity authentication and other calculations are heavy burdens, which is not conducive to the expansion of the number of large-scale participants. (3) Low robustness: When a single node fails, it will affect the correctness and fairness of the auction results. Seriously, it will directly lead to the termination of the auction process, resulting in a waste of a large amount of computing resources. Summary of the Invention

[0007] In view of the problems existing in the prior art, the present invention proposes a bilateral sealed auction method, storage medium and device for power trading based on blockchain and threshold homomorphic encryption. First, initialization is performed. The power trading center initiates this round of auction, and power buyers and sellers join this round of auction as needed. Through the blockchain smart contract, information such as threshold encryption parameters is jointly generated. Secondly, bidding is carried out. The buyer / seller selects the highest / lowest acceptable price and determines the required / supplied power quantity, encrypts it and uploads it to the blockchain. Then, aggregated bidding is carried out. The smart contract performs aggregated calculations based on the encrypted bids on the chain to obtain a demand vector and a supply vector, and then jointly decrypts with all parties required by the threshold to obtain the clearing point. Finally, the result is revealed. The smart contract calculates and decrypts again using the clearing point to obtain the winner sequence and then announces it. The method of the present invention makes full use of the characteristics of threshold homomorphic encryption, and has the advantages of fast operation speed, protecting the privacy of insured data and high robustness.

[0008] To achieve the above object, the technical solution adopted by the present invention is: a bilateral sealed auction method for power trading based on blockchain and threshold homomorphic encryption, including the following steps:

[0009] S1. Initialization: After the power trading center initiates this round of auction, power buyers and sellers join, and through the blockchain smart contract, threshold encryption parameters, price vectors and other public parameter information are jointly generated;

[0010] S2. Bidding: The buyer / seller selects the highest / lowest acceptable price according to the price vector and determines the required / supplied power quantity. After obtaining the bid vector, it is encrypted and uploaded to the blockchain;

[0011] S3: Aggregation: The smart contract performs aggregated calculations based on the encrypted bids on the chain to obtain a demand vector and a supply vector, jointly decrypts with all buyers / sellers required by the threshold, and finally receives the encrypted clearing point from the trading center;

[0012] S4. Revelation: The smart contract calculates the winning results of each buyer / seller through the result function according to the encrypted clearing point, and jointly decrypts again with all buyers / sellers required by the threshold. Finally, the trading center announces the winner results.

[0013] These four steps are cyclically executed in each round of auction.

[0014] As an improvement of the present invention, in the step S1, after the auction is started, the trading center and a number of buyers and sellers respectively generate homomorphic encryption private keys α i,0 and β i,0 , the smart contract respectively integrates the private public keys of the buyers and sellers uploaded to the chain and sends them to the power trading center. The power trading center randomly generates random numbers α c and β c as its own private key sk cand sk c ′, generate the common public key of the buyer and the common public key of the seller by combining the integration results of the power trading center:

[0015]

[0016] Among them, n is the number of power buyers, m is the number of power sellers, and g is the encryption generator.

[0017] As another improvement of the present invention, the specific steps of the step S2 bidding are as follows: The power buyer EB i Determine the bidding price according to the price vector, and determine the required power quantity to form a bidding vector b with the same length as the price vector i =[0, 0,..., 0, b i , 0,..., 0] T , where the position of b i corresponding to the price vector is the willing price of the power buyer EB i , and the magnitude of b i is the required power quantity; encrypt b i using the common public key pk to obtain and then upload it to the chain; The power seller ES i Determine the bidding price according to the price vector, and determine the available power quantity to form a bidding vector s with the same length as the price vector i =[0, 0,..., 0, s i , 0,..., 0] T , where the position of s i corresponding to the price vector is the willing price of the power seller ES i , and the magnitude of s i is the available power quantity; encrypt s i using the common public key pk' to obtain and then upload it to the chain.

[0018] As another improvement of the present invention, in the step S3, the smart contract performs homomorphic addition calculation on the encrypted bids of all power buyers on the chain to obtain a demand vector:

[0019]

[0020] Perform homomorphic addition calculation on the encrypted bids of all power sellers to obtain a supply vector:

[0021]

[0022] The smart contract jointly requires t power buyers meeting the threshold requirements to perform partial decryption on B * , and at the same time jointly requires t' power sellers meeting the threshold requirements to perform partial decryption on S *Perform partial decryption, send the partial decryption result to the power trading center, and the power trading center uses its own private key sk c and sk c ′ to perform complete decryption on B* and S * to obtain the clearing vector c, and finally use pk and pk′ to encrypt c respectively to obtain c * and c′ * , and upload them to the blockchain.

[0023] As another improvement of the present invention, in step S4,

[0024] For the buyer EB i , use the encrypted clearing point c * , and input its own encrypted bid into the result function w(), and calculate the encrypted winning bid result:

[0025]

[0026] where bcm i is a randomly generated matrix of the same order. When the winning bid results of all power buyers are calculated , t power buyers meeting the joint threshold requirement perform partial decryption and send the decryption result to the power trading center;

[0027] For the seller ES i , use the encrypted clearing point c′ * , and input its own encrypted bid into the result function w(), and calculate the encrypted winning bid result:

[0028]

[0029] where scm i is a randomly generated matrix of the same order. When the winning bid results of all power sellers are calculated , t′ power sellers meeting the joint threshold requirement perform partial decryption and send the decryption result to the power trading center.

[0030] As a further improvement of the present invention, in step S4, after the power trading center receives the partial decryption results from the power buyers and power sellers integrated by the smart contract, it uses its own private key to completely decrypt them. For the buyer EB i , decrypt its winning bid result to obtain a vector of length (k + 1), and determine whether there is a value of 0 among the (k + 1) values in the vector. If so, the buyer wins the bid, and the position where the 0 value is located is its clearing price; the values at other positions except 0 are the calculation results of random numbers;

[0031] For the electricity seller ES i , decrypt the winning bid result Check whether there is a 0 value in the vector value to judge the winning bid result.

[0032] To achieve the above object, the technical solution adopted by the present invention is also: a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the bilateral sealed auction method for electricity trading based on blockchain and threshold homomorphic encryption as described in any one of claims 1-6.

[0033] To achieve the above object, the technical solution adopted by the present invention is also: a computer device, including:

[0034] A memory for storing instructions;

[0035] A processor for executing the instructions, so that the computer device executes the bilateral sealed auction method for electricity trading based on blockchain and threshold homomorphic encryption as described in any one of claims 1-6.

[0036] Compared with the prior art, the beneficial effects of the present invention are:

[0037] (1) The method of the present invention protects the security of bids for all parties throughout the process. In the bidding stage, the encrypted bids submitted by each electricity buyer and electricity seller will not be decrypted during the entire auction process, and cannot be decrypted by a single participating party or several participating parties alone. It can only be jointly decrypted by the corresponding participating parties and the electricity trading center that meet the threshold requirements. Only the winning bidder's serial number is announced in the final auction result, and other relevant information and the losing bidders' bid information are protected from leakage.

[0038] (2) The overall efficiency of the solution of the present invention is high. The method of the present invention uses blockchain as a public security platform, reducing the interaction operations between participants. In the entire auction process, except for the initialization operation, the electricity buyer and the electricity seller only need to submit an encrypted bid and two partial decryption results to the blockchain once, with low communication costs. At the same time, the design of threshold encryption and decryption enables the decryption not to require all electricity buyers (sellers) to participate, improving the decryption efficiency and reducing the computational overhead.

[0039] (3) The robustness of the proposed solution of the present invention is greatly improved. The method of the present invention applies an improved distributed threshold homomorphic encryption system. In addition to ensuring the privacy and security of the bids of each electricity buyer and seller during the bidding process, when performing distributed decryption subsequently, it is not necessary for all buyers or sellers to participate in the decryption. Only when the threshold requirement is met and combined with the necessary private key of the electricity trading center can the decryption be completed. Therefore, when individual electricity buyers or sellers have failures, it will not affect the overall auction process. At the same time, the necessary private key of the electricity trading center also solves the problem of collusion among buyers or sellers, greatly improving the robustness of the solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 is the flowchart of the steps of the bilateral sealed auction method for electricity trading based on blockchain and threshold homomorphic encryption of the present invention;

[0041] Figure 2 is the clearing curve graph of the bilateral auction in Embodiment 2 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0042] The present invention will be further clarified below in conjunction with the drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and not to limit the scope of the present invention.

[0043] Embodiment 1

[0044] A bilateral sealed auction method for electricity trading based on blockchain and threshold homomorphic encryption, as Figure 1 shown, involves blockchain, smart contracts, an electricity trading center, several electricity buyers, and several electricity sellers, and specifically includes the following steps:

[0045] Step S1, Initialization: After the electricity trading center initiates this round of auction, the electricity buyers and sellers join this round of auction as needed, and jointly generate threshold encryption parameters, price vectors, and other public parameter information through the blockchain smart contract.

[0046] The electricity trading center starts this round of auction, and relevant electricity buyers and sellers join this round of auction as needed. The purpose is that auction participants need to enter the same blockchain network to carry out subsequent auction activities; then the trading center and several buyers each generate a homomorphic encryption private key, and then jointly generate the corresponding threshold homomorphic encryption public key with the help of the blockchain and smart contract. The trading center and the sellers do the same operation, and then the blockchain continues to generate other public parameters including the price vector and upload them to the chain for use in the bidding stage.

[0047] The joint generation of public parameters specifically refers to using the basic parameters issued by the electricity trading center to interact with each electricity buyer and seller through the blockchain smart contract to jointly generate the homomorphic encryption public key, price vector, and bidding deadline required for subsequent auctions.

[0048] Step S2, Bidding: The buyer / seller selects the highest / lowest acceptable price according to the price vector, determines the required / supplied power quantity, encrypts the obtained bidding vector, and uploads it to the blockchain.

[0049] Each buyer selects the highest acceptable price and determines the power quantity to be purchased, encrypts the bid using the buyer's public key generated in Step S1 and uploads it to the chain, while each seller selects the lowest acceptable price and determines the power quantity that can be supplied, encrypts the bid using the seller's public key and uploads it to the chain.

[0050] The buyer and seller select the acceptable price according to the price vector and determine the corresponding power quantity. Specifically, it means that the electricity buyer selects the lowest acceptable bid according to the price vector determined in Step S1 and determines the power quantity it needs, while the electricity seller selects the highest acceptable bid and determines the power quantity it can supply; the obtained bidding vector is encrypted and uploaded to the blockchain, specifically, it means that the determined bid is encrypted using the homomorphic encryption public key jointly generated in Step S1, and after obtaining the ciphertext bid, it is uploaded to the blockchain.

[0051] Step S3, Aggregation: The smart contract performs aggregation calculations according to the encrypted bids on the chain, obtains the demand vector and the supply vector, and then jointly with the buyers (sellers) required by the threshold requirement performs distributed decryption and finally receives the encrypted clearing point from the trading center.

[0052] S31: The smart contract performs summation calculations respectively according to the buyer's encrypted bid and the seller's encrypted bid on the blockchain, and can obtain the demand vector and the supply vector in the ciphertext state; the smart contract performs aggregation calculations according to the encrypted bids on the chain to obtain the demand vector and the supply vector, specifically, it means that homomorphic addition calculations can be respectively performed on the buyer's encrypted bid and the seller's encrypted bid obtained in Step S2, so as to correspondingly obtain the demand vector and the supply vector in the encrypted state;

[0053] S32: The smart contract first jointly with the number of buyers (sellers) required by the threshold requirement performs partial decryption on the demand vector (supply vector). Specifically, the smart contract jointly with the electricity buyers required by the threshold requirement performs partial decryption on the demand vector, and at the same time jointly with the electricity sellers required by the threshold requirement performs partial decryption on the supply vector, and sends the obtained result to the electricity trading center;

[0054] S33: After sending the obtained partial decryption result to the trading center, the trading center performs complete decryption on the demand vector and the supply vector to obtain the clearing point, and then encrypts the clearing point and uploads it to the chain; receiving the encrypted clearing point from the trading center, specifically, it means that after the electricity trading center receives the partially decrypted demand vector and supply vector, it performs complete decryption on them using its own private key, and can obtain the clearing point through the clearing curve, and then encrypts the clearing point using the shared public key and returns it to the blockchain.

[0055] Step S4, Revelation: The smart contract calculates the winning results of each buyer / seller according to the encrypted bid count through the result function, and then jointly executes distributed decryption with the required number of buyers / sellers for the threshold. Finally, the trading center announces the winner results.

[0056] S41: The smart contract calculates the winning results of each buyer / seller in the encrypted state according to the encrypted bid count and the encrypted bid values of each buyer and seller through the result function. Specifically, it means that the encrypted winning results of each electricity buyer and electricity seller can be calculated through the result function. The winning result only contains the bid information of the winner, and the bid information of the loser will be hidden.

[0057] S42: The smart contract jointly decrypts the winning results of the buyer / seller with the required number of buyers / sellers for the threshold. The decryption process is the same as step S32. The smart contract jointly decrypts the winning results of all electricity buyers with the required number of electricity buyers for the threshold, and at the same time jointly decrypts the winning results of all electricity sellers with the required number of electricity sellers for the threshold, and sends the results to the electricity trading center.

[0058] S43: After the trading center fully decrypts the winning results of both parties, it uploads the winner sequence to the blockchain to announce the winner results. Specifically, it means that after receiving the partially decrypted winning results, the electricity trading center uses its private key to fully decrypt them to obtain the results of the winners, and finally returns the winner numbers to the blockchain. After each buyer and seller confirm that there is no error, the electricity trading center executes subsequent delivery and power allocation.

[0059] Embodiment 2

[0060] This embodiment provides a bilateral sealed auction method for electricity trading based on blockchain and threshold homomorphic encryption. Using the fabric blockchain as the carrier, the smart contract as a trusted third-party automated execution program, and the electricity trading center as a necessary participant, it protects the bid information of electricity buyers and sellers based on the price vector using the (t + 1, n + 1) CL (a homomorphic encryption algorithm designed by Castagno and Laguillaumie in 2015 that supports homomorphic addition) threshold homomorphic encryption. After homomorphic addition operation, the supply vector B * and the demand vector B * will be obtained, and then decrypt B through the specified number of thresholds * 、S *And through the clearing curve, the clearing point c can be obtained. Using the clearing point and through the result function w(), the winning results of each electricity buyer and seller can be calculated. Finally, the power trading center announces the winning bidders. In this method, the number of communication interaction rounds is small, and the calculation overhead based on threshold CL encryption is low, which improves the overall auction efficiency. At the same time, the encryption protection of private bidding information is throughout the process. There is no decryption of private bids during the auction process. The decryption key is distributed among electricity buyers, sellers, and the power trading center, and there is no individual performing the decryption operation alone, that is, there is no situation of privacy leakage. In this embodiment, EB i represents the i-th electricity buyer, and ES i represents the i-th electricity seller, and * represents the encrypted result value.

[0061] A bilateral sealed auction method for electricity trading based on blockchain and threshold homomorphic encryption specifically includes the following steps:

[0062] Step S1, initialization: After the power trading center initiates this round of auction, electricity buyers and sellers join this round of auction as needed, and jointly generate the (t + 1, n + 1) CL threshold encryption public key of the buyer and the (t′ + 1, n + 1) CL threshold encryption public key of the seller through the blockchain smart contract. At the same time, the price vector π = [π, π + d, π + 2d, …, π + kd] is announced, where π is the minimum selectable price, rising in gradient of d in sequence to (π + kd) as the maximum selectable price, and the sizes of π, k, and d are determined according to the actual situation. Finally, the bidding deadline T is announced end .

[0063] S11: After the power trading center initiates this round of auction, n electricity buyers and m electricity sellers have electricity purchase and sale demands and join this round of auction. At the same time, they obtain their own labels according to the order of joining;

[0064] S12: The power trading center announces the relevant parameters g of CL encryption. The buyer EB i selects a random number α i,0 in the legal domain as its own private key, and at the same time randomly generates a polynomial of degree (t - 1):

[0065] h i (x) = α i,0 + α i,1 ·x + α i,2 ·x 2 + … α i,t-1 ·x t-1 ;

[0066] where α i,0 is the private key, and α i,1 to α i,t-1is the generated random number; substitute x = 1, 2, … n into h i (x) to obtain h i (1), h i (2), …, h i (n), retain one's own part h i (i), and the other h i (1), h i (2), …, h i (i - 1), h i (i + 1), …, h i (n) and chain them together; all n buyers perform this operation simultaneously;

[0067] S13: After all buyers complete step S12, buyer EB i downloads and obtains the polynomial calculation values h 1 (i), h 2 (i), …, h i-1 (i), h i+1 (i), …, h n (i) of the other (n - 1) buyers for themselves, and combines their own retained part h i (i) to calculate the private key fragment:

[0068]

[0069] S14: When the electricity buyer performs step S12, the electricity seller simultaneously executes the operation. Seller ES i selects a random number β in the legal domain i,0 as its own private key, and randomly generates a polynomial of degree (t′ - 1):

[0070] h i ′(x) = β i,0 + β i,1 · x + β i,2 · x 2 + … β i,t′-1 · x t-1 ;

[0071] where β i,0 is the private key, and β i,1 to β i,t′-1 are the generated random numbers; substitute x = 1, 2, … m into h i (x) to obtain h i ′(1), h i ′(2), …, h i ′(m), retain one's own part h i ′(i), and the other h i ′(1), h i ′(2), …, hi ′(i - 1), h i ′(i + 1), …, h i ′(m), and chain them together; all m sellers perform this operation simultaneously;

[0072] S15: After all sellers complete step S14, seller ES i downloads the polynomial calculation values h 1 ′(i), h 2 ′(i), …, h i-1 ′(i), h i+1 ′(i), …, h m ′(i), and combines it with the part of h i ′(i) it retains to calculate the private key fragment:

[0073]

[0074] S16: The smart contract separately integrates the private and public keys uploaded by the buyer and seller and sends them to the power trading center. The power trading center randomly generates random numbers α c and β c as its own private key sk c and sk c ′, and combines the integration results of the power trading center to generate the common public key of the buyer and the common public key of the seller:

[0075]

[0076] At the same time, determine the price vector π = [π, π + d, π + 2d, …, π + kd] and the tender deadline T end , and finally chain and announce {pk, pk′, π, T end}.

[0077] Step S2, Tendering: The power buyer / seller selects the acceptable lowest bid / highest bid according to the price vector determined in step S1, determines the required / supplied electricity quantity, and encrypts it with the common public key and then chains it.

[0078] Power buyer EB i determines the tender price according to the price vector, determines the required electricity quantity, and forms a tender vector b i = [0, 0, …, 0, b i , 0, …, 0] T , where the position of b i corresponding to the price vector π is the willing price of power buyer EB i b iThe size is the required power consumption; then use the shared public key pk to encrypt b i to obtain and then upload it to the chain. All buyers perform this operation before T end .

[0079] Power seller ES i At the same time, determine the bidding price according to the price vector and determine the available power supply to form a bidding vector s with the same length as the price vector i = [0, 0, …, 0, s i , 0, …, 0] T , where the value at the position corresponding to s i in the price vector π is the willing price of ES i , and the size of s i is the available power supply; then use the shared public key pk’ to encrypt s i to obtain and then upload it to the chain. All sellers perform this operation before T end .

[0080] Step S3, Aggregation: The smart contract performs aggregation calculations based on the encrypted bids on the chain to obtain the demand vector B * and the supply vector S * , and then jointly execute decryption by the parties required by the threshold and obtain the clearing point c through the clearing curve

[0081] The smart contract performs homomorphic addition calculations on the encrypted bids of all power buyers on the chain to obtain the demand vector:

[0082]

[0083] Performs homomorphic addition calculations on the encrypted bids of all power sellers to obtain the supply vector:

[0084]

[0085] The smart contract jointly performs partial decryption of B * by t power buyers required by the threshold, and at the same time jointly performs partial decryption of S * by t′ power sellers required by the threshold, and sends the partial decryption results to the power trading center. The power trading center uses its own private keys sk c and sk c ′ to perform full decryption on B * and S * to obtain the clearing vector c, and finally encrypt c using pk and pk′ to obtain c * and c′ * respectively, and upload them to the blockchain

[0086] Step S4, Revelation: The smart contract calculates the encrypted winning bid results of the electricity buyer and the electricity seller respectively using the encrypted clearing points obtained in Step S3, and finally decrypts the results jointly with the threshold-required number of electricity buyers, electricity sellers, and the electricity trading center.

[0087] For the buyer EB i , using the encrypted clearing point c * , and inputting its own encrypted bid into the result function w(), the encrypted winning bid result is calculated as:

[0088]

[0089] where bcm i is a randomly generated matrix of the same order used to obfuscate the final calculation result. When all the winning bid results of the electricity buyers are calculated, t electricity buyers required by the threshold are jointly used to perform partial decryption again, and the decryption result is sent to the electricity trading center.

[0090] For the seller ES i , using the encrypted clearing point c′ * , and inputting its own encrypted bid into the result function w(), the encrypted winning bid result is calculated as:

[0091]

[0092] where scm i is a randomly generated matrix of the same order used to obfuscate the final calculation result. When all the winning bid results of the electricity sellers are calculated, t′ electricity sellers required by the threshold are jointly used to perform partial decryption again, and the decryption result is sent to the electricity trading center.

[0093] After receiving the partial decryption results from the electricity buyers and electricity sellers integrated by the smart contract, the electricity trading center uses its own private key to fully decrypt them. For the buyer EB i , decrypting its winning bid result also obtains a vector of length (k + 1). It is judged whether there is a value of 0 among the (k + 1) values in the vector. If so, the buyer wins the bid, and the position where the 0 value is located is its clearing price. And due to the existence of the obfuscating random matrix, the values at other positions except 0 are all calculation results of random numbers. For the non-winning buyers, their (k + 1) values are all random result values, so no privacy information of the losers will be leaked. For the electricity seller ES i , similarly decrypting its winning bid result to check whether there is a 0 value in the vector to judge its winning bid result.

[0094] After the power trading center calculates the winning results of all power buyers and power sellers, it publishes the winning bidder numbers on the blockchain. After everyone confirms that their winning results are correct, the power center will further execute the next stage of delivery and power allocation work.

[0095] In summary, the present invention utilizes the secure and reliable public channel of the blockchain, with smart contracts as trusted third-party automated execution programs, uses threshold homomorphic encryption technology to protect the privacy of bids, applies and improves the Brandt sealed auction framework into a bilateral sealed auction scheme. First, in the initialization stage, the power trading center initiates the auction, and power buyers and sellers join the auction as needed, and jointly generate information such as threshold encryption parameters through the blockchain smart contract; then comes the bidding stage, where both the buyer and the seller select acceptable prices and determine the corresponding electricity quantities, encrypt them and upload them to the blockchain; subsequently, aggregation is carried out, and the smart contract performs aggregation calculations based on the encrypted bids on the chain to obtain the demand vector and supply vector, and then jointly decrypts with all parties required by the threshold to obtain the clearing point; finally, in the revelation stage, the smart contract calculates and decrypts again using the clearing point to obtain the winner sequence and then publishes it. After verification, the subsequent delivery and power allocation are executed. The method of the present invention runs fast, can protect the privacy of insured data and has high robustness, and is suitable for actual needs.

[0096] It should be noted that the above content only illustrates the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. For those of ordinary skill in the art of this technology, without departing from the principle of the present invention, several improvements and refinements can still be made, and these improvements and refinements all fall within the protection scope of the claims of the present invention.

Claims

1. A bilateral sealed auction method for power trading based on blockchain and threshold homomorphic encryption, characterized by: The steps include: S1. Initialization: After the power trading center initiates this round of auction, power buyers and sellers join in and jointly generate threshold encryption parameters, price vectors and other public parameter information through blockchain smart contracts; S2. Bidding: The buyer / seller selects the highest / lowest acceptable price based on the price vector and determines the required / supplied electricity. After obtaining the bidding vector, it is encrypted and uploaded to the blockchain. S3, Aggregation: The smart contract performs aggregation calculation based on the encrypted bids on the chain, obtains the demand vector and the supply vector, performs distributed decryption on the buyers / sellers with the joint threshold requirements, and finally receives the encrypted clearing point from the trading center; S4. Reveal: The smart contract calculates the winning results of each buyer / seller through the result function based on the encrypted clearing point, and then performs distributed decryption again with each buyer / seller with threshold requirements. Finally, the trading center announces the winning result.

2. The bilateral sealed auction method for power trading based on blockchain and threshold homomorphic encryption according to claim 1, characterized in that: In step S1, after the auction starts, the trading center and several buyers and sellers each generate a homomorphic encryption private key α i,0 and β i,0 The smart contract integrates the private and public keys of the buyer and seller on the chain and sends them to the power trading center. The power trading center randomly generates a random number α within the legal domain. c and β c As your own private key sk c and sk c ′, combined with the integration results of the power trading center, generate the buyer's shared public key and the seller's shared public key: Among them, n is the number of electricity buyers, m is the number of electricity sellers, and g is the cryptographic generator.

3. The bilateral sealed auction method for power trading based on blockchain and threshold homomorphic encryption according to claim 1, characterized in that: The specific steps of bidding in step S2 are: the electricity buyer EB i Determine the bid price based on the price vector and determine the required electricity to form a bid vector b with the same length as the price vector i =[0,0,…,0,b i ,0,…,0] T , where b i The position corresponding to the price vector is the electricity buyer EB i Desired price, b i The size of b is the required power; use the shared public key pk to i Encrypted Later on the chain; electricity seller ES i Determine the bid price based on the price vector and determine the available power to form a bid vector s with the same length as the price vector i =[0,0,…,0,s i ,0,…,0] T , where s i The position corresponding to the price vector is the electricity seller ES i Desired price, s i The size of is the available power; Use the shared public key pk′ to i Encrypted Rear winding.

4. The bilateral sealed auction method for power trading based on blockchain and threshold homomorphic encryption as claimed in claim 3, characterized in that: In step S3, the smart contract performs homomorphic addition calculation on the encrypted bids of all electricity buyers on the chain to obtain the demand vector: Performing homomorphic addition on the encrypted bids of all electricity sellers yields the supply vector: Smart contract joint threshold requirements of t electricity buyers to B * Perform partial decryption and combine the threshold requirements of t′ electricity sellers to S * Perform partial decryption and send the partial decryption results to the power trading center, which uses its own private key sk c and sk c ' for B * and S * Perform full decryption to obtain the clearing vector c, and use pk and pk′ to encrypt c to obtain c * and c′ * , uploaded to the blockchain.

5. The bilateral sealed auction method for power trading based on blockchain and threshold homomorphic encryption as claimed in claim 4, characterized in that: In the step S4, For Buyer EB i , using encryption to clear point c * , and enter your own encrypted bid Go to the result function w() and calculate the encrypted winning result: Among them, bcm i is a random matrix of the same order generated. When the winning bids of all electricity buyers are calculated, After that, the t electricity buyers with the joint threshold requirements perform partial decryption and send the decryption results to the power trading center; For Sellers i , using encryption to calculate the clearing point c′ * , and enter your own encrypted bid Go to the result function w() and calculate the encrypted winning result: Among them, scm i is a random matrix of the same order generated. When the winning bids of all electricity sellers are calculated, Afterwards, the t′ electricity sellers with the joint threshold requirement perform partial decryption and send the decryption results to the power trading center.

6. The method for bilateral sealed auction of power transactions based on blockchain and threshold homomorphic encryption according to claim 5, characterized in that: In step S4, after receiving the partial decryption results from the power buyer and the power seller integrated in the smart contract, the power trading center uses its own private key to fully decrypt them. i , decrypt the bid results Get a vector with a length of (k+1), and determine whether there is a value of 0 among the (k+1) values ​​in the vector. If so, the buyer wins the bid, and the position of the 0 value is its clearing price; the values ​​of other positions except 0 are the calculated results of random numbers; For electricity sellers ES i , decrypt the bid results Check whether there is a 0 value in the vector value to determine its bid result.

7. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is executed by a processor to implement a bilateral sealed auction method for electricity trading based on blockchain and threshold homomorphic encryption as described in any one of claims 1-6.

8. A computer device, characterized in that: include: A memory for storing instructions; A processor is used to execute the instructions so that the computer device executes the bilateral sealed auction method for electricity trading based on blockchain and threshold homomorphic encryption as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Distributed energy auction method and system based on block chain and privacy protection

    CN113657978A

  • Power transaction quotation privacy protection method and system based on individual differential privacy

    CN113706332A

  • Micro-grid power distribution method based on block chain

    CN114565320A