A dynamic incentive federated learning method based on a trusted execution environment and a blockchain
By combining a trusted execution environment with blockchain, end-to-end trust and privacy protection of the federated learning system are achieved, solving the problems of data privacy and contribution measurement. A trusted, fair and efficient collaborative training platform is established, ensuring transparent and automated incentives and the objectivity of contribution measurement.
Patent Information
- Application Number
- CN202511348762.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-09-22
AI Technical Summary
Existing federated learning schemes suffer from trust bottlenecks in data privacy protection and contribution measurement, failing to achieve end-to-end security and fair incentives. This results in data not being effectively circulated and shared, and the evaluation metrics of centralized servers are too simplistic to truly reflect the quality of contributions.
By combining a Trusted Execution Environment (TEE) with blockchain, data privacy is ensured through session key and remote proof mechanisms within the TEE. A decentralized platform is built using blockchain, and combined with multi-dimensional contribution measurement and evaluation mechanisms, the confidential quantification of contributions and the transparent and automated execution of incentives are achieved.
It achieves end-to-end privacy protection and a trusted environment, ensures the objectivity and fairness of contribution measurement and the transparency of incentive allocation, enhances the robustness and traceability of the system, eliminates platform interference and tampering, and promotes long-term high-quality participation.
Smart Images

Figure CN120875092B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of blockchain, data privacy protection, and federated learning technology, and specifically relates to a dynamic incentive federated learning method based on a trusted execution environment and blockchain. Background Technology
[0002] With the rapid development of mobile internet and the Internet of Things (IoT), numerous distributed devices such as mobile phones and sensors have generated massive amounts of data. This explosive growth in data has brought tremendous opportunities for the application of machine learning. For example, by aggregating operational data from different factories and different models of industrial equipment, machine learning can build high-precision predictive maintenance models, providing early warnings of equipment failures and significantly reducing the huge economic losses caused by unplanned downtime. However, because this industrial data involves highly sensitive business secrets such as core production parameters, processes, and operational efficiency of various enterprises, data silos are often severe, hindering effective data flow and sharing. The traditional method of centrally storing data not only exacerbates data isolation but also faces significant risks of single points of failure and data misuse. Federated learning, as a distributed machine learning technology, allows parties to collaboratively train models without sharing their local raw data, mitigating data privacy issues to some extent. Nevertheless, standard federated learning still faces profound challenges in practical applications. First, the centralized aggregation server is a trust bottleneck in the system; malicious servers can spy on or even tamper with the model gradients uploaded by each participant, thereby inferring sensitive private information. Secondly, the federated learning protocol itself does not consider the quality of contributions from participants. It assumes that all participants are honest and contribute equally, which is not true in reality. Some participants may submit low-quality or even malicious "garbage" updates out of self-interest or malicious motives, thereby polluting the global model and harming the interests of the whole. At the same time, due to the heterogeneity of network environment and device status, clients may disconnect at any time, thus affecting the stability of the aggregation process.
[0003] To address these issues, academia and industry have undertaken a series of explorations. Some solutions introduce blockchain technology to replace centralized servers, but limitations in blockchain's transaction speed and scalability make it difficult to support large-scale, high-frequency federated learning tasks. Other solutions employ different cryptographic tools, such as Differential Privacy (DP), which protects privacy by adding noise, but usually at the cost of sacrificing the model's final accuracy; and Homomorphic Encryption (HE), which supports ciphertext computation, but its enormous computational and communication overhead makes it impractical for training complex models.
[0004] In recent years, Trusted Execution Environments (TEEs) have offered a new approach to solving server trust issues. They enable computation within a hardware-isolated secure zone, ensuring the confidentiality and integrity of the computation process. However, most existing TEE-based federated learning solutions focus only on the secure execution of the aggregation process and fail to address the deeper issue of economic fairness. That is, while TEEs can guarantee the correct execution of aggregation algorithms, they cannot determine the quality of input data updates, nor can they provide a transparent and fair contribution measurement and incentive allocation mechanism. Existing federated learning incentive mechanism research often relies on centralized servers to evaluate contributions and distribute rewards, which reintroduces the trust problem. Furthermore, their evaluation metrics (such as data volume) are too simplistic and fail to accurately reflect contribution quality, making them vulnerable to exploitation by speculators. Therefore, existing technical solutions fail to provide an end-to-end solution that simultaneously meets the following requirements: preventing platform misconduct and protecting data privacy, accurately and reliably measuring the true contribution of each participant, and establishing a fair, transparent, automatically executed economic incentive loop that encourages long-term high-quality participation. How to ensure the fair quantification of contributions and the credibility of incentives while guaranteeing security and privacy has become a bottleneck that urgently needs to be addressed to hinder the large-scale application of federated learning. Summary of the Invention
[0005] The purpose of this invention is to propose a dynamic incentive federated learning method based on a trusted execution environment and blockchain. It aims to provide a trusted, fair, and efficient collaborative training platform for task publishers lacking training data and data clients possessing data. The invention also discloses a dynamic incentive federated learning method operated by a platform service provider. While ensuring that the critical computation process remains fair, intact, and confidential to the platform service provider itself, it fundamentally eliminates the risk of the platform provider snooping on the client's privacy data. Thus, it achieves end-to-end privacy security and trusted contribution incentives within a unified framework.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] A dynamic incentive-based federated learning method based on a trusted execution environment and blockchain is proposed, applicable to a federated learning system composed of task publishers, platform service providers, and data clients; the method includes the following steps:
[0008] Step 1. The task issuer is responsible for defining the task, providing a confidential test set for model evaluation, setting incentive rules, and injecting the total reward; the platform service provider then starts the Trusted Execution Environment (TEE) to generate a one-time session key pair, generates a task announcement, signs it, and publishes it to the blockchain.
[0009] Step 2. The client retrieves the task announcement from the blockchain and verifies the trustworthiness of the TEE; after successful verification, the client downloads the global model for local training and signs the generated model update.
[0010] The client then uses the verified session public key to encrypt the data packet containing the model update and signature, uploads it to the distributed file system, and writes its content identifier (CID) credential to the blockchain.
[0011] Step 3. The platform service provider collects all updated CIDs submitted by clients and imports them into the TEE;
[0012] TEE first uses the session private key to decrypt and verify the model updates submitted by all clients. Then, it calculates the multidimensional comprehensive contribution score for all clients and uses it as the basis for selecting high-quality clients. TEE only aggregates the high-quality updates that pass the selection to generate a new model and generates an aggregation proof. Finally, it performs a signing step on the aggregation proof.
[0013] Step 4. The platform service provider submits the aggregation proof to the on-chain incentive smart contract; after verifying the TEE signature, the incentive smart contract automatically distributes the reward to the corresponding client based on the multi-dimensional comprehensive contribution score in the aggregation proof.
[0014] At the same time, the platform service provider will upload the encrypted new reputation status generated by the TEE and update the on-chain records;
[0015] Step 5. The client obtains the aggregation proof from the blockchain and verifies its validity to confirm that its contribution has been processed correctly. After verification, it downloads a new round of global model and repeats steps 2 to 5 until the task ends.
[0016] The present invention has the following advantages:
[0017] As described above, this invention discloses a dynamically incentivized federated learning method based on a Trusted Execution Environment (TEE). This method achieves dual protection of a trusted distributed environment and hardware-level privacy by organically combining blockchain and a TEE. On the one hand, this invention utilizes blockchain technology to construct a decentralized, transparent, and tamper-proof trusted distributed platform, providing a traceable and non-repudiable underlying foundation for the operation of the entire system, effectively solving the problem of trust dependence on a single centralized institution. On the other hand, by ensuring the security and confidentiality of the computation process at the hardware level, it effectively solves the data privacy challenges in collaborative computing. Specifically, this invention employs a session key mechanism within the TEE to ensure that the private key used to decrypt client data is generated, used, and destroyed within a secure hardware zone, never exposed to the external environment. This prevents any party acting as a platform node from spying on the client's private data. Before submitting data for computation, the client obtains a trusted report Quote signed by the TEE hardware through a Remote Attestation mechanism, cryptographically verifying that the TEE environment on the computing node is authentic, trustworthy, and running the correct program. This invention combines the trusted distributed environment provided by blockchain with hardware-level privacy-preserving computation provided by TEE, establishing an end-to-end trust foundation from the underlying platform to the upper-layer computing. This achieves privacy protection and a trusted environment within a unified framework, decoupling end-to-end privacy protection from platform trust. Furthermore, this invention places the quantification and evaluation process of multi-dimensional contributions entirely within the TEE, using a confidential test set within the TEE to evaluate model quality and combining it with immutable reputation data on the blockchain to ensure objective and fair scoring. No participant, including platform service providers, can interfere with or tamper with the scoring process and results, ensuring that incentive allocation is based on genuine and verifiable contributions, achieving objectivity and credibility in contribution measurement. Additionally, this invention relies on blockchain smart contracts to automate the entire process of reward allocation and reputation updates. After verifying the credible proof of the TEE signature, the smart contract executes according to preset rules without any manual intervention, eliminating the possibility of the platform withholding, misissuing, or delaying reward distribution. The entire economic incentive process is open and transparent, greatly enhancing client confidence and achieving automated and transparent execution of the incentive mechanism. Furthermore, this invention establishes a comprehensive reputation assessment mechanism integrating IQR anomaly detection within the TEE, effectively identifying and suppressing the impact of abnormal or low-quality model updates on the system, thus enhancing the robustness of the global model. Simultaneously, from task deployment and session key publication to each round of aggregate proof and reward distribution, credentials for all key steps are recorded on the blockchain, providing all participants with traceable and non-repudiable audit evidence, ensuring the open verifiability of the entire process, strong robustness, and full auditability. Attached Figure Description
[0018] Figure 1 This is a flowchart of a dynamic incentive federated learning method based on a trusted execution environment and blockchain, as described in an embodiment of the present invention.
[0019] Figure 2 This is a structural block diagram of the dynamic incentive federated learning method based on a trusted execution environment and blockchain in an embodiment of the present invention;
[0020] Figure 3 This is a timing diagram of the dynamic incentive federated learning method based on a trusted execution environment and blockchain in an embodiment of the present invention. Detailed Implementation
[0021] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0022] like Figure 1As shown, traditional centralized platforms in multi-participant federated learning environments suffer from single-point trust bottlenecks, unfair contribution measurement, opaque incentive mechanisms, and vulnerability of client privacy to platform intrusion. This invention describes a dynamic incentive federated learning method based on a Trusted Execution Environment (TEE) and blockchain. This method introduces an end-to-end trusted collaborative training and incentive framework. It utilizes TEE technology to construct an isolated computational black box, enabling model aggregation and contribution measurement that are confidential even to the platform itself. Blockchain and smart contract technologies are used to construct a decentralized trust anchor, achieving process traceability and incentive automation. Combined with a dynamic multi-dimensional incentive and reputation evaluation mechanism executed within the TEE, this achieves two core objectives within a unified framework: confidential quantification of contribution and transparent, automated incentive execution. First, confidential quantification of contribution is entirely completed within the TEE hardware isolation. In this environment, the system accurately scores the client's comprehensive contribution based on preset multi-dimensional indicators (i.e., model quality, historical reputation, asset staking, and participation stability). Because the entire scoring process and the sensitive data it relies on remain confidential to the platform, the fairness and credibility of the quantification results are guaranteed. Secondly, the transparent and automated execution of incentives relies on blockchain and smart contracts. The TEE packages the quantified score into an aggregated proof with its hardware signature and submits it to the blockchain. After verifying the aggregated proof, the smart contract automatically executes the reward distribution according to publicly available rules. All key credentials and results throughout the process are recorded on the blockchain, achieving irrefutable transparency. This closed-loop design fundamentally solves the core problems inherent in traditional centralized platforms, such as trust bottlenecks, privacy leaks, and unfair incentives. Ultimately, even in complex business scenarios, this invention can effectively protect the rights and interests of all parties and drive the ecosystem to achieve healthy and stable development through a built-in economic model. Based on the above inventive concept, this invention first builds a federated learning system comprising a task publisher, a platform service provider (operating the aggregated server and TEE), and a data client, with a blockchain network (including smart contracts) and a distributed file system (IPFS) as its infrastructure. Figure 2 As shown.
[0023] This system is technically implemented and operated by a platform service provider commissioned by the task issuer. The task issuer, as the business requester, is responsible for defining the task objectives and providing the total reward. The platform service provider, as the technical service platform, is responsible for handling all technical aspects, including defining the initial global model, deploying incentive smart contracts, operating the aggregation server and TEE hardware, and coordinating the entire federated learning process. Multiple data clients (such as institutions possessing industrial or medical data) are the providers of data and computing power. Each client is responsible for local training, encrypting and uploading model updates, and updating its own model after receiving rewards. The blockchain network and smart contracts serve as the system's "public ledger" and "automated bank." They manage the identities of all parties, record task announcements and aggregation proofs in an immutable manner, and automatically execute reward distribution and reputation updates based on the trusted output of the TEE, without any manual intervention. The IPFS distributed file system, as the system's "distributed hard drive," is responsible for storing large data objects such as model files and encrypted updates, and achieves trusted access by recording their content identifiers (CIDs) on the chain. The method of this invention is mainly divided into three stages: the initialization stage, the local training stage, and the aggregation stage. The initialization phase requires all parties to register and configure encryption / decryption keys; the local training phase requires the client to train model parameters on the local dataset and encrypt them; the aggregation phase requires the platform service provider to perform a series of security operations in the TEE to obtain the aggregation result.
[0024] like Figure 1 As shown, the dynamic incentive federated learning method based on a trusted execution environment and blockchain in this embodiment is applicable to a federated learning system composed of a task publisher, a platform service provider, and a data client; it includes the following steps:
[0025] Step 1. System initialization and task deployment.
[0026] The task publisher defines the task, provides a confidential test set for model evaluation, sets incentive rules, and injects the total reward; the platform service provider starts the TEE to generate a one-time session key pair, signs the task announcement containing the session public key and smart contract address information, and publishes it to the blockchain.
[0027] Step 1.1. Task initialization.
[0028] All participants (including task issuers, platform service providers, and data clients) register through the consortium blockchain's Membership Service. Each participant generates an asymmetric public-private key pair and obtains a unique identity address on the blockchain associated with its central digital identity authority (CA) certificate. Its public key is registered on the chain as the basis for subsequent identity verification and digital signatures, while its private key is securely kept by each party.
[0029] Step 1.2. Task Issuance.
[0030] After the task issuer clearly states its requirements, it entrusts the platform service provider to determine the initial global model used for training, the loss function to be optimized, and the detailed incentive rules. These rules not only include the total reward amount and the reward distribution tiers, but also specify the client-optional asset staking mechanism. This means that clients can subsequently stake assets into the contract to improve their reputation score in order to obtain higher rewards. The task issuer injects the total reward funds and entrusts the platform service provider to deploy an incentive smart contract containing all the aforementioned incentive rules on the blockchain.
[0031] The platform service provider starts the Trusted Execution Environment (TEE), and within the TEE, calls a cryptographically secure key generation function, KeyGen(), to create a one-time session key pair associated with this federated task.
[0032] .
[0033] in, This represents a security parameter that determines the cryptographic strength of the generated key pair, corresponding to the key length. Indicates the session public key. This represents the session private key. To ensure the private key is securely "saved" even after the TEE is closed for use in subsequent rounds, the TEE calls its unique sealing primitive `Seal()` to encrypt and protect the private key.
[0034] .
[0035] in, This indicates the sealing policy, which defines which TEE instances have the right to unseal and access the content. This represents the private key data packet. After completing the above steps, the TEE will send the session public key. (Plaintext form) and sealed private key data packet The encrypted data is output to an external platform service provider, who then receives the encrypted data. If the data packet cannot be decrypted, it will be persistently stored. At the start of the next round of computation, this data packet will be placed back into a new TEE instance, where it will be decrypted and the session private key will be restored internally, thus achieving secure key transfer and reuse.
[0036] Finally, the platform service provider integrates all the key information of this task into a structured task announcement (Trusted Announcement), denoted as TA. The specific content of this task announcement can be represented by a set of messages:
[0037] .
[0038] in This represents the session public key generated by the TEE and used for this round of tasks. This indicates the storage address of the initial global model on IPFS. This represents the address of the incentive smart contract on the blockchain. `task` represents other task description information; it is a structured task details object containing the specific parameters and rules required for the client to correctly participate in this round of federated learning. Its core fields may include: task name, task description, model and training parameters, flow control parameters, and the code hash value of the TEE program (TEECodeHash), a key verification parameter used to ensure security and trustworthiness.
[0039] Step 2. Local training and encrypted upload on the client side.
[0040] The client obtains the task announcement from the blockchain and verifies the trustworthiness of the TEE through remote proof. After successful verification, the client downloads the global model for local training and signs the generated model update.
[0041] The client then uses the verified session public key to encrypt the data packet containing the model update and signature, uploads it to the distributed file system IPFS, and writes its Content Identifier (CID) credential to the blockchain.
[0042] Step 2.1. Client verification and preparation.
[0043] At the start of a new iteration, the data client first queries the blockchain to obtain the latest task announcement, which includes the session public key issued by the platform service provider. Before trusting and using the session public key, the client performs a remote authentication process to verify the trustworthiness of the TEE; the client challenges the platform service provider, requesting its TEE to generate an identity report quotation containing the hash of the session public key. The platform service provider's TEE generates the identity report quotation, signs it with its hardware-specific key, and returns it to the client; the client then verifies the authenticity of this quotation by interacting with official authentication services such as Intel.
[0044] Once the Quote is verified as valid and the code hash it contains matches the verification parameter hash value TEECodeHash specified in the task announcement, the client is confident that the session public key comes from a secure and correct execution environment and continues with subsequent steps; then the client retrieves the task information from the blockchain, verifies the signature of the session public key, and downloads the initial global model.
[0045] Step 2.2. Local training on the client side.
[0046] The client uses its local private dataset to train the downloaded global model and generates local model updates. .
[0047] To prove the source and integrity of the update, the client first calculates a hash digest of the update content and then digitally signs the digest using its own identity private key to generate a signature. .
[0048] ;
[0049] ;
[0050] in, Indicates the computation of hash digest, This represents the client's private key. This represents a digital signature function.
[0051] Then, in order for the TEE to obtain both the model update and verify its origin after decryption, the client needs to package the model update and signature together to generate a plaintext data packet. :
[0052] ; This indicates a serialization operation.
[0053] Step 2.3. Encrypt the upload.
[0054] To ensure confidentiality, the client uses the session public key verified in step 2.1. Packed Encryption yields encrypted data packets To ensure that only the TEE can read the encrypted data packets The formula is as follows:
[0055] ; This indicates an encryption operation.
[0056] The encrypted result is then uploaded to the distributed file system IPFS, and its unique content identifier is obtained. Finally, the client will contain a and a collection of credentials related to metadata Write it into the blockchain to declare the completion of this round of contributions.
[0057] The set of credentials is represented as follows:
[0058] .
[0059] in This indicates the storage address on IPFS for the encrypted update of client k. This represents the client's unique identifier. This represents the hash value used to update the plaintext model. This represents the client's digital signature on the hash value; Indicates the current iteration round ID. Indicates the timestamp at the time of submission.
[0060] Step 3. Security aggregation and contribution measurement within the TEE.
[0061] The platform service provider collects all updated CIDs submitted by clients and imports them into the TEE.
[0062] The Trusted Execution Environment (TEE) first uses the session private key to decrypt and verify the model update, then executes a unified screening process based on dynamic reputation to calculate a comprehensive contribution score for all clients and use this score to screen out high-quality contributors.
[0063] Subsequently, the TEE aggregation model is updated to generate a new model, and an aggregation proof containing the hash value of the new model and the contribution score information of each client is generated. Finally, the aggregation proof is signed.
[0064] Step 3.1. Data preparation and verification.
[0065] The platform service provider collects all credentials submitted by participating clients in this round from the blockchain. and data packets pointing to its previous round of encrypted reputation. The CID is then imported into the TEE.
[0066] The following steps are executed sequentially within the TEE:
[0067] Decrypt the reputation status from the previous round using the session key:
[0068] TEE first needs to restore the reputation status of client k from the previous round. This reputation status is a structured data packet, the specific composition of which (including historical contribution points, penalty factors, etc.) will be explained in detail later.
[0069] The TEE recovery process is as follows:
[0070] TEE retrieves the encrypted reputation data packet from the imported data, pointing to the previous round of encrypted reputation data for client k. The CID is obtained, and the packet is downloaded from IPFS, then the session private key stored internally is used. Decrypt it operate.
[0071] Then, the decrypted byte stream is deserialized. This operation allows for the complete reconstruction of the plaintext reputation data packet Rep generated in the previous round of calculations within secure memory, for use in subsequent steps of this round.
[0072] .
[0073] The process of using the session private key to decrypt the model update and verify the client signature is as follows:
[0074] I. Decrypt the data packet using the session private key sealed within the TEE content. Encrypted data packets Decryption is performed to restore the plaintext data packets from the client before encryption. The formula is expressed as follows:
[0075] ;
[0076] in This indicates a decryption operation.
[0077] II. Byte Stream The model update and digital signature are separated in the model update and digital signature, and the formula is expressed as follows:
[0078] ;
[0079] in Indicates model update, This refers to a digital signature.
[0080] Next, verify the digital signature.
[0081] III. Recalculate the hash and update the extracted model. Use the exact same hash function to calculate the hash value.
[0082] ;
[0083] in, The formula for calculating hash digests.
[0084] IV. Perform signature verification to check if the model update is complete and originates from client k. The formula is as follows:
[0085] ;
[0086] in, This represents the client's public key. This represents the digital signature verification function.
[0087] Step 3.2. Standardize reputation screening and contribution measurement.
[0088] After decrypting and verifying the model updates of all clients, TEE will perform the following contribution calculation and screening process.
[0089] Performance quantization and anomaly labeling are performed using a confidential test set and the interquartile range (IQR) algorithm.
[0090] I. Represent the model updates from n clients as follows: .
[0091] At this point, TEE still holds the global model from the previous round. and confidential test sets .
[0092] II. For each client k, TEE first evaluates the impact of its model update on global performance. Specifically, it uses the model on the confidential test set. The loss function value is used to achieve this, and the formula is expressed as follows:
[0093] .
[0094] in This indicates that the model loss function value is calculated. After execution, TEE obtains a list containing the loss values of all participating clients. : .
[0095] III. Use the interquartile range (IQR) method to list the loss values. Perform statistical analysis.
[0096] The formula for calculating IQR is: IQR = Q3 - Q1; where Q1 is the first quartile of the data and Q3 is the third quartile; and the outlier detection threshold is set to... .
[0097] Any model update with a loss value exceeding this threshold will be internally marked as an "invalid contribution." This marking will not immediately remove the update, but will trigger a severe reputation penalty in subsequent unified contribution scoring, as detailed below.
[0098] IV.TEE will calculate a unified multidimensional comprehensive contribution score for all clients participating in this round of updates, based on their immediate performance (including the anomaly marker results in III) and long-term reputation. .
[0099] The calculation method for the multidimensional comprehensive contribution score is as follows:
[0100] The quality score will represent the immediate performance in this round. Overall reputation score, representing long-term credibility By pre-setting weights and The weighted sum is used to obtain the multidimensional comprehensive contribution score.
[0101] in, The calculation incorporates historical reputation data recovered from the previous round of reputation status packets and dynamically updates its internal penalty factor based on the anomaly labeling results in the current round of performance evaluation. .
[0102] After calculating the final comprehensive contribution score for all clients, TEE sorts all scores uniformly and uses a dynamic percentile threshold to select the top 75% of contributors for final screening, thus determining the list of qualified contributors for this round.
[0103] Multidimensional comprehensive contribution score The calculation process is as follows:
[0104] .
[0105] in It is the decisive score used to determine the reward for client k in this round; it combines the client's immediate performance and long-term reputation. , These are quality weight and reputation weight, respectively. .
[0106] The quality score for client k in this round is calculated as follows:
[0107] .
[0108] in It is the loss function value generated by the model update of client k in this round of evaluation. Used to prevent the denominator from being zero.
[0109] This is the overall reputation score of client k, calculated as follows:
[0110] .
[0111] in , These represent the weights of historical contributions and asset pledges, respectively. Indicates historical contribution score. This indicates the amount of assets pledged. Indicates the penalty factor. This represents the stabilizing factor.
[0112] Historical contribution points Iterative updates are performed using the exponential moving average method, assigning higher weight to recent performance. Its value in round t is denoted as... The calculation formula is as follows:
[0113] .
[0114] This represents the new historical score after the end of round t. The quality score for the current round t is... For the previous round of historical scores; A smoothing factor is used to control the update rate.
[0115] For clients participating in the task for the first time, their initial historical contribution score Set to 0.
[0116] Asset Pledge Points The calculation formula is as follows:
[0117] .
[0118] in Let k be the amount of funds pledged by client k in the incentive contract, and use a logarithmic function to mitigate the excessive advantage brought by huge amounts of funds, thus achieving diminishing marginal returns.
[0119] Punishment factor It is between [ The multiplier between 1 and 0; where It is a preset system parameter that represents the minimum value of the penalty factor. The value is defined when the task is released and is used to adjust the tolerance of the incentive mechanism.
[0120] An update to client k is deemed an outlier by IQR: it is considered an invalid or malicious contribution and is penalized according to the following formula:
[0121] .
[0122] If client k's update is not identified as an outlier, it is considered a valid contribution, and its reputation is restored, as shown in the following formula:
[0123] .
[0124] in These represent the step size for punishment and recovery, respectively, and can be defined according to the task.
[0125] Stable factor It is a multiplier of 1.0 or greater, used to reward clients who participate consistently and stably over a long period. The value of this factor is determined by a counter called the number of consecutive successes. The calculation yielded the result.
[0126] The counter will be updated based on the client's performance in this round; it will increment by one for successful participation and reset to zero for invalid contributions.
[0127] If the current update is determined to be an "outlier" by IQR, its continuous stable participation is interrupted and the count is reset to zero.
[0128] .
[0129] If the update of client k is valid and is eventually selected to participate in the aggregation: increment the count by one.
[0130] .
[0131] If client k's update is valid but not selected (insufficient reputation ranking), it is not considered an interruption, and the count remains unchanged.
[0132] .
[0133] Calculate the stability factor .
[0134] in It is a stable reward coefficient used to adjust the reward level.
[0135] Step 3.3. Secure aggregation and proof generation.
[0136] Regarding model aggregation, TEE only updates clients that have reached the aforementioned threshold, and uses an arithmetic mean aggregation algorithm to merge them into a new round of global models. This algorithm assigns equal weight to updates from each selected client, eliminating the need for reporting large amounts of data and ensuring fairness in the aggregation process.
[0137] Regarding reputation updates and encryption, TEE calculates a new round of reputation data for all qualified clients and packages it with session public key encryption for use in the next round of evaluation.
[0138] For clients that pass the screening, TEE will calculate the client's multidimensional comprehensive contribution score for this round based on its performance in this round, combined with the complete historical reputation data (including historical contributions, fund staking, behavioral rewards and penalties, and stability) decrypted and recovered from the client's encrypted reputation status in the previous round in step 3.1.
[0139] This comprehensive contribution score is the final basis for the distribution of rewards in this round. It is derived by combining the reputation score, which represents the client's long-term credibility, with the quality score, which represents the direct performance in this round.
[0140] For the selected clients, update the Merkle tree construction according to the aggregation order and calculate the root hash.
[0141] After completing the IQR screening and reputation score calculation, TEE will obtain an ordered list containing m selected high-quality model updates. Then, the hash value of each accepted model update is used as a leaf node to construct a Merkle tree; the TEE will start from the leaf node layer and build the tree layer by layer upwards through iterative pairing and hashing until only one node remains. This node MerkleRoot is the root of the Merkle tree and will eventually be packaged into the aggregate proof as a verifiable digest of all accepted contributions.
[0142] TEE updates all accepted models. Perform an arithmetic average to generate a new global model. .
[0143] .
[0144] in This represents the newly generated global model in round t, i.e., the current round. This represents the global model in round t-1, i.e., the previous round. This indicates the model update submitted by client k. quantity.
[0145] The client's new round of reputation data is packaged and encrypted using the session public key, as follows:
[0146] First, the TEE packages all updated reputation metrics of client k in the current round t into a structured plaintext reputation data packet, denoted as . The structure of this plaintext reputation data packet is as follows:
[0147] .
[0148] in Indicates historical contribution score. Indicates the penalty factor. This represents the stability factor, where t is the current round number; subsequently, TEE will... Serialize it into a continuous byte stream and encrypt it using the session public key.
[0149] .
[0150] in This indicates serialization processing. This indicates an encryption operation.
[0151] Ultimately, the TEE will generate a structured aggregation proof and sign it.
[0152] To ensure the integrity and verifiability of all TEE computation results, this proof not only includes a summary of the new model but also provides an immutable credential for all newly generated encrypted reputation data packets from clients in this round, which will be stored off-chain, through a cryptographic commitment. The proof includes the new model hash, Merkle root, each client's plaintext contribution score, and the reputation state commitment. The parameters are as follows:
[0153] New model hash:
[0154] Newly generated global model hash value .
[0155] Merkel's roots:
[0156] The root hash of all selected Merkle trees to be updated is used as a cryptographic commitment to the valid contribution in this round.
[0157] Contribution score list:
[0158] A list containing each client ID and its corresponding plaintext contribution score.
[0159] Reputation Status Commitment:
[0160] New encrypted reputation data packets generated for all clients The calculated overall hash value. This commitment is recorded in the on-chain proof and used to publicly verify whether the reputation data subsequently uploaded to IPFS by the platform service provider is originally generated by TEE and is complete and tamper-proof.
[0161] TEE serializes this structured aggregation proof and digitally signs the complete serialized data using its own authentication key. This signed aggregation proof is TEE's final output, constituting a computation result credential that can be cryptographically verified externally. Next, TEE serializes this structure and uses the platform service provider's private key... Perform a hash signature on it; .
[0162] in This represents the final digital signature.
[0163] Step 4. Automated stimulus execution and state update.
[0164] The platform service provider submits the aggregated proof to the on-chain incentive smart contract; after the incentive smart contract verifies the TEE signature, it automatically distributes the reward to the corresponding client based on the multi-dimensional comprehensive contribution score in the aggregated proof.
[0165] At the same time, the platform service provider will upload the encrypted new reputation status generated by the TEE and update the on-chain records.
[0166] Platform service providers obtain aggregation proof from TEE And new encrypted reputation data packets for all clients It will then interact with the blockchain according to the following process:
[0167] Step 4.1. Contract verification and reading.
[0168] Platform service providers will aggregate proofs The incentivized smart contract submitted to the chain first verifies the signature of the aggregate proof. Once the verification is successful, the smart contract is certain that the aggregate proof and its contained data (such as the contribution score list) are authentic and tamper-proof. Subsequently, the smart contract reads the publicly available plaintext contribution score list, contributionScores, from the aggregate proof.
[0169] Step 4.2. Automated allocation of contract rewards.
[0170] The technical goal of the dynamic multidimensional incentive mechanism in this invention (dynamic means that reputation and expected benefits are not static but change over time based on continuous behavioral performance; multidimensional means that it does not rely on any single indicator to evaluate clients, but rather considers multiple dimensions such as immediate performance, historical reputation, economic commitment, behavioral performance, and stability) is to establish a closed-loop system that can guide and reward clients for long-term, stable, and high-quality contributions through specific and quantifiable technical indicators. To encourage rational clients to participate continuously, the incentive rules of this invention aim to ensure that the cost incurred by clients in providing high-quality data and computation is rewarded accordingly and predictably through their contribution scores.
[0171] The smart contract automatically calculates the reward each client is entitled to based on the total reward amount and preset reward distribution rules.
[0172] The rules of smart contracts are as follows:
[0173] First, the total contribution will be calculated using the following formula:
[0174] .
[0175] in This represents the total contribution score for this round. represents the overall contribution score of client k, and m represents the total number of clients selected for aggregation in this round.
[0176] For each client k, the reward it receives in this round for:
[0177] .
[0178] in The prize pool amount for this round is determined based on the total reward amount and the total number of rounds. When defining the incentive rules, the task issuer can set an immutable round prize pool allocation model for this federated learning based on the characteristics of the task. Once all rules are established, they are written into the smart contract to ensure that they are completely transparent and immutable.
[0179] A common allocation model is the average allocation method, which distributes the total reward equally across all training rounds. This is a simple and fair baseline strategy suitable for most common scenarios. In addition, there are dynamic allocation strategies. To achieve better incentive effects and guide clients to actively participate in key stages of the task, the following dynamic allocation strategies can be adopted.
[0180] I. Initial Incentive Strategies:
[0181] Allocate a portion of the prize pool towards the initial stages of the task. For example, allocate 30% of the prize money to the first 10% of rounds. This strategy can quickly attract a large number of high-quality clients to participate when the task starts, helping the model converge quickly in the early stages.
[0182] II. Late-stage incentive strategy: Allocate more prize pool funds towards the final stages of the task. For example, allocate 30% of the reward to the last 10% of rounds. This strategy incentivizes clients to participate fully and continuously until the task ends, preventing participant churn in the later stages of training and ensuring the training quality of the model during the fine-tuning phase.
[0183] III. Milestone Reward Strategy: Set reward pool amounts significantly higher than average for key milestone rounds (e.g., round 50, round 100). This provides clear, phased goals for long-term participation, maintaining client engagement.
[0184] Regardless of the complexity of the dynamic allocation function or rules used, all its logic must be embedded in the smart contract code before the task begins. This means that reward allocation is entirely automated, with no intervention from the platform during or after the process, thus ensuring absolute fairness and reliability throughout the incentive process. Finally, the smart contract automatically executes the transfer operation, transferring the calculated reward... The reward is sent from its smart contract address to the on-chain address of client k; the reward distribution is now complete.
[0185] Step 4.3. Automated reputation updates.
[0186] The platform service provider will generate a new encrypted reputation data packet for each client using the TEE. Upload to IPFS and call the smart contract to update the CID pointing to the reputation status of each client on the chain to the latest address.
[0187] The platform service provider obtains the aggregated new model, the signed aggregated proof, and the new encrypted reputation data packet for all clients from the TEE. It first submits the aggregated proof to the on-chain incentive smart contract.
[0188] After verifying the authenticity of the TEE signature, the smart contract reads the plaintext contribution score published in the proof and automatically and trustlessly distributes the rewards to the corresponding client addresses according to the preset incentive rules. After the reward distribution is completed, the platform service provider uploads the new encrypted reputation data packet generated by the TEE to IPFS and calls the smart contract to update the CID pointing to the reputation status of each client on the chain to the latest address, preparing for the next round of reputation calculation.
[0189] Step 5. Client verification and a new round of iterations.
[0190] The client obtains the aggregation proof for this round from the blockchain to verify the validity of its TEE signature.
[0191] After successful verification, the client checks the Merkle root and other information in the proof to confirm that its contribution has been treated fairly and correctly. Once everything is verified correctly, the client securely downloads the new global model from IPFS based on the model hash in the proof and replaces its local model with it. This completes one iteration. The client will then repeat steps 2 through 5 based on the new model until the entire federated learning task reaches the preset number of training epochs or accuracy requirements.
[0192] This invention employs a TEE (Trusted Execution Environment) to place core computations such as model aggregation and contribution measurement within a secure, hardware-isolated zone. Even if the platform service provider (aggregation server) is attacked or engages in malicious behavior, it cannot decrypt or tamper with the core computation process, effectively solving the trust issue associated with centralized platforms. Through a session key mechanism generated and managed within the TEE, each data client can encrypt data using a unified session public key, while decryption is performed solely within the TEE using their private key. This achieves end-to-end privacy protection with multi-party participation, ensuring that the platform cannot access the data. Furthermore, through a dynamic, multi-dimensional incentive and reputation evaluation mechanism established within the TEE, this invention can fairly and reliably quantify client contributions based on a confidential test set. By automating reward execution through smart contracts, it addresses the problems of difficult contribution measurement, insufficient participant incentives, and speculative behavior inherent in traditional federated learning. Moreover, the aggregation mechanism of this invention only targets clients that successfully submit updates in the current round, and its built-in IQR (Incoming Quality Reduction) filtering process can eliminate outliers. Therefore, it can naturally adapt to heterogeneous environments where clients may disconnect or exit at any time, ensuring the robustness of training. This invention provides a novel paradigm for federated learning collaboration and incentives by organically combining TEE, blockchain smart contracts, and dynamic multi-dimensional incentive mechanisms. It achieves secure aggregation and trustworthy measurement in untrusted platform environments, establishes a fair, transparent, and automated incentive and reputation system, effectively resists internal fraud and collusion attacks by the platform, and solves key problems in traditional federated learning such as the inability to fairly quantify contributions and insufficient incentives for participants.
[0193] Furthermore, a specific application of the method of this invention in the field of Industrial Internet of Things (IIoT) is presented, aiming to solve the problem of improving equipment reliability through cross-enterprise collaboration. This scenario consists of an equipment manufacturer as the task initiator, multiple equipment users as data clients, and a third-party technology platform as an intermediary. The goal is to collaboratively train a high-precision equipment failure prediction model without disclosing the core operational data of all parties.
[0194] The roles of the participants are defined as follows:
[0195] The project was initiated by a wind turbine manufacturer. Its goal was to gather equipment operation data from multiple operators to train a machine learning model capable of providing early warnings of gearbox failures for specific models of wind turbines under its brand.
[0196] Platform service provider: A third-party technical service platform. This platform deploys the system described in this invention, including a server cluster with a Trusted Execution Environment (TEE), a consortium blockchain network, and an IPFS distributed file system.
[0197] Data clients: Multiple independent wind farm operators. Each operator possesses operational data of its wind turbine generators (including time-series data from sensors such as vibration, temperature, and speed). This data is their core production information and is highly confidential.
[0198] Step 1. System initialization and task deployment.
[0199] The manufacturer first defines the federated learning task, including the initial global model, the training objective (e.g., predicting the probability of gearbox failure within the next 100 hours), and detailed incentive rules.
[0200] Simultaneously, the manufacturer injected funds into the incentive smart contract deployed by the platform service provider to compensate for data contributions. The platform service provider then activated its server's TEE, generating a one-time session key pair for this task within the TEE. , ).
[0201] Finally, the platform service provider will include the session public key. Content identifier of the initial global model Incentive contract address The task announcement, along with the TEE aggregation program code hash value TEECodeHash, is published to the blockchain.
[0202] Step 2. Client participation and encrypted upload.
[0203] A wind farm operator (client k) obtains task announcements from the blockchain.
[0204] Before participating in the training, client k performs a remote verification process on the platform service provider's TEE.
[0205] Client k verifies that the identity report (Quote) obtained from the TEE is authentic and valid, and that the program hash value contained in the report matches the TEECodeHash in the "Task Announcement". After successful verification, client k confirms the trustworthiness of the computing environment.
[0206] Subsequently, client k uses its private sensor data on its local server to train the model and generate model updates. Client k uses the verified session public key. Model update Encrypt it.
[0207] Client k uploads the encrypted result to IPFS and finally submits the returned Content Identifier (CID) to the blockchain.
[0208] Step 3. Security aggregation and contribution measurement within the TEE.
[0209] The platform service provider collects all updated CIDs submitted by participating clients from the blockchain and imports them into the TEE along with the previous round's cryptographic reputation status CID. The TEE internally executes the following process:
[0210] Use the internally stored session private key Decrypt all client model update and reputation status data, and verify the digital signature of each model update to confirm its origin and integrity.
[0211] After verifying all updates, TEE will perform a contribution calculation and screening process:
[0212] Performance Quantization and Anomaly Marking:
[0213] First, TEE uses its internally confidential test set to evaluate the performance of all model updates.
[0214] Subsequently, statistical analysis was performed using the IQR (interquartile range) algorithm. Updates that exhibited statistically extreme outliers were internally labeled, and this labeling would trigger reputation penalties in subsequent scoring.
[0215] Unified calculation and screening of comprehensive contribution:
[0216] TEE will calculate a unified multidimensional comprehensive contribution score for all clients participating in this round, based on their immediate performance (including the results of the aforementioned anomaly markers) and long-term reputation.
[0217] After the calculation is completed, TEE uses a dynamic percentile threshold to select the top 75% of contributors and sorts their scores to determine the final list of trustworthy and high-quality operators participating in this round of aggregation.
[0218] TEE calculates a unified multidimensional comprehensive contribution score for all participating operators based on their performance in this round and their historical reputation. And based on this multidimensional comprehensive contribution score, the selection is carried out.
[0219] Based on a pre-defined aggregation algorithm, TEE merges all high-quality updates into a new global model. TEE calculates a new round of reputation data for all qualified clients and packages it using the session public key. Encrypt it for use in the next round.
[0220] TEE generates a hash containing the new model. Aggregated proof of key information such as the plaintext contribution score list of each client And sign it using its authentication key.
[0221] Step 4. Automated stimulus and state update.
[0222] Platform service providers obtain aggregation proof from TEE The TEE signature is then submitted to the on-chain incentive smart contract. After verifying the authenticity of the TEE signature, the smart contract reads the list of multi-dimensional comprehensive contribution scores published in the proof.
[0223] Based on the incentive rules preset in the contract (e.g., allocating the prize pool according to contribution scores), compensation funds are automatically and trustlessly distributed to the corresponding client addresses. After the reward distribution is completed, the platform service provider calls the smart contract to update the CID pointing to the reputation status of each client on the blockchain to the latest address.
[0224] Step 5. Iteration.
[0225] The client obtains the aggregation proof for this round from the blockchain, verifies that its contribution has been correctly processed, and then downloads the new round of global model from IPFS based on the model hash in the aggregation proof for local training in the next round.
[0226] Repeat steps 2 through 5 until the global model reaches the preset prediction accuracy requirement, at which point the task terminates.
[0227] As can be seen from these specific examples, the method of this invention enables different market entities to complete collaborative analysis of high-value industrial data without the need for mutual trust or exposure of private data. This achieves equipment failure prediction that far exceeds the capabilities of a single entity and ensures fairness, transparency, and automation in contribution assessment and benefit distribution.
[0228] This invention belongs to the fields of data privacy protection and distributed computing technology. It aims to provide a trusted, fair, and efficient collaborative training platform for task publishers lacking training data and data clients possessing data. It discloses a dynamic incentive federated learning method operated by a platform service provider, based on a trusted execution environment and blockchain. First, this method utilizes a TEE (Trusted Execution Environment) to construct a core computing security zone, placing key processes such as model aggregation, client selection, and contribution measurement within a hardware-isolated trusted environment to ensure fairness and confidentiality for all participants. Then, it employs blockchain and smart contract technology as a decentralized trust foundation to achieve effective management of participant identities, tamper-proof recording of key proofs, and automated allocation of economic incentives, thereby establishing platform credibility. Next, it establishes a dynamic incentive and reputation system executed within the TEE, capable of credibly quantifying and automatically rewarding client contributions based on multi-dimensional indicators such as model quality, historical reputation, asset staking, and participation stability, to incentivize high-quality long-term participation. Finally, it implements end-to-end data encryption through a session key mechanism within the TEE, ensuring that even the platform service provider cannot spy on client updates, effectively protecting client data privacy. This invention constructs a trustworthy, fair, and efficient federated learning incentive ecosystem, effectively resisting key issues such as internal fraud by platform service providers, collusion attacks with clients, and the inability to fairly quantify contributions in traditional federated learning.
[0229] Of course, the above description is only a preferred embodiment of the present invention. The present invention is not limited to the above-described embodiments. It should be noted that any equivalent substitutions or obvious modifications made by those skilled in the art under the guidance of this specification fall within the scope of this specification and should be protected by the present invention.
Claims
1. A dynamic incentive federated learning method based on a trusted execution environment and a blockchain, suitable for a federated learning system composed of a task publisher, a platform service provider and a data client; characterized in that, Comprising the following steps: Step 1. The task publisher is responsible for defining the task, providing a confidential test set for model evaluation, setting the incentive rules, and injecting the total reward; the platform service provider initiates the trusted execution environment (TEE) to generate a one-time session key pair, generates a task announcement and signs it before publishing it to the blockchain; Step 2. The client obtains the task announcement from the blockchain and verifies the credibility of the TEE; after verification, the client downloads the global model for local training and signs the generated model update; Then the client uses the verified session public key to encrypt the data packet containing the model update and signature, uploads it to the distributed file system, and writes the content identifier (CID) certificate to the blockchain; Step 3. The platform service provider collects all client-submitted update CIDs and imports them into the TEE; The TEE first decrypts and verifies all client-submitted model updates using the session private key, then calculates the multi-dimensional comprehensive contribution score for all clients, which serves as the basis for screening high-quality clients; the TEE only aggregates high-quality updates to generate a new model, generates an aggregation proof, and finally signs the aggregation proof; Step 4. The platform service provider submits the aggregation proof to the on-chain incentive smart contract; after the incentive smart contract verifies the TEE signature, it automatically distributes rewards to the corresponding clients according to the multi-dimensional comprehensive contribution score in the aggregation proof; Meanwhile, the platform service provider uploads the encrypted new reputation status generated by the TEE and updates the on-chain record; Step 5. The client obtains the aggregation proof from the blockchain, verifies its validity to confirm that its contribution has been properly processed; after verification, the client downloads the new global model and repeats steps 2 to 5 until the task is completed.
2. The method of claim 1, wherein, In step 1, the construction process of the federated learning system is as follows: Build a federated learning system that includes a task publisher, a platform service provider, and multiple data clients, and use a blockchain network that deploys an incentive smart contract and a distributed file system (IPFS) as infrastructure; The platform service provider sets up an operation aggregation server and a trusted execution environment (TEE); The task publisher defines the task and provides the total reward through its corresponding node; The platform service provider handles all technical aspects, including defining the initial global model, deploying the incentive smart contract, operating the aggregation server and TEE hardware, and coordinating the entire federated learning process through its corresponding node; Data clients perform local training, encrypt and upload model updates, and update their models after receiving rewards; The blockchain network and the incentive smart contract are responsible for managing the identities of all participants, recording task announcements and aggregation proofs in an unalterable manner, and automatically executing reward distribution and reputation updates based on the trusted output of the TEE; The distributed file system (IPFS) serves as the distributed hard drive of the system, storing data objects including model files and encrypted model updates, and enabling trusted access through on-chain recording of content identifiers (CIDs).
3. The method of claim 1, wherein, In step 1, the platform service provider initiates a Trusted Execution Environment (TEE) and calls a cryptographically secure key generation function KeyGen() inside the TEE to create a one-time session key pair associated with the current federated task; ; wherein, represents a security parameter, denotes a session public key, denotes a session private key; The TEE calls its own sealing primitive Seal() to encrypt and protect the private key, which can be expressed as follows: ; wherein, represents a sealing policy, represents a private key data packet; TEE will session public key and sealed private key data package to an external platform service provider, which receives the encrypted and cannot decrypt, will persistently store it; At the beginning of the next round of calculation, the private key packet is placed back into the new TEE instance, and the session private key is unsealed and restored by the TEE inside, thereby achieving secure transmission and reuse of the key; Finally, the platform service provider integrates all the key information of the current task into a structured task announcement, denoted as TA; the specific content of the task announcement is represented by a message set: ; wherein represents a session public key generated by the TEE for the current round of tasks, represents a storage address of the initial global model on the IPFS, represents an address of the incentive smart contract on the blockchain; represents other task description information, which is a structured task detail object containing specific parameters and rules required for the client to correctly participate in the current round of federated learning, and its core fields include: Task name, task description, model and training parameters, process control parameters, and key verification parameters TEE program code hash TEECodeHash.
4. The method of claim 1, wherein, In step 2, at the beginning of a new iteration, the data client first queries and obtains the latest task announcement from the blockchain, which contains the session public key published by the platform service provider; Before trusting and using the session public key, the client performs a remote attestation process to verify the trustworthiness of the TEE; the client initiates a challenge to the platform service provider, requiring the TEE to generate an identity report Quote containing the session public key hash; The TEE of the platform service provider generates the identity report Quote and returns it to the client after signing it with its hardware-specific key; the client verifies the authenticity of the Quote by interacting with the official attestation service; When the Quote is verified as valid and the code hash contained therein matches the verification parameter hash TEECodeHash specified in the task announcement, the client is convinced that the session public key comes from a secure and correct execution environment, and proceeds to the next step; then the client obtains the task information from the blockchain, verifies the signature of the session public key, and downloads the initial global model.
5. The method of claim 1, wherein, In step 2, the client trains the downloaded global model with its local private dataset to generate a local model update ; The client first computes a hash digest of its update content and generates a signature ; ; ; wherein, represents computing a hash digest, represents a client private key, represents a digital signature function; Then, in order to let the TEE get both the model update and verify its source after decryption, the client needs to package the model update and signature together to generate a plaintext data packet : ; wherein represents a serialization operation; To ensure confidentiality, the client uses the validated session public key The packaged encrypted data packet : ; wherein represents an encryption operation; The encryption result is then uploaded to the distributed file system IPFS, and its unique content identifier is obtained ; Finally the client writes a set of credentials and related metadata into the blockchain; the set of credentials is represented as follows: write blockchain; the set of credentials is represented as follows: ; wherein represents the storage address of the encrypted update of the client k on the IPFS, represents the unique identity of the client, represents the hash value of the plaintext model update, represents the digital signature of the hash value by the client; represents the current iteration round ID, represents the timestamp at the time of submission.
6. The method of claim 1, wherein, In step 3, the platform service collects all the submitted credentials from the blockchain for the participating clients in this round and the CID of the previous round encrypted reputation data package together into the TEE. The TEE inside sequentially performs the following steps: Decrypt the reputation status of the last round using the session key, the TEE first needs to restore the reputation status of client k in the last round, which is a structured data packet; the restoration process of the TEE is as follows: TEE retrieves the encrypted reputation data packet from the imported data, pointing to the previous round of encrypted reputation data for client k. The CID is obtained, and the packet is downloaded from IPFS, then the session private key stored internally is used. Decrypt it operate; The decrypted byte stream is deserialized again, i.e. The operation is performed so that the plaintext reputation data packet Rep generated by the previous round of computation is completely restored in the secure memory for use in the subsequent steps of the current round. ; Decrypt the model update using the session private key and verify the client signature, the process is as follows: I. Decrypt the data packet, using the TEE content sealed session private key On the encrypted data packet Decrypt to restore the plaintext data packet before encryption by the client The formula is as follows: ; wherein represents a decryption operation; II. The byte stream is separated into a model update and a digital signature, expressed by the following formula: ; wherein denotes a model update, denotes a digital signature; III. Recompute hash, update model extracted The same hash function is used to compute the hash value; ; wherein, represents a formula for calculating a hash digest; IV. Perform signature verification to check whether the model update is complete and comes from client k, which can be expressed as follows: ; wherein, represents a client public key, represents a digital signature verification function.
7. The method of claim 1, wherein, In step 3, the Trusted Execution Environment (TEE) performs a unified screening process based on dynamic reputation to calculate a unified multi-dimensional comprehensive contribution score for all clients, which combines the model performance of the current round and historical reputation data, and has a built-in punishment mechanism for statistical abnormal updates; the process is as follows: Based on the privacy-preserving test set and the interquartile range (IQR) algorithm, the performance is quantified and marked as abnormal; I. Represent the model updates from n clients as ; at this time the TEE also holds the global model from the previous round and the secret test set ; II. For each client k, the TEE first evaluates the impact of its model update on the global performance, in particular, using the loss function value of the model on the secret test set , which is expressed as follows: ; wherein represents the loss function value of the calculation model, represents the loss value of the client k; after the execution, the TEE obtains a list containing the loss values of all participating clients : ; III. Adopting the interquartile range IQR method to the list of loss values statistical analysis; The calculation formula of IQR is: IQR = Q3 - Q1; where Q1 is the first quartile of the data and Q3 is the third quartile; and setting the outlier detection threshold to ; any model update with a loss value above this outlier detection threshold will be internally marked as invalid contribution; this marking will not immediately reject the update, but will trigger a severe reputation penalty in the subsequent unified contribution score; IV. The TEE is a unified multi-dimensional contribution score for all the clients participating in the round of update, calculated based on their immediate performance and long-term reputation The score is calculated as follows: The quality score representing the current round performance The overall reputation score representing the long-term reputation By preset weights And Weighted sum, get multi-dimensional comprehensive contribution score; wherein, The calculation of the reputation score will incorporate the historical reputation data recovered from the previous round reputation state package and dynamically update its internal penalty factors according to the abnormality flagging results in the current round performance evaluation ; After calculating the final contribution score for all clients, the TEE sorts all scores uniformly and selects the top 75% of the scores using dynamic percentile threshold to determine the list of qualified contributors in this round.
8. The method of claim 7, wherein, The multi-dimensional comprehensive contribution score The calculation process is as follows: ; wherein is the decisive score finally used to determine the round reward for client k; it combines the client's immediate performance and long-term reputation, , are the quality weight and reputation weight, respectively, and ; The quality score for client k in this round is calculated as follows: ; wherein is the model update for client k that results in the loss function value, for preventing the denominator from being zero; is the aggregate reputation score of client k, computed as follows: ; wherein , respectively represent the weight of historical contribution and asset pledge; represents the historical contribution score, represents the asset pledge score, represents the penalty factor, represents the stability factor; Historical contribution score The value of the historical contribution score at the t-th round is denoted as and is calculated as follows: ; denotes the new history score after the current t-th round ends, is the quality score of the current t-th round, i.e. is the history score of the previous round; is a smoothing factor to control the rate of update; For a client participating in a task for the first time, its initial historical contribution score is set to 0; Asset-based financing The calculation formula is as follows: ; wherein is the amount of funds staked by client k in the incentive contract, and the logarithmic function is used to weaken the excessive advantage of large funds and achieve diminishing marginal returns; penalty factor is a multiplier between [ , 1.0]; is a preset system parameter representing the minimum value of the penalty factor, is defined at the time of task publishing and is used to adjust the tolerance of the incentive mechanism; If the update of client k is determined as an outlier by IQR, it is considered as an invalid or malicious contribution, and a penalty is applied as follows: ; If the update of client k is not determined as an outlier, it is considered as a valid contribution, and the reputation of client k is restored as follows: ; wherein respectively denote the step of punishment and recovery; stability factor is a multiplier greater than or equal to 1.0 that rewards clients for long-term, continuous stable participation; the value of this factor is calculated from a counter called consecutive successes is calculated The counter is updated according to the performance of the client in this round: success in participating adds one, and invalid contribution resets to zero. If the update of client k is determined as an outlier by IQR, its continuous stable participation is interrupted, and the counter is reset to zero. ; If the update of client k is valid and is finally selected to participate in aggregation, the counter is incremented by one. ; If the update of client k is valid but is not selected, i.e., the reputation ranking is not high enough, it is not considered as an interruption, and the counter remains unchanged. ; Computing stability factors ; wherein is a stability reward coefficient, used to adjust the reward magnitude.
9. The method of claim 1, wherein, In step 3, after the unified contribution calculation and screening of all clients are completed, the TEE obtains an ordered list containing m selected high-quality model updates ; The hash value of each accepted model update is used as a leaf node to construct a Merkle tree. The TEE starts from the leaf node layer and iteratively pairs and hashes to build the tree layer by layer until only one node is left. This node, MerkleRoot, is the root of the Merkle tree, which will be packaged into the aggregation proof. The TEE generates a new round of global model by performing an arithmetic average on all accepted model updates ; ; wherein denotes the newly generated global model of the t-th round, i.e., the current round, denotes the global model of the t-1-th round, i.e., the previous round, denotes the model update submitted by the client k, and m denotes the total number of clients finally selected to participate in aggregation in the current round. The reputation data of the client in the new round is packaged and encrypted with the session public key as follows: Firstly, TEE will package the updated reputation indicators of client k in the current round t into a structured plaintext reputation data packet, denoted as The structure of the plaintext reputation data packet is shown as follows: ; wherein represents a historical contribution score, represents a penalty factor, represents a stability factor, t is the current round number; the TEE will then serialize into a continuous byte stream and encrypt using the session public key; ; wherein represents a serialization process, represents an encryption process operation; represents an encrypted reputation data packet; Ultimately, the TEE will generate a structured aggregate proof and sign it; The aggregation proof contains the new model hash, the Merkle tree root, the plaintext contribution score of each client, and a cryptographic commitment to ensure the integrity of the new encrypted reputation state. Next the TEE serializes this structure with the platform vendor's private key and hashes it. ; wherein represents the final digital signature.
10. The method of claim 1, wherein, In step 4, the platform service provider obtains the aggregated attestation from the TEE and all the new encrypted reputation data packets for the clients ; it will then interact with the blockchain as follows: Step 4.
1. The platform service provider aggregates the proofs to the incentive smart contract on the chain, which verifies the signature of the aggregated proof; upon verification, the smart contract reads the list of public plaintext contribution scores from the aggregated proof; Step 4.
2. The smart contract automatically calculates the reward each client should receive based on the total reward and the pre-set reward distribution rules. First, calculate the total contribution score as follows: ; wherein denotes the total contribution score of the current round, denotes the overall contribution score of the client k, and m denotes the total number of clients selected for aggregation in the current round. For each client k, the reward it obtains in its round is: ; wherein is the current round prize pool amount determined from the total prize and total rounds; the final smart contract will automatically execute the transfer operation to send the calculated from its smart contract address to the on-chain address of client k; Step 4.
3. The platform service provider generates a new encrypted reputation data package for each client with TEE Upload to IPFS and call the smart contract to update the CID pointing to the on-chain reputation status of each client to the latest address.
Citation Information
Patent Citations
Multi-party secure computing implementation method based on block chain technology
CN112115204A
Federal learning method and system based on block chain and trusted execution environment
CN113837761A
