A post-quantum blockchain federated learning method and system

By employing a post-quantum blockchain federated learning approach, utilizing a post-quantum key encapsulation mechanism and key ratchet technology, the security and privacy issues of traditional federated learning in a quantum computing environment are resolved, achieving efficient key management and data protection.

CN122204493APending Publication Date: 2026-06-12中电信量子信息科技集团有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610415218.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-31
Publication Date
2026-06-12

Smart Images

  • Figure CN122204493A_ABST
    Figure CN122204493A_ABST
Patent Text Reader

Abstract

The application provides a post-quantum blockchain federated learning method and system, which comprises the following steps: receiving a first encrypted message sent after server authentication is completed, wherein the first encrypted message comprises a task transaction, and the task transaction comprises last round global model information; deriving a current round model encryption key of any participant according to a last round chain key of the participant, and decrypting the last round global model information to obtain last round global model parameters in the last round global model information; training a local model based on a local data set and the last round global model parameters to obtain current round global model parameters; constructing an update transaction based on the current round global model parameters; encrypting the current round global model information in the update transaction by using the current round model encryption key of any participant to obtain a second encrypted message, and sending the second encrypted message to a server, wherein the current round global model information comprises the current round global model parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cryptographic application technology, and more specifically, to a post-quantum blockchain federated learning method and system. Background Technology

[0002] Federated learning, as an innovative distributed machine learning paradigm, boasts the core advantage of supporting multiple participants to collaboratively train a global model without sharing their local raw data. This successfully addresses industry pain points such as data silos and privacy breaches, leading to its widespread application in sensitive fields with stringent data security requirements, such as healthcare and finance. However, with the rapid development of quantum computing technology, the security architecture of traditional federated learning systems faces disruptive challenges. The practical application of quantum computers means that quantum algorithm threats will not only directly jeopardize the local data privacy of participants but also fundamentally undermine the security foundation of the federated learning system, leaving core aspects such as model transmission and key negotiation vulnerable. Meanwhile, while the combination of blockchain technology and federated learning brings some improvements in transparency and tamper resistance, it still fails to fundamentally solve the long-term security threats posed by quantum computing, highlighting the increasing limitations of existing technological systems.

[0003] In existing technological research, to improve the operational efficiency and feasibility of federated learning, related solutions mostly focus on two major directions: optimizing resource allocation and improving the underlying performance of blockchain. For example, optimizing the allocation of device resources in federated learning through auction mechanisms improves the rationality of resource utilization; and improving the transaction efficiency of blockchain in federated learning scenarios through parallel processing. However, the above solutions are all based on the security architecture design of the pre-quantum era, which cannot resist quantum computing attacks and has not solved the forward security problem. Moreover, most solutions still require key re-exchange in each round of training, resulting in high communication and computing overhead. Even if data compression is achieved, the fundamental problem of high key exchange frequency is not addressed. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of the prior art by providing a post-quantum blockchain federated learning method and system. This method avoids frequent public key operations during multiple training rounds by deriving the current round's model encryption key based on the previous round's chain key, significantly reducing the computational and communication overhead of any participant. Furthermore, it eliminates the need to share the local original dataset throughout the process, thus enabling any participant to make an effective contribution to the global model while strictly protecting local data privacy.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows: In a first aspect, embodiments of this application provide a post-quantum blockchain federated learning method, applicable to any one of multiple participating parties, the method comprising: Upon receiving a first encrypted message sent after server authentication is completed, the first encrypted message includes: a task transaction, the task transaction including: the previous round of global model information; Based on the previous round chain key of any participant, derive the current round model encryption key of any participant, and decrypt the previous round global model information to obtain the previous round global model parameters in the previous round global model information; Based on the global model parameters from the previous round, a local model is trained using a local dataset to obtain the global model parameters for the current round. Construct an update transaction based on the global model parameters of the current round; The current round global model information in the update transaction is encrypted using the current round model encryption key of any of the participants to obtain a second encrypted message, which is then sent to the server. The current round global model information includes the current round global model parameters.

[0006] In an optional implementation, before receiving the first encrypted message sent after the server authentication is completed, the method further includes: Receive a first assembly message sent by the server, the first assembly message including: the server public key and the server encapsulation key; A first shared secret is generated based on the server's public key and the participants' private keys; Based on the server encapsulation key, a post-quantum encapsulation algorithm is used to generate ciphertext and a second shared secret; Based on the first shared secret and the second shared secret, an asymmetric ratchet key derivation function is used to generate a first root key as the first chain key for any of the participants; A second assembly message is sent to the server, the second assembly message including: the ciphertext and the public key of the participating party, so that the server generates a second root key that is the same as the first root key based on the ciphertext and the public key of the participating party.

[0007] In an optional implementation, the method further includes: The current round chain key is derived from the previous round chain key of any of the participants.

[0008] Secondly, embodiments of this application also provide a post-quantum blockchain federated learning method applied to a server, the method comprising: A first encrypted message is sent to any participating party. The first encrypted message includes a task transaction, which includes information about the previous round's global model. The first encrypted message enables any participating party to derive its current round's model encryption key based on its previous round's chain key, and to decrypt the previous round's global model information to obtain the previous round's global model parameters. Based on the previous round's global model parameters, a local model is trained using a local dataset to obtain the current round's global model parameters. An update transaction is constructed based on the current round's global model parameters. The current round's global model information in the update transaction is encrypted using the current round's model encryption key of any participating party to obtain a second encrypted message. Receive the second encrypted message sent by any of the participating parties.

[0009] In an optional implementation, before sending the first encrypted message to any participant, the method further includes: The current round model encryption key of the server is derived from the previous round chain key of the server. Based on the current round model encryption key of the server, the previous round global model information in the task transaction is encrypted to obtain the first encrypted message.

[0010] In an optional implementation, the method further includes: A key generation algorithm is used to generate a server encapsulation key and a server decapsulation key. Generate the server public key based on the random number; Based on the server public key and the server encapsulation key, a first assembly message is constructed and sent to any of the participants. The first assembly message is used to enable any participant to generate a first root key based on the server public key and the server encapsulation key.

[0011] In an optional implementation, the method further includes: Receive a second assembly message sent by any of the participants, the second assembly message including: ciphertext and the participant's public key; A first shared secret is generated based on the public keys of the participating parties and the private key of the server. Based on the server's decapsulation key and the ciphertext, a second shared secret is generated using a post-quantum decapsulation algorithm; Based on the first shared secret and the second shared secret, an asymmetric ratchet key derivation function is used to generate a second root key that is the same as the first root key, and this second root key is used as the first chain key of the server.

[0012] In an optional implementation, the method further includes: The second encrypted message is quality-scored using a verification model, and a feedback transaction is generated. Submit the feedback transaction to the blockchain.

[0013] In an optional implementation, the method further includes: A smart contract model is used to score the reputation of the second encrypted message, generating a reputation value for each participant. Training restrictions are imposed on each participant based on their reputation score.

[0014] Thirdly, embodiments of this application also provide a post-quantum blockchain federated learning system, which includes: multiple participants and a server, wherein any one of the multiple participants is used to execute the steps of any of the post-quantum blockchain federated learning methods described in the first aspect above, and the server is used to execute the steps of any of the post-quantum blockchain federated learning methods described in the second aspect above.

[0015] The beneficial effects of this application are: This application provides a post-quantum blockchain federated learning method and system. The method includes: receiving a first encrypted message sent by a server after authentication, the first encrypted message including a task transaction, the task transaction including the previous round global model information; deriving the current round model encryption key of any participant based on the previous round chain key of any participant, and decrypting the previous round global model information to obtain the previous round global model parameters; training a local model using a local dataset based on the previous round global model parameters to obtain the current round global model parameters; constructing an update transaction based on the current round global model parameters; encrypting the current round global model information in the update transaction using the current round model encryption key of any participant to obtain a second encrypted message, and sending it to the server, wherein the current round global model information includes the current round global model parameters.

[0016] The method in this application avoids frequent public key operations in multiple training rounds by deriving the current round's model encryption key based on the previous round's chain key. This significantly reduces the computational and communication overhead of any participant and eliminates the need to share the local original dataset throughout the process. This ensures the effective contribution of any participant to the global model while strictly protecting local data privacy, making it suitable for federated learning needs in sensitive data fields such as healthcare and finance. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 One of the flowcharts for a post-quantum blockchain federated learning method provided in this application embodiment; Figure 2 A second schematic flowchart illustrating a post-quantum blockchain federated learning method provided for an embodiment of this application; Figure 3 The third flowchart illustrating a post-quantum blockchain federated learning method provided in this application embodiment; Figure 4 A fourth flowchart illustrating a post-quantum blockchain federated learning method provided for embodiments of this application; Figure 5 Fifth flowchart illustrating a post-quantum blockchain federated learning method provided for embodiments of this application; Figure 6 A flowchart illustrating a post-quantum blockchain federated learning method provided for embodiments of this application is shown in Figure 6. Figure 7 The seventh flowchart illustrating a post-quantum blockchain federated learning method provided for embodiments of this application; Figure 8 This is the eighth flowchart illustrating a post-quantum blockchain federated learning method provided in this application embodiment; Figure 9 A schematic diagram of the functional modules of a post-quantum blockchain federated learning device provided in an embodiment of this application; Figure 10 A schematic diagram of the functional modules of another post-quantum blockchain federated learning device provided in an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0020] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0021] In the description of this application, it should be noted that if the terms "upper", "lower", etc. appear to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship that the product of this application is usually placed in, it is only for the convenience of describing this application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.

[0022] Furthermore, the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Additionally, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0023] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.

[0024] To address the challenges of traditional federated learning in quantum computing environments, such as vulnerability to cracking, complex key management, high communication costs, and difficulty in balancing privacy and traceability, this application proposes a post-quantum blockchain federated learning method. By employing a post-quantum key encapsulation mechanism and key ratchet technology, it solves the key management problem in the multi-round iteration process of federated learning, making it suitable for large-scale distributed machine learning scenarios involving resource-constrained devices.

[0025] The post-quantum blockchain federated learning method provided in this application, with reference to the accompanying drawings and specific examples, will be explained in detail below. This method can be applied to any one of multiple participating parties. Figure 1 This is one of the flowcharts illustrating a post-quantum blockchain federated learning method provided in an embodiment of this application; such as... Figure 1 As shown, the method includes: S101. Receive the first encrypted message sent by the server after authentication is completed.

[0026] The first encrypted message includes: task transaction, which includes: the previous round of global model message.

[0027] In this embodiment, during the initialization phase, the server and all participating parties first complete registration on the blockchain. Specifically, the server first executes the Module-Lattice-Based Key-Encapsulation Mechanism (ML-KEM) to randomly select a 256-bit seed. Generate encapsulation key pairs using standard algorithms. ,in Encapsulate the key for the publicly available server. Decapsulate the private server key. Simultaneously generate an elliptic curve key pair; specifically, select random numbers on the standard elliptic curve parameter secp256k1. As the server's private key, based on the server's private key Calculate the server public key ,in This is the base point of the curve.

[0028] Then, a server registration transaction is constructed based on the encapsulated key pair and the elliptic curve key pair. ,in, Represents the SHA-384 hash function. For the number of participants, These are the initial model parameters. This is the project identifier. Then, the server's private key is used. Register transactions for the server Sign the transaction and submit the signed registration transaction to the blockchain network to complete the server registration.

[0029] Similarly, after each participant detects the server registration transaction, each participant generates an Elliptic Curve Diffie–Hellman Key Pair (ECDH) under the same elliptic curve parameters. Specifically, they select random numbers. As the private key of each participant, based on the participant's private key Calculate participant public key .

[0030] Then construct the participant registration transaction. Using the participant's private key Registration of participants Signatures are made and the signed registration transaction is submitted to the blockchain network to ensure the non-repudiation of the identities of each participant and the key materials.

[0031] Therefore, before any participant receives the first encrypted message sent after the server has completed authentication, the server has already completed two-way identity authentication and root key negotiation with each participant. The blockchain has completed the on-chain registration of the server project and the registration of participant keys. All participants establish a dedicated communication link with the server through an off-chain secure channel.

[0032] The server publishes the training task, i.e., the first encrypted message, to any participant. Also includes: server encapsulation key Server public key and project identifier First encrypted message Specifically, it is expressed as follows: , This is represented as a task transaction, which also includes: round number. Task Number and project identifier Then the task transaction Specifically, it is expressed as follows: , This represents the information from the previous round of the global model, including the parameters of the previous round of the global model. Information from the previous round of global models Represented as: .

[0033] S102. Based on the previous round chain key of any participant, derive the current round model encryption key of any participant, and decrypt the previous round global model information to obtain the previous round global model parameters in the previous round global model information.

[0034] Specifically, if any participant pre-generates a corresponding first key as the first round chain key, then the session key update for each round is achieved by deriving from the chain key, which means the update of the encryption key for the current round model is achieved.

[0035] Optionally, the current round chain key can be derived from the previous round chain key of any participant.

[0036] Specifically, based on the previous round chain key of any participant. Run the KeyDerivation Function (KDF) to generate the current round model encryption key for any participant. and the current wheel chain key Specifically, it is expressed as: .

[0037] Before sending the first encrypted message, the server also derives the current round model encryption key based on the server's previous round chain key, and encrypts the previous round global model information in the task transaction based on the server's current round model encryption key to obtain the first encrypted message. Furthermore, the second key pre-generated by the server is the same as the corresponding first key pre-generated by any participant. Therefore, the current round model encryption key derived by any participant is consistent with the current round model encryption key derived by the server.

[0038] Then, any participant can use its current round model encryption key to decrypt the previous round's global model information using AES-256-GCM, where AES stands for Advanced Encryption Standard, 256 indicates a 256-bit key length, and GCM is the authentication encryption mode, Galois / Counter Mode, to obtain the previous round's global model parameters. .

[0039] S103. Based on the global model parameters of the previous round, train the local model using the local dataset to obtain the global model parameters of the current round.

[0040] Specifically, each participant will use the global model parameters from the previous round. As initial weights, a local model is trained using the local dataset. After training, the global model parameters for the current round are obtained. .

[0041] S104. Construct an update transaction based on the global model parameters of the current round.

[0042] S105. Use the current round model encryption key of any participant to encrypt the current round global model information in the update transaction to obtain a second encrypted message, and send it to the server.

[0043] The current round's global model information includes: the current round's global model parameters.

[0044] Each participant, based on the global model parameters of the current round Construct update transaction Among them, update transactions Specifically, it is expressed as follows: , will update transaction Submit to the blockchain.

[0045] Simultaneously use the current round model encryption key of any participant. Encrypt current round global model information Current round global model information Represented as: Generate a second encrypted message And it is sent to the server through an off-chain channel.

[0046] In summary, this application provides a post-quantum blockchain federated learning method, which includes: receiving a first encrypted message sent by a server after authentication, the first encrypted message including a task transaction, the task transaction including the previous round global model information; deriving the current round model encryption key of any participant based on the previous round chain key of any participant, and decrypting the previous round global model information to obtain the previous round global model parameters in the previous round global model information; training a local model using a local dataset based on the previous round global model parameters to obtain the current round global model parameters; constructing an update transaction based on the current round global model parameters; encrypting the current round global model information in the update transaction using the current round model encryption key of any participant to obtain a second encrypted message, and sending it to the server, wherein the current round global model information includes the current round global model parameters.

[0047] The method in this application avoids frequent public key operations in multiple training rounds by deriving the current round's model encryption key based on the previous round's chain key. This significantly reduces the computational and communication overhead of any participant and eliminates the need to share the local original dataset throughout the process. This ensures the effective contribution of any participant to the global model while strictly protecting local data privacy, making it suitable for federated learning needs in sensitive data fields such as healthcare and finance.

[0048] Based on the post-quantum blockchain federated learning method provided in the above embodiments, this application also provides another possible implementation of the post-quantum blockchain federated learning method. Figure 2 This is a second flowchart illustrating a post-quantum blockchain federated learning method provided in an embodiment of this application; as shown below. Figure 2 As shown, before receiving the first encrypted message sent after the server authentication is completed, the method further includes: S201, Receive the first assembly message sent by the server.

[0049] The first assembly message includes: the server public key and the server encapsulation key.

[0050] In this embodiment, after the server and all participants complete registration on the blockchain, the server exchanges complete public keys with any participant through an off-chain channel. Specifically, the server uses its public key... and server encapsulation key Construct the first assembly message The first assembly message also includes: server registration transaction. and project identifier Example, first assembly message Represented as: .

[0051] The server also uses the server's private key. For the first assembly message Perform signing and generate an ECDSA signature. and through the security channel The message is sent to any participant. Therefore, any participant can receive the first assembled message sent by the server. Additionally, any participant verifies the signature using the server's public key. The validity of the key is verified by comparing the public key hash value to ensure the integrity of the key material.

[0052] S202. Generate the first shared secret based on the server's public key and the participants' private keys.

[0053] Specifically, any participant performs an ECDH shared secret computation on the server's public key. Private keys of participating parties Perform elliptic curve dot product to obtain the first shared secret. Specifically, it is expressed as: .

[0054] S203. Based on the server's encapsulation key, use the post-quantum encapsulation algorithm to generate ciphertext and a second shared secret.

[0055] Specifically, enter the server encapsulation key. Run the Kyber encapsulation algorithm to generate ciphertext. Second shared secret ,in It is a 256-bit uniform random number.

[0056] S204. Based on the first shared secret and the second shared secret, use the asymmetric ratchet key derivation function to generate the first root key as the first chain key for any participant.

[0057] Specifically, the first shared secret Second shared secret After concatenation, input the asymmetric ratchet key derivation function. First, the extraction phase (HMAC-based Extract-and-Expand Key DerivationFunction - Extract Phase, HKDF-Extract) is performed, using a zero-byte sequence as salt to extract the intermediate key. The subsequent expansion phase (HMAC-based Extract-and-Expand Key Derivation Function - Expand, HKDF-Expand) is performed, using tags. The output length is 64 bytes, generating the first root key. ,in This is a single-byte counter.

[0058] S205. Send a second assembly message to the server, the second assembly message including: ciphertext and the public key of the participating party, so that the server generates a second root key that is the same as the first root key based on the ciphertext and the public key of the participating party.

[0059] In this case, any participant, according to the ciphertext and the public keys of the participating parties Constructing the second assembly message Second assembly message This also includes: the registration of participating parties. and project identifier The second assembly message is represented as: The second assembled message is then signed using the private keys of the participating parties to obtain a signature value. Finally, the second assembled message and the signature value are sent to the server through a secure channel. This allows the server to generate a second root key that is identical to the first root key based on the ciphertext and the public keys of the participating parties.

[0060] The method provided in this application integrates the dual-shared secret generated by the post-quantum encapsulation algorithm and the ECDH algorithm to derive the root key. This not only utilizes the mature and efficient characteristics of the traditional ECDH algorithm but also introduces the security guarantee of the quantum-resistant algorithm, allowing the system to resist the risk of key cracking even in a quantum computing environment. At the same time, through a two-way key verification and negotiation process, it ensures that the root keys derived by the server and the participants are completely consistent, laying a unified and secure foundation for key derivation in subsequent multi-round training. This achieves the integration of identity authentication and key establishment, solving the problems of insufficient security and poor compatibility in the key negotiation process of traditional federated learning.

[0061] This application also provides another possible implementation of a post-quantum blockchain federated learning method, applied to a server. Figure 3 This is the third flowchart illustrating a post-quantum blockchain federated learning method provided in this application embodiment; as shown... Figure 3 As shown, the method includes: S301, Send the first encrypted message to any participating party.

[0062] The first encrypted message includes a task transaction, which includes the previous round global model message. The first encrypted message enables any participant to derive its current round model encryption key based on its previous round chain key, and to decrypt the previous round global model information to obtain the previous round global model parameters. Based on the previous round global model parameters, a local model is trained using a local dataset to obtain the current round global model parameters. An update transaction is constructed based on the current round global model parameters. The current round global model information in the update transaction is encrypted using any participant's current round model encryption key to obtain the second encrypted message.

[0063] In this embodiment, before sending the first encrypted message to any participant, the server has completed two-way identity authentication and root key negotiation with each participant, the blockchain has completed the on-chain registration of the server project and the registration of participant keys, and all participants have established a dedicated communication link with the server through an off-chain secure channel.

[0064] The server publishes the training task, i.e., the first encrypted message, to any participant. Also includes: server encapsulation key Server public key and project identifier First encrypted message Specifically, it is expressed as follows: , This is represented as a task transaction, which also includes: round number. Task Number and project identifier Then the task transaction Specifically, it is expressed as follows: , This represents the information from the previous round of the global model, including the parameters of the previous round of the global model. Information from the previous round of global models Represented as: .

[0065] Any participant uses the previous round's chain key. Run the KeyDerivation Function (KDF) to generate the current round model encryption key for any participant. and the current wheel chain key Specifically, it is expressed as: Each participant uses its current round model encryption key to decrypt the previous round's global model information using AES-256-GCM, obtaining the previous round's global model parameters. .

[0066] Any participant will use the global model parameters from the previous round. As initial weights, a local model is trained using the local dataset. After training, the global model parameters for the current round are obtained. Each participant determines the global model parameters based on the current round. Construct update transaction Among them, update transactions Specifically, it is expressed as follows: , will update transaction Submit to the blockchain. Simultaneously, use the encryption key from the current round model of any participant. Encrypt current round global model information Current round global model information Represented as: Generate a second encrypted message .

[0067] S302, Receive a second encrypted message sent by any participating party.

[0068] In summary, this application provides a post-quantum blockchain federated learning method, which includes: sending a first encrypted message to any participant, the first encrypted message including: a task transaction, the task transaction including: previous round global model information; the first encrypted message is used to enable any participant to derive the current round model encryption key of any participant based on the previous round chain key of any participant, and to decrypt the previous round global model information to obtain the previous round global model parameters in the previous round global model information; based on the previous round global model parameters, to train a local model using a local dataset to obtain the current round global model parameters; to construct an update transaction based on the current round global model parameters; to encrypt the current round global model information in the update transaction using the current round model encryption key of any participant to obtain a second encrypted message; and to receive the second encrypted message sent by any participant.

[0069] The method in this application ensures the accurate transmission and dedicated decryption of training tasks and model parameters by sending a dedicated encrypted first encrypted message to the participants, thus avoiding data leakage and replay attacks. At the same time, it selectively receives and preliminarily verifies the second encrypted message sent by the participants, ensuring that the server can effectively obtain the model update data of each participant, improving the efficiency and security of server-side model aggregation, and constructing an efficient and secure model data interaction link between the server and the participants.

[0070] Based on the post-quantum blockchain federated learning method provided in the above embodiments, this application also provides another possible implementation of the post-quantum blockchain federated learning method. Figure 4This is the fourth flowchart illustrating a post-quantum blockchain federated learning method provided in this application embodiment; as shown below. Figure 4 As shown, before sending the first encrypted message to any participant, the method further includes: S401. Based on the server's previous round chain key, derive the server's current round model encryption key.

[0071] S402. Based on the server's current round model encryption key, encrypt the task transaction to obtain the first encrypted message.

[0072] In this embodiment, the current round chain key is also derived based on the server's previous round chain key.

[0073] Based on the server's previous chain key Run the Key Derivation Function (KDF) to generate the current round model encryption key for the server. and the current wheel chain key Specifically, it is expressed as: .

[0074] Then the server's current round model encryption key is used. Information on the previous round of global model in the task transaction Encryption is performed to obtain the first encrypted message. .

[0075] In the method provided in this application embodiment, by using a unified key derivation rule with the participating parties, it is ensured that the current model encryption key derived by the server and the participating parties is completely consistent, thus guaranteeing the bidirectional decryptability of the encrypted message; at the same time, the AES-256-GCM algorithm is used to encrypt the previous round of global model information in the task transaction, which not only improves the security of encrypted transmission, but also avoids the security risk caused by ciphertext duplication.

[0076] This application also provides another possible implementation of a post-quantum blockchain federated learning method. Figure 5 This is the fifth flowchart illustrating a post-quantum blockchain federated learning method provided in this application embodiment; as shown below. Figure 5 As shown, the method also includes: S501. Use the encapsulation key generation algorithm to generate the server encapsulation key and the server decapsulation key.

[0077] S502. Generate the server public key based on the random number.

[0078] S503. Construct a first assembly message based on the server public key and the server encapsulation key, and send the first assembly message to any participating party.

[0079] In this embodiment, during the initialization phase, the server first completes registration on the blockchain. Specifically, the server first executes the Encapsulation Key Generation Algorithm ML-KEM and randomly selects a 256-bit seed. Generate encapsulation key pairs using standard algorithms. ,in Encapsulate the key for the publicly available server. Decapsulate the private server key. Simultaneously generate an elliptic curve key pair; specifically, select random numbers on the secp256k1 curve. As the server's private key, based on the server's private key Calculate the server's public key ,in This is the base point of the curve.

[0080] Then, the server uses the server's public key. and server encapsulation key Construct the first assembly message The first assembly message also includes: server registration transaction. and project identifier Example, first assembly message Represented as: .

[0081] The first assembly message is used to enable any participant to generate a first root key based on the server's public key and the server's encapsulation key.

[0082] The method provided in this application uses the NIST-standardized ML-KEM algorithm to generate quantum-resistant encapsulation / decapsulation key pairs, fundamentally resisting the threat of quantum computing cracking the keys. Simultaneously, it generates ECDH key pairs based on the secp256k1 elliptic curve, balancing the efficiency of key negotiation. By constructing a first assembled message containing both public keys and attaching a signature, the authenticity and integrity of the public key transmission are ensured, allowing participants to effectively verify the server's identity and conduct subsequent key negotiations. This lays the foundation for the quantum-resistant security architecture of the entire system and solves the problems of single keys and lack of quantum resistance in traditional federated learning servers.

[0083] This application also provides another possible implementation of a post-quantum blockchain federated learning method. Figure 6 A flowchart illustrating a post-quantum blockchain federated learning method provided in this application embodiment is shown in Figure 6. Figure 6 As shown, the method also includes: S601, Receive the second assembly message sent by any participant.

[0084] The second assembled message includes: ciphertext and the public keys of the participating parties.

[0085] In this embodiment, any participant, based on the ciphertext and the public keys of the participating parties Constructing the second assembly message Second assembly message This also includes: the registration of participating parties. and project identifier The second assembly message is represented as: The second assembled message is signed using the private keys of each participant to obtain a signature value. Finally, the second assembled message and the signature value are sent to the server through a secure channel. Therefore, the server can receive the second assembled message sent by any participant.

[0086] S602. Generate the first shared secret based on the public key of the participating party and the private key of the server.

[0087] Specifically, the server performs ECDH shared secret computation, sharing the public keys of the participating parties. With server private key Perform elliptic curve dot product to obtain the first shared secret. Specifically, it is expressed as: This value is equal to the first shared secret calculated by any of the participants under the same parameters of the curve.

[0088] S603. Based on the server's decapsulation key and ciphertext, a post-quantum decapsulation algorithm is used to generate a second shared secret.

[0089] Specifically, based on the server's decapsulation key Run the Kyber desealization algorithm to generate a second shared secret. Specifically, it is expressed as: ,in It is a 256-bit uniform random number.

[0090] S604. Based on the first shared secret and the second shared secret, use the asymmetric ratchet key derivation function to generate a second key that is the same as the first key, and use it as the first chain key of the server.

[0091] Similarly, the first shared secret Second shared secret After concatenation, input the asymmetric ratchet key derivation function. First, the HKDF-Extract stage is executed, using a zero-byte sequence as the salt to extract the intermediate key. The HKDF-Expand phase is then executed, using labels. The output length is 64 bytes, generating the second root key. ,in This is a single-byte counter. The first and second keys are the same.

[0092] In the method provided in this application embodiment, by verifying and parsing the second assembly message of the participants, ECDH shared secret computation and ML-KEM post-quantum decapsulation are performed respectively to accurately restore the double shared secret consistent with the participants; then, a root key identical to that of the participants is generated through a unified asymmetric ratchet key derivation function, and this root key is used as the first round chain key, realizing the synchronization and unification of the key system between the server and the participants. This not only ensures the security and consistency of key negotiation, but also achieves forward security through the fusion of post-quantum and traditional cryptography. Even if a key is leaked in a subsequent round, it will not affect the security of the root key, thus solving the problems of inconsistent key negotiation and weak resistance to quantum attacks in traditional federated learning.

[0093] This application also provides another possible implementation of a post-quantum blockchain federated learning method. Figure 7 This is the seventh flowchart illustrating a post-quantum blockchain federated learning method provided in this application embodiment; as shown... Figure 7 As shown, the method also includes: S701. Use a verification model to score the quality of the second encrypted message and generate a feedback transaction.

[0094] S702, Submit the feedback transaction to the blockchain.

[0095] In this embodiment, the server uses the server's current round model encryption key to decrypt the current round global model information in the second encrypted message to obtain the current round global model parameters.

[0096] The server deploys a pre-defined model quality verification model, which is scored based on three dimensions: parameter rationality, training effectiveness, and data consistency. The scoring range is [insert range here]. , where 1 indicates the model update quality is optimal, and -1 indicates the model update is invalid or abnormal.

[0097] The server generates feedback transactions based on the quality score. Feedback transactions Specifically, it is expressed as follows: ,in, For example, T=0 indicates that training has not ended (T=1 indicates that the project has ended). This refers to the blockchain account address of the participating party. Finally, the feedback transaction is submitted to the blockchain.

[0098] The method provided in this application uses a pre-set multi-dimensional verification model to scientifically score the model updates of participating parties, effectively identifying valid, invalid, and even abnormal model update data, providing accurate core evidence for subsequent reputation assessment. Simultaneously, the quality scoring results are encapsulated as feedback transactions and stored on the blockchain. Utilizing the immutability and traceability of blockchain, the fairness and transparency of the scoring results are ensured, allowing both participating parties and regulatory agencies to query and supervise, avoiding the subjectivity and opacity of manual assessment. Furthermore, by linking participating party accounts through smart contracts, data support is provided for subsequent automated reward and punishment and permission management, improving the governability of the federated learning system.

[0099] This application also provides another possible implementation of a post-quantum blockchain federated learning method. Figure 8 This is the eighth flowchart illustrating a post-quantum blockchain federated learning method provided in this application embodiment; as shown below. Figure 8 As shown, the method also includes: S801. Use a smart contract model to score the reputation of the second encrypted message and generate reputation values ​​for each participant.

[0100] Specifically, a reputation assessment smart contract is deployed in advance. This contract is a pre-defined automated execution program that uses the participant's historical model quality score, training participation rate, message transmission timeliness, and parameter compliance as the core evaluation dimensions, and sets the weight of each dimension. For example, the model quality score has a weight of 0.7, the training participation rate has a weight of 0.15, the transmission timeliness has a weight of 0.1, and the parameter compliance has a weight of 0.05.

[0101] The smart contract extracts historical feedback transactions from each participant to obtain a model quality score for each round; it calculates the reputation value of each participant according to a weighted formula, based on the training participation rate, message transmission timeliness, and parameter compliance of each participant as the core evaluation dimensions.

[0102] S802. Based on the reputation value of each participant, impose training restrictions on each participant.

[0103] Specifically, the reputation scores of each participant are compared with a preset reputation threshold. If a participant's reputation score is lower than the low reputation threshold, the participant is identified as a low-reputation participant and is restricted from participating in subsequent training.

[0104] It should be noted that the server will trigger an asymmetric ratchet update, while the symmetric ratchet count will be updated later. Reaching the threshold Time (e.g.) The server generates a new ML-KEM and ECDH key pair, broadcasts the new public key through an off-chain channel, and updates the public key hash field in the task publication transaction. After receiving the new public key, participants execute the root key establishment process to generate a new generation of root keys. .

[0105] In addition, after each round of model transmission is completed, both parties immediately delete the used model keys. Only retain the current chain key. Used for the next round of derivation. When the project terminates. Upon triggering, all key materials are securely erased, ensuring forward security.

[0106] The method provided in this application generates participant reputation values ​​through multi-dimensional weighted scoring rules, making the evaluation results more scientific and comprehensive, and accurately reflecting the actual contributions and behavioral performance of participants in federated learning. By imposing access restrictions on low-reputation participants, a balance between privacy protection and behavioral supervision is achieved, and malicious or low-quality participants can be effectively eliminated, thereby improving the training quality of the global model.

[0107] The following will continue to explain the post-quantum blockchain federated learning device and post-quantum blockchain federated learning system provided in any of the above embodiments of this application. The specific implementation process and the resulting technical effects are the same as those in the corresponding method embodiments. For the sake of brevity, the parts not mentioned in this embodiment can be referred to the corresponding content in the method embodiments.

[0108] The post-quantum blockchain federated learning system provided in this application includes: multiple participants and a server. Any of the multiple participants is used to execute the steps of the post-quantum blockchain federated learning method described above, and the server is used to execute the steps of the post-quantum blockchain federated learning method described above. The specific execution content is described above and will not be repeated here.

[0109] Figure 9 This is a schematic diagram of the functional modules of a post-quantum blockchain federated learning device provided in an embodiment of this application. Figure 9 As shown, the device 100, applicable to any one of multiple participating parties, includes: The first receiving module 110 is used to receive the first encrypted message sent after the server authentication is completed. The first encrypted message includes: task transaction, and the task transaction includes: global model information of the previous round. The first derived module 120 is used to derive the current round model encryption key of any participant based on the previous round chain key of any participant, and to decrypt the previous round global model information to obtain the previous round global model parameters in the previous round global model information. Training module 130 is used to train a local model based on the global model parameters of the previous round using a local dataset, and obtain the global model parameters of the current round. The first building module 140 is used to build update transactions based on the global model parameters of the current round; The first encryption module 150 is used to encrypt the current round global model information in the update transaction using the current round model encryption key of any participant, to obtain a second encrypted message, and send it to the server. The current round global model information includes: current round global model parameters.

[0110] Optionally, the first receiving module 110 is further configured to receive a first assembly message sent by the server, the first assembly message including: a server public key and a server encapsulation key; The first generation module is used to generate a first shared secret based on the server's public key and the private keys of the participants; generate ciphertext and a second shared secret based on the server's encapsulation key using a post-quantum encapsulation algorithm; and generate a first root key as the first chain key for any participant using an asymmetric ratchet key derivation function based on the first and second shared secrets. The first sending module is used to send a second assembly message to the server. The second assembly message includes ciphertext and the public keys of the participating parties, so that the server can generate a second root key that is the same as the first root key based on the ciphertext and the public keys of the participating parties.

[0111] Optionally, the first derivation module 120 is also configured to derive the current round chain key based on the previous round chain key of any participant.

[0112] Figure 10 A schematic diagram of the functional modules of another post-quantum blockchain federated learning device provided in an embodiment of this application. Figure 10 As shown, the device 200, applied to a server, includes: The second sending module 210 is used to send a first encrypted message to any participant. The first encrypted message includes a task transaction, which includes information about the previous round's global model. The first encrypted message enables any participant to derive its current round's model encryption key based on its previous round's chain key, and to decrypt the previous round's global model information to obtain the previous round's global model parameters. Based on the previous round's global model parameters, a local model is trained using a local dataset to obtain the current round's global model parameters. An update transaction is constructed based on the current round's global model parameters. The current round's global model information in the update transaction is encrypted using any participant's current round's model encryption key to obtain a second encrypted message. The second receiving module 220 is used to receive a second encrypted message sent by any of the participating parties.

[0113] Optionally, the second derived module is used to derive the current round model encryption key of the server based on the previous round chain key of the server; The second encryption module is used to encrypt the previous round global model information in the task transaction according to the current round model encryption key of the server, so as to obtain the first encrypted message.

[0114] Optionally, the device further includes: The second generation module is used to generate a server encapsulation key and a server decapsulation key using an encapsulation key generation algorithm; and to generate a server public key based on a random number. The building module is used to construct a first assembly message based on the server public key and the server encapsulation key, and send the first assembly message to any participant. The first assembly message is used to enable any participant to generate a first root key based on the server public key and the server encapsulation key.

[0115] Optionally, the second receiving module 220 is further configured to receive a second assembly message sent by any participant, the second assembly message including: ciphertext and the participant's public key; The second generation module is also used to generate a first shared secret based on the public keys of the participants and the private key of the server; generate a second shared secret based on the server's decapsulation key and ciphertext using a post-quantum decapsulation algorithm; and generate a second root key identical to the first root key using an asymmetric ratchet key derivation function based on the first and second shared secrets, and use it as the server's first chain key.

[0116] Optionally, the second generation module is also used to perform a quality score on the second encrypted message using a verification model, generate a feedback transaction, and submit the feedback transaction to the blockchain.

[0117] Optionally, the second generation module is further configured to use a smart contract model to perform reputation scoring on the second encrypted message, generate reputation values ​​for each participant, and impose training constraints on each participant based on their reputation values.

[0118] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.

[0119] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).

[0120] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A post-quantum blockchain federated learning method, characterized in that, The method, applicable to any one of multiple participants, includes: Upon receiving a first encrypted message sent after server authentication is completed, the first encrypted message includes: a task transaction, the task transaction including: the previous round of global model information; Based on the previous round chain key of any participant, derive the current round model encryption key of any participant, and decrypt the previous round global model information to obtain the previous round global model parameters in the previous round global model information; Based on the global model parameters from the previous round, a local model is trained using a local dataset to obtain the global model parameters for the current round. Construct an update transaction based on the global model parameters of the current round; The current round global model information in the update transaction is encrypted using the current round model encryption key of any of the participants to obtain a second encrypted message, which is then sent to the server. The current round global model information includes the current round global model parameters.

2. The method according to claim 1, characterized in that, Before the first encrypted message sent after the receiving server completes authentication, the method further includes: Receive a first assembly message sent by the server, the first assembly message including: the server public key and the server encapsulation key; A first shared secret is generated based on the server's public key and the participants' private keys; Based on the server encapsulation key, a post-quantum encapsulation algorithm is used to generate ciphertext and a second shared secret; Based on the first shared secret and the second shared secret, an asymmetric ratchet key derivation function is used to generate a first root key as the first chain key for any of the participants; A second assembly message is sent to the server, the second assembly message including: the ciphertext and the public key of the participating party, so that the server generates a second root key that is the same as the first root key based on the ciphertext and the public key of the participating party.

3. The method according to claim 1, characterized in that, The method further includes: The current round chain key is derived from the previous round chain key of any of the participants.

4. A post-quantum blockchain federated learning method, characterized in that, Applied to a server, the method includes: A first encrypted message is sent to any participating party. The first encrypted message includes a task transaction, which includes information about the previous round's global model. The first encrypted message enables any participating party to derive its current round's model encryption key based on its previous round's chain key, and to decrypt the previous round's global model information to obtain the previous round's global model parameters. Based on the previous round's global model parameters, a local model is trained using a local dataset to obtain the current round's global model parameters. An update transaction is constructed based on the current round's global model parameters. The current round's global model information in the update transaction is encrypted using the current round's model encryption key of any participating party to obtain a second encrypted message. Receive the second encrypted message sent by any of the participating parties.

5. The method according to claim 4, characterized in that, Before sending the first encrypted message to any participant, the method further includes: The current round model encryption key of the server is derived from the previous round chain key of the server. Based on the current round model encryption key of the server, the previous round global model information in the task transaction is encrypted to obtain the first encrypted message.

6. The method according to claim 4, characterized in that, The method further includes: A key generation algorithm is used to generate a server encapsulation key and a server decapsulation key. Generate the server public key based on the random number; Based on the server public key and the server encapsulation key, a first assembly message is constructed and sent to any of the participants. The first assembly message is used to enable any participant to generate a first root key based on the server public key and the server encapsulation key.

7. The method according to claim 6, characterized in that, The method further includes: Receive a second assembly message sent by any of the participants, the second assembly message including: ciphertext and the participant's public key; A first shared secret is generated based on the public keys of the participating parties and the private key of the server. Based on the server's decapsulation key and the ciphertext, a second shared secret is generated using a post-quantum decapsulation algorithm; Based on the first shared secret and the second shared secret, an asymmetric ratchet key derivation function is used to generate a second root key that is the same as the first root key, and this second root key is used as the first chain key of the server.

8. The method according to claim 4, characterized in that, The method further includes: The second encrypted message is quality-scored using a verification model, and a feedback transaction is generated. Submit the feedback transaction to the blockchain.

9. The method according to claim 4, characterized in that, The method further includes: A smart contract model is used to score the reputation of the second encrypted message, generating a reputation value for each participant. Training restrictions are imposed on each participant based on their reputation score.

10. A post-quantum blockchain federated learning system, characterized in that, The post-quantum blockchain federated learning system includes: multiple participants and a server, wherein any one of the multiple participants is used to execute the steps of the post-quantum blockchain federated learning method according to any one of claims 1-3, and the server is used to execute the steps of the post-quantum blockchain federated learning method according to any one of claims 4-9.