A gradient aggregation federated learning method based on zero-knowledge proof and blockchain technology
By combining zero-knowledge proof and blockchain technology, verifying the correctness of global models in federated learning and recording the hash value of the encryption model update, the challenges in model verification, privacy protection and data integrity in federated learning are solved, and efficient, secure and transparent distributed learning is achieved.
Patent Information
- Application Number
- CN202510023668.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2045-01-07
AI Technical Summary
Existing federated learning approaches have challenges in model validation, privacy protection, system transparency and data integrity, especially in data privacy breaches and single point of failure risk.
Combining zero-knowledge proof and blockchain technology, the correctness of the global model is verified through zero-knowledge proof, and the hash value updated by the encryption model is recorded through blockchain to improve data integrity and system transparency.
It realizes verification of model updates without revealing specific data details, protects data privacy, reduces the risk of single point of failure, and improves the transparency and data integrity of the system.
Smart Images

Figure CN119420489B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a gradient aggregation federated learning method based on the combination of zero-knowledge proof and blockchain technology, belongs to the field of distributed machine learning, and involves federated learning, privacy protection and data security technology. Background Art
[0002] With the rapid development of artificial intelligence and big data technologies, federated learning, as a cutting-edge distributed machine learning method, has attracted widespread attention for its ability to protect data privacy. Federated learning allows multiple participants to train models locally and collaboratively train global models by sharing model updates, avoiding direct sharing of original data, thereby effectively protecting data privacy. However, current federated learning methods still face many challenges in terms of model verification, privacy protection, system transparency, and data integrity.
[0003] Traditional federated learning systems usually rely on centralized servers for model aggregation and verification. Although this approach can achieve the aggregation of model updates, it also introduces the risk of single point failure and the potential risk of data privacy leakage. In addition, as the number of participants increases, the complexity of model aggregation and verification also increases significantly, which places higher requirements on the security and efficiency of the system.
[0004] Zero-knowledge proof technology, especially zk-SNARK (zero-knowledge succinct non-interactive proof), provides an effective means to verify the correctness of calculations without leaking specific data. This technology can effectively protect data privacy while ensuring the correctness of the model update process. On the other hand, blockchain technology, due to its decentralized and tamper-proof characteristics, can improve the transparency and data integrity of the system. By recording and verifying the hash value of the model update on the blockchain, it can effectively prevent data tampering and ensure the transparency of the system.
[0005] Although zero-knowledge proof and blockchain technology each have obvious advantages, how to effectively combine these two technologies to solve the privacy protection and model verification problems in federated learning remains a challenge that needs to be solved. Existing solutions often have a trade-off between privacy protection and system efficiency, and lack a comprehensive solution that can simultaneously meet data privacy, system transparency, and data integrity. Therefore, exploring a federated learning method that organically combines zero-knowledge proof and blockchain technology to achieve secure, efficient, and transparent distributed learning is an important direction of current research. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a gradient aggregation federated learning method based on the combination of zero-knowledge proof and blockchain technology. By combining zero-knowledge proof and blockchain technology, the limitations of traditional methods in privacy protection and model verification are broken. The method uses zero-knowledge proof to verify the correctness of the global model, ensuring the transparency and privacy of the aggregation process without leaking specific data details. The hash value of the encrypted model update is recorded through the blockchain, and verified by relying on the blockchain consensus node, which further improves the data integrity and system transparency.
[0007] The technical solution of the present invention is: a gradient aggregation federated learning method based on the combination of zero-knowledge proof and blockchain technology, including key pair generation and distribution, client selection, client local model training and encryption signature, data transmission and model aggregation, generation of zero-knowledge proof, global model and broadcast, hash verification and data reading on blockchain, the specific steps are:
[0008] Step 1: Key pair generation and distribution
[0009] The blockchain distributed key management center generates key pairs (including public keys and private keys) for each client and blockchain node. The key management center securely distributes the keys to each client and blockchain node to ensure that each client and blockchain node obtains the corresponding public key and private key. Among them, the public key is used for encryption model and verification, and the private key is used for digital signature and decryption.
[0010] Step 2: Select the client
[0011] Before each round of federated learning begins, the system scores the client based on its performance in previous training rounds to select a certain number of clients to participate in the next round of training. This process involves analyzing the model update data submitted by the client, as follows:
[0012] Step 2.1: Collect client training data
[0013] At the end of each round of training, the system collects the model update data submitted by each client, including training accuracy, loss function value, training time, etc.
[0014] Step 2.2: Calculation of scoring criteria
[0015] Accuracy: Measures the accuracy of the client on the validation set. A high accuracy means that the model fits the data better.
[0016]
[0017] in, is the number of samples predicted correctly, is the total number of samples.
[0018] Loss function value (Loss): Measures the loss value of the client on the validation set. Low loss means that the model's prediction error is small.
[0019]
[0020] Where N is the sample size, is the true value of the i-th sample, is the model's predicted value for the i-th sample.
[0021] Training_Time: Measures the time the client spends training the model locally. A shorter time indicates a more efficient training process.
[0022]
[0023] in, is the time when the model training started. The time when the model training ends.
[0024] Step 2.3: Calculate the score for each client
[0025] Use the following formula to calculate the score for each client:
[0026]
[0027] in, represents the score of the i-th client, , , They represent the accuracy, loss function value and training time of the i-th client respectively. , , They represent the weight coefficients of accuracy, loss function value and training time respectively.
[0028] Step 2.4: Select the client
[0029] The scores of all clients Sort from high to low and select the n clients with the highest scores to participate in the next round of learning process.
[0030] Step 3: Client local model training and encryption signature
[0031] In the federated learning framework, each participating client implements a model training algorithm for its unique dataset. This process involves an iterative process of parameter estimation, aiming to minimize the loss function and thus improve the model's prediction accuracy for new sample data.
[0032] Assume that the local dataset of each client is represented as ; The feature vector representing the jth sample in the data set contains multiple features describing the sample; Representation and The corresponding target value; Represents the total number of samples in data set i.
[0033] Client i uses its dataset To train the local machine learning model, iteratively updates each set of parameters using an optimization algorithm (such as gradient descent) to find an optimal set of model parameters.
[0034] After the training process is successfully completed, each node will export a set of model parameter update vectors (i=0,1,2,...n, n is the number of clients). Each client randomly generates a value to ensure the privacy of the encryption model. , and use the Pedersen commitment scheme to encrypt the model update value to obtain the encrypted model update , and use the private key to sign the encrypted result to generate a digital signature .
[0035] Using the Pedersen commitment scheme we get The steps are as follows:
[0036] (1) Generate a key pair
[0037] First, the client needs to generate a key pair for the Pedersen commitment scheme, including two randomly selected generators: and and a secret key ( These parameters are public and known to all participants.
[0038] (2) Generate commitment
[0039] For each local model update value , the client calculates the commitment value :
[0040] Pick a random number As a commitment random number. Calculate the commitment value
[0041] in, and is the public generator in the system, is the model update value to commit, is a random number chosen by the client).
[0042] Step 4: Data transfer and model aggregation
[0043] Step 4.1: Each client will get the model update , the random number introduced , Encryption Model Update And digital signature , transmitted to the blockchain network via a secure communication protocol;
[0044] Step 4.2: The blockchain network randomly selects multiple aggregation nodes, which coordinate the model update values from different clients. After the aggregation node is selected, the aggregation node executes the blockchain consensus algorithm. Subsequently, the aggregation node accepts local model updates from different clients, coordinates and integrates the local model updates to form a unified global model. ;
[0045] Step 4.3: Global Model Encrypt and get the encrypted global model , and then use the aggregation node private key to digitally sign the encrypted global model to form a global signature .
[0046] Step 5: Generate Zero-Knowledge Proof
[0047] First, the distributed aggregation node first represents the global model calculation process as a circuit. This circuit is used to describe how to calculate the global model from the local model update received by the client, and create a pair of public and private keys (public key is used for verification, private key is used to generate proof), and then use the private key and circuit description to generate zk-SNARK proof .prove The information contained is sufficient for the verifier to confirm the correctness of the global model process.
[0048] The aggregation node then generates a set of coprime moduli for each blockchain node ( ), ensuring that the product of these moduli is larger than the size of the zero-knowledge proof. Next, the zk-SNARK proof Divide into multiple parts (such as ), and calculate the corresponding modulus for each part. Using the Chinese remainder theorem, the zero-knowledge proof is compressed to obtain the proof , so that satisfy:
[0049]
[0050]
[0051] …
[0052]
[0053] prove It not only effectively compresses storage requirements, but also maintains the ability to verify the global model process, ensuring the scalability and security of the blockchain.
[0054] Step 6: Global model transfer and broadcast
[0055] The aggregation node converts the global model and its encrypted version Transmitted to participating clients, and the compressed zero-knowledge proof is transmitted through the blockchain network The corresponding coprime modulus list and Broadcast to the consensus nodes of the blockchain.
[0056] Step 7: Hash verification and data reading on the blockchain
[0057] The consensus node receives the compressed proof Using the inverse of the Chinese Remainder Theorem, reconstruct the original proof based on coprime moduli The consensus nodes then use the circuit description and public key associated with the zk-SNARK to verify the proof. , check whether the proof is valid, that is, confirm whether the calculation of the aggregate node complies with the circuit definition without knowing the specific data of the calculation.
[0058] Consensus nodes use a predetermined hash function (such as SHA-256) to Perform hash calculation and then convert the encrypted global model Hash value Recorded on the blockchain to ensure the immutability of data and transparency of verification, the client reads the hash value on the blockchain Verify that the global model is completed correctly and start local training based on the update. The specific steps are:
[0059] Step 7.1: Consensus nodes receive encrypted global model and compression proof and the associated modulus And each part ;
[0060] Step 7.2: For each modulus , the consensus node constructs the congruence equation:
[0061]
[0062] in, For complete proof, i=1,2,…,k;
[0063] Step 7.3: Calculate the product of all moduli , then for each modulus ,calculate and modular inverse So that: ;
[0064] Step 7.4: Solve the full proof using the Chinese Remainder Theorem :
[0065] ;
[0066] Step 7.5: Blockchain consensus nodes complete the proof based on the public key pair Verify the correctness and validity. After verification, the consensus node will encrypt the hash value of the global model. Recorded on the blockchain;
[0067] Step 7.6: The client reads the hash value of the corresponding round from the blockchain , and the received encrypted global model Perform hash operation through the existing hash function to obtain the hash value At the same time, the client verifies the digital signature using the public key of the aggregation node ,if If the signature verification is successful, the client confirms the integrity and correctness of the global model, and then starts a new round of local model training based on this round of updates.
[0068] The beneficial effects of the present invention are:
[0069] (1) Data privacy protection
[0070] This invention provides significant data privacy protection for federated learning systems by combining zero-knowledge proof (zk-SNARK) and blockchain technology. Zero-knowledge proof can verify the correctness of model updates without revealing specific data details, thus protecting data privacy.
[0071] (2) Accuracy and transparency of model update verification
[0072] The use of zero-knowledge proof technology can effectively verify the accuracy of the global model without disclosing specific calculation details. This method ensures the transparency and accuracy of model aggregation operations and avoids verification defects that may occur in traditional methods. The hash value of the model update is recorded on the blockchain, and relying on the immutability of the blockchain, the transparency of the system and the integrity of the data are further enhanced.
[0073] (3) System security and anti-tampering capabilities
[0074] The present invention utilizes blockchain technology to record the hash value of the model update and verifies it through consensus nodes, thus ensuring the security of the system and the non-tamperability of the data.
[0075] (4) Improving training efficiency and model quality
[0076] By introducing a dynamic client selection mechanism, the present invention optimizes participants based on training performance scores to ensure that the best performing clients are selected to participate in the next round of learning. This mechanism not only improves training efficiency, but also improves the quality of the model. The client selection mechanism takes into account factors such as accuracy, loss function value, and training time, thereby optimizing the model training process.
[0077] (5) Reduce the risk of single point failure
[0078] The present invention aggregates and verifies the model through distributed nodes in the blockchain network, avoiding the single point failure problem of centralized servers that may exist in traditional methods. The distributed nature of the blockchain enables the system to have higher fault tolerance when facing node failures, thereby improving the stability and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 It is a flow chart of the present invention;
[0080] Figure 2 It is a process diagram of the present invention. DETAILED DESCRIPTION
[0081] To further illustrate the purpose, technical content and advantages of the present invention, the method of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0082] Example 1: Figure 1 As shown, a gradient aggregation federated learning method based on the combination of zero-knowledge proof and blockchain technology includes the following steps:
[0083] Step 1: Key pair generation and distribution
[0084] The blockchain distributed key management center generates key pairs (including public keys and private keys) for each client and blockchain node. The key management center securely distributes the keys to each client and blockchain node to ensure that each client and blockchain node obtains the corresponding public key and private key. Among them, the public key is used for encryption model and verification, and the private key is used for digital signature and decryption.
[0085] Step 2: Select the client
[0086] Before each round of federated learning begins, the system scores the client based on its performance in previous training rounds to select a certain number of clients to participate in the next round of training. This process involves analyzing the model update data submitted by the client, including but not limited to indicators such as training accuracy, loss function value, and training time. The specific calculation process is as follows:
[0087] Step 2.1: Collect client training data
[0088] At the end of each round of training, the system collects the model update data submitted by each client, including training accuracy, loss function value, training time, etc.
[0089] Step 2.2: Calculation of scoring criteria
[0090] Accuracy: Measures the accuracy of the client on the validation set. A high accuracy means that the model fits the data better.
[0091]
[0092] in, is the number of samples predicted correctly, The total number of samples
[0093] Loss function value (Loss): Measures the loss value of the client on the validation set. Low loss means that the model's prediction error is small.
[0094]
[0095] in, is the sample size, is the true value of the i-th sample, is the model's predicted value for the i-th sample.
[0096] Training_Time: Measures the time the client spends training the model locally. A shorter time indicates a more efficient training process.
[0097]
[0098] in, is the time when the model training started. The time when the model training ends.
[0099] Step 2.3: Calculate the score for each client
[0100] Use the following formula to calculate the score for each client:
[0101]
[0102] in, represents the score of the i-th client, , , They represent the accuracy, loss function value and training time of the i-th client respectively. , , They represent the weight coefficients of accuracy, loss function value and training time respectively.
[0103] Step 2.4: Select the client
[0104] The scores of all clients Sort from high to low and select the n clients with the highest scores to participate in the next round of learning process.
[0105] Step 3: Client local model training and encryption signature
[0106] Clients participating in federated learning will perform model training based on their local data sets. During this process, the clients will optimize model parameters based on their private data, with the goal of minimizing the loss function and improving the prediction accuracy of the model.
[0107] Assume that the local dataset of each client is represented as (i=0,1,2,…n, n is the number of clients).
[0108] The feature vector representing the jth sample in the data set contains multiple features describing the sample; Representation and The corresponding target value; Represents the total number of samples in data set i.
[0109] Client i uses its dataset To train the local machine learning model, we use an optimization algorithm (such as gradient descent) to iteratively update each set of parameters to find the optimal set of model parameters. The specific implementation is as follows:
[0110] For a given model parameter (i=0,1,2,...n, n is the number of clients), assuming the predicted value = , then the mean square error loss function is
[0111]
[0112] Among them is The prediction function of the model, which depends on the features and model parameters .
[0113] Then use gradient descent to update the parameters:
[0114]
[0115] in is the learning rate, is the loss function relative to the model parameters gradient.
[0116] The gradient calculation formula is:
[0117]
[0118] After multiple rounds of iterations, the client obtains the updated model parameters These parameters are uploaded to the server, but before that, the client encrypts the model updates to ensure privacy.
[0119] After the training optimization is completed, each client randomly generates a value to ensure the privacy of the encrypted model. , and use the Pedersen commitment scheme to encrypt the model update value to obtain the encrypted model update , and use the private key to sign the encrypted result to generate a digital signature .
[0120] Using the Pedersen commitment scheme we get The steps are as follows:
[0121] (1) Generate a key pair
[0122] First, the client needs to generate a key pair for the Pedersen commitment scheme, including two randomly selected generators: and and a secret key ( These parameters are public and known to all participants.
[0123] (2) Generate commitment
[0124] For each local model update value , the client calculates the commitment value :
[0125] Pick a random number As a commitment random number. Calculate the commitment value
[0126] in, and is the public generator in the system, is the model update value to commit, is a random number chosen by the client).
[0127] Step 4: Data transfer and model aggregation
[0128] Step 4.1: Each client will get the model update , the random number introduced , Encryption model update And digital signature , transmitted to the blockchain network via a secure communication protocol;
[0129] Step 4.2: The blockchain network randomly selects multiple aggregation nodes, which coordinate the model update values from different clients. After the aggregation node is selected, the aggregation node executes the blockchain consensus algorithm. Subsequently, the aggregation node accepts local model updates from different clients, coordinates and integrates the local model updates to form a unified global model. ;
[0130] Step 4.3: Global Model Encrypt and get the encrypted global model , and then use the aggregation node private key to digitally sign the encrypted global model to form a global signature .
[0131] Step 5: Generate Zero-Knowledge Proof
[0132] The distributed aggregation node first represents the global model calculation process as a circuit, which is used to describe how to calculate the global model from the local model update received by the client, and creates a pair of public and private keys (public key is used for verification, private key is used for generating proof), and then uses the private key and circuit description to generate zk-SNARK proof .prove The information contained is sufficient for the verifier to confirm the correctness of the global model process.
[0133] The aggregation node then generates a set of coprime moduli for each blockchain node ( ), ensuring that the product of these moduli is larger than the size of the zero-knowledge proof. Next, the zk-SNARK proof Divide into multiple parts (such as ), and calculate the corresponding modulus for each part. Using the Chinese remainder theorem, the zero-knowledge proof is compressed to obtain the proof , so that satisfy:
[0134]
[0135]
[0136] …
[0137]
[0138] prove It not only effectively compresses storage requirements, but also maintains the ability to verify the global model process, ensuring the scalability and security of the blockchain.
[0139] zk-SNARKs allow the specific details of model updates to be effectively hidden during the proof process, while the verifier only needs to verify that the circuit's calculations are as expected.
[0140] Step 6: Global model transfer and broadcast
[0141] The aggregation node converts the global model and its encrypted version Transmitted to participating clients, and the compressed proof π and Broadcast to the consensus nodes of the blockchain.
[0142] Step 7: Hash verification and data reading on the blockchain
[0143] The consensus node receives the compressed proof Using the inverse of the Chinese Remainder Theorem, reconstruct the original proof based on coprime moduli The consensus nodes then use the circuit description and public key associated with the zk-SNARK to verify the proof. , check whether the proof is valid, that is, confirm whether the calculation of the aggregate node complies with the circuit definition without knowing the specific data of the calculation.
[0144] Consensus nodes use a predetermined hash function (such as SHA-256) to Perform hash calculation and then convert the encrypted global model Hash value Recorded on the blockchain to ensure data immutability and transparency of verification. The client reads the hash value on the blockchain Verify that the global model is completed correctly and start local training based on the update. The specific steps are:
[0145] Step 7.1: Consensus nodes receive encrypted global model and compression proof and the associated modulus And each part ;
[0146] Step 7.2: For each modulus , the consensus node constructs the congruence equation:
[0147]
[0148] in, For complete proof, i=1,2,…,k;
[0149] Step 7.3: Calculate the product of all moduli , then for each modulus ,calculate and modular inverse So that: ;
[0150] Step 7.4: Solve the full proof using the Chinese Remainder Theorem :
[0151] ;
[0152] Step 7.5: Blockchain consensus nodes complete the proof based on the public key pair Verify the correctness and validity. After verification, the consensus node will encrypt the hash value of the global model. Recorded on the blockchain;
[0153] Step 7.6: The client reads the hash value of the corresponding round from the blockchain , and the received encrypted global model Perform hash operation through the existing hash function to obtain the hash value At the same time, the client verifies the digital signature using the public key of the aggregation node ,if If the signature verification is successful, the client confirms the integrity and correctness of the global model, and then starts a new round of local model training based on this round of updates.
[0154] In particular, the local model training and encrypted signature of the client in step 3 are updated The specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0155] Assume that the predicted value of the model uses a linear regression model, that is . Suppose a client's data set has two samples: . Initialize model parameters , the loss function is the mean square error:
[0156] Predicted value for the first sample: =0, the error is .
[0157] The predicted value for the second sample is: =0, the error is .
[0158] Loss function: .
[0159] Gradient calculation: .
[0160] Assuming the learning rate , Update model parameters: .
[0161] After several rounds of gradient descent, the model parameters It will eventually converge to a certain value, which is the client's local model update .
[0162] The above examples are further explanations of the present invention. The setting of certain specific parameter values is mainly to illustrate the basic concept of the present invention. In a specific application environment, the values can be adjusted according to the actual situation.
[0163] In order to make the specific purpose, innovation, applicability, etc. of the present invention more clearly described, the present invention is further explained by proposing a specific example of applying the present invention.
[0164] Specifically, take the application of the present invention in an intelligent transportation system as an example.
[0165] Intelligent transportation systems require collaboration among various traffic participants (such as automobile manufacturers, traffic management departments, travel service companies, logistics companies, etc.). In order to optimize traffic flow, improve driving safety, and reduce congestion, intelligent transportation systems require a large amount of real-time data, such as vehicle driving trajectories, road conditions, traffic flow, etc. These data are often highly sensitive. For example, vehicle driving data may involve personal privacy, and corporate logistics path data is commercially confidential.
[0166] Therefore, through the gradient aggregation federated learning method based on zero-knowledge proof and blockchain technology proposed in this invention, the intelligent transportation system can effectively integrate traffic data from different sources, optimize traffic signal control, improve road utilization, and support cross-regional and cross-departmental collaboration while ensuring data privacy and security. This solution can not only alleviate urban congestion problems, but also provide faster traffic response in emergencies.
[0167] The specific implementation steps are as follows:
[0168] Step 1: In the smart transportation system, the blockchain distributed key management center generates and securely distributes key pairs to each car, transportation infrastructure, etc. and blockchain node.
[0169] Step 2: Traffic participants in the intelligent transportation system, such as vehicles and traffic lights, act as clients to optimize traffic flow. The system will select appropriate traffic participants to participate in model training and updating based on the data contributions of different traffic participants.
[0170] Step 3: Each autonomous vehicle or traffic infrastructure will perform model training based on its local traffic data, such as path planning optimization, road congestion prediction, etc.
[0171] Step 4: Each autonomous vehicle, traffic facility, etc. sends its local model update value and digital signature to the blockchain distributed node through the blockchain network. The traffic management system aggregates model updates from all parties to generate a global traffic flow forecast.
[0172] Step 5: The aggregation node represents the calculation process of the global traffic optimization model as a circuit and generates the corresponding zero-knowledge proof. Then, the aggregation node compresses the proof using the Chinese remainder theorem to ensure high efficiency in storage and transmission.
[0173] Step 6: The blockchain network broadcasts the compressed zero-knowledge proof and the aggregated traffic flow prediction model and its encrypted version to all participants.
[0174] Step 7: The blockchain consensus node will first reconstruct the zero-knowledge proof and verify its validity, and then record the hash value of the global model on the blockchain. The autonomous vehicle and other traffic participants read the hash value and verify its correctness.
[0175] The specific implementation modes of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. A gradient aggregation federated learning method based on zero-knowledge proof and blockchain technology, characterized by: Step 1: The blockchain distributed key management center generates a key pair for each client and blockchain node, including a public key and a private key. The key management center then distributes the key pair to each client and blockchain node, completing key pair generation and distribution. Step 2: Select clients based on scoring criteria; Step 3: Train the model for the selected client and encrypt and sign the model updates generated by it; Step 4: The model update, encrypted model update and signature obtained by the client are transmitted to the blockchain network, and distributed aggregation and encryption are performed to obtain the encrypted global model; Step 5: The distributed aggregation nodes use zero-knowledge concise non-interactive knowledge argumentation to generate zero-knowledge proofs for the aggregation operation, and then use the Chinese remainder theorem to compress the zero-knowledge proofs; Step 6: The distributed aggregation node transmits the global model and the encrypted global model to the selected client, and broadcasts the compressed zero-knowledge proof and the encrypted global model to the consensus node of the blockchain through the blockchain network; Step 7: After receiving the zero-knowledge proof and encrypted global model compressed using the Chinese Remainder Theorem, the consensus node verifies the correctness and validity; After verification, the encrypted model update hash value is recorded on the blockchain. The participating clients verify the integrity and correctness of the global model by reading the hash value recorded on the blockchain. After successful verification, the client will start a new round of local model training based on this round of updates. The step 2 is specifically as follows: Step 2.1: At the end of each round of training, collect the model update data submitted by each client; Step 2.2: Select accuracy, loss function value, and training time as scoring criteria; Step 2.3: Calculate the score for each client using the following formula: ; in, represents the score of the i-th client, , , They represent the accuracy, loss function value and training time of the i-th client respectively. , , Represent the weight coefficients of accuracy, loss function value and training time respectively; Step 2.4: Sort the scores of all clients from high to low, and select the n clients with the highest scores to participate in the next round of learning process; The step 3 is specifically as follows: Step 3.1: Implement the model training algorithm on the selected client within the federated learning framework, minimize the loss function through the iterative process of parameter estimation, and improve the model prediction accuracy; Step 3.2: After training is complete, each blockchain node exports a set of model updates , i=0,1,2,...n, n is the number of clients; Step 3.3: Introduce random numbers on each client Update the model Encrypt and generate encrypted model updates ; Step 3.4: Encrypt model updates using client private key Perform digital signature operation to form a digital signature ; Step 3.3 is as follows: Step 3.3.1: The client generates a Pedersen commitment key pair consisting of two randomly selected generators and and a secret key , is a randomly generated value; Step 3.3.2: Update the value for each local model , the client calculates the encryption model update , the formula is as follows: ; in, and is a public generator, is the model update value to commit, is a random number chosen by the client; The step 5 is specifically as follows: Step 5.1: The aggregation node constructs the global model calculation process as a circuit and calculates the global model through the model updates received from the client; Step 5.2: Create a pair of public and private keys. The public key is used for verification, and the private key is used to generate proofs. The aggregation node uses the private key to operate the constructed circuit to generate a zero-knowledge concise non-interactive knowledge proof π; Step 5.3: The aggregation node generates a set of coprime moduli for each blockchain node ( ), and the product of the coprime moduli is larger than the size of the zero-knowledge proof. Next, the zero-knowledge concise non-interactive proof of knowledge Divided into several parts, namely , and calculate the modulus of each part, and use the Chinese remainder theorem to compress the zero-knowledge proof to get the proof , so that satisfy: ; ; …… ; The step 7 is specifically as follows: Step 7.1: Consensus nodes receive encrypted global model and compression proof and the associated modulus And each part ; Step 7.2: For each modulus , the consensus node constructs the congruence equation: ; in, For complete proof, i=1,2,…,k; Step 7.3: Calculate the product of all moduli , then for each modulus ,calculate and modular inverse So that: ; Step 7.4: Solve the full proof using the Chinese Remainder Theorem : ; Step 7.5: Blockchain consensus nodes complete the proof based on the public key pair Verify the correctness and validity. After verification, the consensus node will encrypt the hash value of the global model. Recorded on the blockchain; Step 7.6: The client reads the hash value of the corresponding round from the blockchain , and the received encrypted global model Perform hash operation through the existing hash function to obtain the hash value At the same time, the client verifies the digital signature using the public key of the aggregation node ,if If the signature verification is successful, the client confirms the integrity and correctness of the global model, and then starts a new round of local model training based on this round of updates.
2. According to claim 1, a gradient aggregation federated learning method based on zero-knowledge proof and blockchain technology is characterized in that: The step 4 is specifically as follows: Step 4.1: Each client will get the model update , the random number introduced , Encryption model update And digital signature , transmitted to the blockchain network via a secure communication protocol; Step 4.2: The blockchain network randomly selects multiple aggregation nodes, which coordinate the model update values from different clients. After the aggregation node is selected, the aggregation node executes the blockchain consensus algorithm. Subsequently, the aggregation node accepts local model updates from different clients, coordinates and integrates the local model updates to form a unified global model. ; Step 4.3: Global Model Encrypt and get the encrypted global model , and then use the aggregation node private key to digitally sign the encrypted global model to form a global signature .
Citation Information
Patent Citations
Credible federal learning system and method based on block chain and zero knowledge proof
CN119090028A
Methods and systems for a synchronized distributed data structure for federated machine learning
US20210314140A1