Alliance chain privacy protection method based on aggregated signatureTechnical Field
The invention relates to a federation chain privacy protection method based on a polymerization signature technology, and belongs to the technical field of block chain privacy protection.
Background
Block chains are used in more and more fields, and are essentially a distributed chain-like data structure. Because the blockchain has the characteristics of transparency, traceability, decentralization and non-falsification, the blockchain can complete the task of constructing a trust network at a lower cost, so that the blockchain can be utilized by many fields to realize safe and reliable transactions, such as energy transactions and the like. Meanwhile, since the federation chain is a block chain for realizing partial decentralization, which is formed by an organization consisting of a plurality of entities, only authorized nodes can join the federation chain, and the consensus of the ledger is completed through a set of predetermined nodes, the execution speed of the federation chain is higher than that of a public chain. Therefore, the alliance chain is more widely applied and is quite suitable to be used as a platform for energy trading.
However, due to the transparent nature of blockchain ledger information disclosure, there is an increased risk of privacy being revealed while the problem is solved with blockchains. Because the ledger for recording transactions on the blockchain is completely public on the blockchain network, it is easier for an attacker to obtain ledger information on the chain, thereby obtaining transaction records of all users, which may cause privacy disclosure.
In order to solve the privacy disclosure problem of the energy transaction system based on the alliance chain, a safe user energy transaction information privacy protection method must be found.
Disclosure of Invention
The invention aims to provide a federation chain privacy protection method based on a collective signature, aiming at the technical problem that the privacy of a user may be leaked due to the public and transparent account book information in an energy transaction system based on the federation chain, so that the real transaction distribution of the user can be hidden, and the risk of the privacy leakage of the user is reduced.
The innovation points of the invention are as follows: by adopting a one-to-many energy account matching mechanism, the privacy protection of the user is realized on the premise of not influencing the transaction efficiency of the alliance chain. Meanwhile, the security of the one-to-many energy account information is protected by adopting the aggregated signature, and the storage requirement and the communication overhead of the user in the transaction process are reduced, so that the practicability of the method is improved.
The object of the invention is solved by the following technical solutions.
First, the following definitions are explained:
definition 1: federation link network
Refers to an infrastructure network for energy transactions. The nodes of the infrastructure network include token banks, energy storage pools, and transaction entities.
Definition 2: bank of tokens
The method is a node for realizing acquisition of token for energy sale of a user and segmentation and hiding of a real transaction record of the user in a alliance chain network.
Definition 3: energy storage pool
Refers to a node in a alliance-link network for realizing energy storage.
Definition 4: transaction entity
Refers to a user in a federation chain-based energy transaction system, who is a seller of energy.
A federation chain privacy protection method based on an aggregation signature comprises the following steps:
step 1: the user transmits energy to the energy storage pool closest to the user and sends a sale request.
Step 2: the energy storage pool receives the energy transmitted by the user, meanwhile, the actual volume V of the energy transmitted by the user is counted, and an exchange rate R is set for the energy transaction, wherein the value range of the R is 0-1. The actual energy volume value V and exchange rate value R are then signed and sent to the token bank.
And step 3: and the token bank verifies whether the signature of the energy transaction pool is legal or not, if the signature is illegal, the token bank rejects the request of the energy storage pool, the whole process is ended, and if the signature is legal, the next operation is carried out.
And 4, step 4: the token bank generates a token TO according TO the received energy volume value V and the exchange rate R, and the calculation formula is that TO is V (1-R). And then, the token bank judges whether a new account needs to be generated or not according to the historical energy transaction information of the latest account of the user through a prediction value generated by the prediction function.
Preferably, the generation of the predicted value is obtained by substituting all historical energy trading values of the latest account of the user and all historical energy trading values of the active accounts in the system into the prediction function, and setting parameters for the function according to the original experience. The active account is judged according to a preset account lowest energy trading value, if the accumulated energy trading value of one account is larger than or equal to the value, the account belongs to the active account, and if not, the account belongs to the inactive account.
The prediction function T (Si) is:
T(Si)=a*(Eei-1+b(Eri-1-Eei-1))*T (1)
wherein a is a weight value; b is a weighted value, and the value range of b is between 0 and 1; eei-1The energy transaction estimation amount of the ith-1 th time of the seller account is represented by the following calculation formula: eei=Eei-1+b(Eri-1-Eei-1),EeiAn estimate representing the energy transaction amount at the ith energy transaction of the seller account, Eri-1An actual value representing the energy transaction amount at the i-1 st energy transaction of the seller account; t is a time parameter for determining the value of the prediction function.
And 5: the token bank compares the predicted value with the actual energy value of the account added with the transaction amount, if the predicted value is more than or equal to the actual value, the existing account is still used for recording the transaction, and step 7 is executed; otherwise, a new account is created for the user to record the transaction, and then step 6 is performed.
Step 6: the token bank encrypts the mapping relationship from the user to the newly generated account and generates an aggregated signature for the mapping relationship and the original ciphertext of the mapping relationship from the user to the account. Then, the mapping relation of the stored user to all accounts is updated.
Specifically, step 6 includes the steps of:
step 6.1: the token bank sends a request to the user asking the user to send their stored original user-to-account mapping information cryptogram that has been encrypted by the token bank and the token bank's aggregated signature on the cryptogram.
Step 6.2: the token bank verifies that the aggregated signature is legitimate. If the illegal message is illegal, the user is required to resend the message; and if the signature is legal, giving approval and storing the encrypted user-to-account mapping information ciphertext sent by the user, and storing the aggregated signature.
Step 6.3: the token bank encrypts the mapping relationship between the user and the newly created account and signs the ciphertext information.
Preferably, the encryption is implemented using symmetric encryption techniques.
Step 6.4: and the token bank carries out the aggregation operation again on the newly generated signature and the aggregation signature sent by the user to generate a new aggregation signature.
Step 6.5: the token bank replaces the stored encrypted information from the original user to the latest account in the token bank by the encrypted mapping information from the user to the new account.
Step 6.6: and the token bank sends all the current user-to-account mapping relation pairs of the user and the aggregated signature of the ciphertext to the user together for storage, and reminds the user to update and store the original user-to-account mapping relation.
And 7: the bank of tokens deposits the user's tokens into the correct account according to the result of step 5.
And 8: the transaction data is linked up.
Advantageous effects
Compared with the prior art, the method of the invention has the following beneficial effects:
1. in the method, a method for changing the real distribution of the user energy transaction on the alliance chain is constructed. In order to protect the privacy of the user, the transaction distribution trend of the user in the adjacent energy transaction system recorded on the block chain account book is hidden through a privacy protection method based on noise, and the real energy transaction distribution trend recorded on the block chain account book is hidden through introducing a one-to-many account splitting mode on the premise of not influencing the transaction efficiency, so that the possibility of user privacy disclosure is reduced.
2. The method of the invention ensures the integrity and the correctness of the mapping relation between the user and the account when the bank of the token updates the mapping relation between the user and the account by adopting the aggregated signature technology. Compared with the traditional scheme of mapping a user to an account by a signature, the storage requirement and communication overhead in the user transaction process can be reduced by adopting the aggregated signature, so that the practicability of the scheme is improved.
Drawings
FIG. 1 is a schematic flow diagram of the process of the present invention.
Detailed Description
The method of the present invention is further described in detail below with reference to the drawings and examples.
Examples
The characters involved in the method in this embodiment are as in table 1:
TABLE 1 the method of the present embodiment relates to character description
As shown in fig. 1, a federation chain privacy protection method based on an aggregation signature technology.
Specifically, this embodiment details the process of implementing a transaction by a user in an energy transaction scenario on a federation chain. In a nearby energy trading scene, when a user sells redundant energy, a token bank in a alliance chain network stores the transmitted energy, the token bank generates tokens according to the volume of the energy, and a specific account stored in the token of the current trading is determined according to a predicted value obtained from a historical trading record of the account of the user. Meanwhile, when a new account is created, the token bank updates the user-to-account mapping information.
The embodiment describes a specific operation of changing the real transaction distribution of the users in the alliance chain by adopting the method of the invention, and the specific operation comprises the following processes:
step 1: user a transfers energy to the energy storage pool closest to it and sends a sell request.
Step 2: the energy storage pool receives the energy transmitted by the user, meanwhile, the actual volume V of the energy transmitted by the user A is counted, the exchange rate R is set for the energy transaction, and the actual energy volume value V and the exchange rate value R are signed and then sent to the token bank.
And step 3: the token bank verifies whether the signature of the energy transaction pool is legal or not, if the signature is illegal, the request of the energy storage pool is rejected, and the whole process is ended; and if the code is legal, performing the next operation.
And 4, step 4: the token bank generates a token TO according TO the received energy volume value V and the exchange rate R, and the calculation formula is as follows: TO ═ V ═ 1-R. And then the bank of the token calculates the predicted value of the energy transaction of the account by using a prediction function according to the historical energy transaction information of the latest account of the user A.
And 5: the token bank compares the predicted value with the account actual energy value V added with the transaction amount, if the predicted value is larger than or equal to the actual value, the existing account is still used for recording the transaction, and the next step is skipped; otherwise, a new account is created for the user to record the transaction.
Specifically, whether a new account needs to be generated is determined by a boundary value B (i.e., a predicted value) generated by a prediction function: t (si) ═ a (E)ei-1+b(Eri-1-Eei-1) T, wherein a is a weight value, Eei-1The estimate of the ith-1 energy transaction of the seller account is represented by the formula Eei=Eei-1+b(Eri-1-Eei-1) And b is the weight value, and the value range of b is between 0 and 1.
The method for generating the account energy transaction amount boundary value specifically comprises the following steps:
the input includes: ei, a, b, and c, all historical sales records for the seller s, and historical energy sales records for all accounts of the token bank.
The output includes: b is
1: all transaction records do for s
2: e | s ← Σ ei/N (s)// calculating average monthly energy transaction amount for seller account
3:end for
4: for each active account do
5: calculating an average value E | S of energy transactions per month
6:end for
7: computing T ← (E | S × c)/E | S
8: reading the energy transaction value ei of the input request, the parameters a and b and the previous i-1 historical energy transaction values of the seller account;
9: utilizing E according to the previous i-1 historical energy transaction values of the seller accountei=Eei-1+b(Eri-1-Eei-1) Calculated ith energy transaction estimate Eei;
10: will EeiSubstituting into the formula t (si) ═ a × EeiCalculating B by T;
11: returning the boundary value B
Step 6: the token bank encrypts the mapping relation from the user A to the newly generated account, generates an aggregated signature with the original ciphertext of the mapping relation from the user A to the account, and then updates and stores the mapping relation from the user A to all accounts.
This stage corresponds to step 6 in the summary of the invention, and specifically includes the following substeps:
step 6.1: the token bank sends a request to user a asking user a to send its stored original user-to-account mapping information cryptogram that has been encrypted by the token bank and the token bank's aggregated signature on the cryptogram.
Step 6.2: the token bank verifies whether the aggregated signature is legal or not, and if the aggregated signature is illegal, the user A is required to resend the aggregated signature; if the signature is legal, the encrypted user-to-account mapping information ciphertext sent by the user A is approved and stored, and the aggregated signature is stored at the same time.
Step 6.3: and the token bank encrypts the mapping relation between the user A and the newly generated account and signs the ciphertext information.
Step 6.4: and the token bank carries out the aggregation operation again on the newly generated signature and the aggregation signature sent by the user A to generate a new aggregation signature.
Step 6.5: the token bank replaces the stored encrypted information from the user A to the latest account in the token bank by the encrypted mapping information from the user A to the new account.
Step 6: and the token bank sends all the current ciphertext of the mapping relation pair from the user to the account of the user A and the aggregated signature of the ciphertext to the user A together for storage, and reminds the user A to update and store the original mapping relation from the user to the account.
And 7: the bank deposits the token of the user A into the correct account according to the result of step 5.
And 8: the transaction data is linked up.