# A Trusted Federated Incentive Mechanism Based on Blockchain for 6G Network Data Security
## 3 Isfl-Sys Architecture
### A Blockchain-Based Smart Contract Incentive Mechanism
#### 3.2.1 Design of Smart Contracts  
Unlike synchronous federated learning, where the parameter server can collect local models uploaded by each node in each iteration and distribute rewards based on global aggregation, asynchronous federated learning does not allow for global model aggregation or reward distribution. However, the incentive mechanism can achieve both model aggregation and reward distribution through smart contracts. In the ETFL architecture, a training task can be initiated by a specific node. Upon receiving the task initiation request, this node can bundle relevant information such as the initial model, reward distribution approach, task termination conditions, etc., into a smart contract. This smart contract will control the task process, including model submission for aggregation and reward distribution. Here, we primarily focus on reward distribution: During the training process, the smart contract constructs a directed acyclic graph ledger to collect transaction information published by nodes in the system. When the system's iterations reach a certain point (e.g., after a specific time from the start of training), the smart contract will select transactions based on the local directed acyclic graph and distribute rewards accordingly. Once this reward distribution is completed, the currently selected transactions are cleared, and the process begins anew. The process of rewarding nodes can be determined based on the authentication status of transactions. In the case where transaction \(t\) is selected for reward distribution in this round and is allocated a reward of \(R\), for this transaction, apart from the node that initiated the transaction contributing significantly to this particular transaction, nodes that authenticated the transaction will also have contributed to it. Consequently, the reward for this transaction will be divided into two parts: a reward for the transaction-initiating  
Figure 3: Node-local directed acyclic graph ledger and transaction structure.  
node and a reward for the authenticating nodes. These rewards are respectively assigned to the node that initiated the transaction and the nodes that authenticated it. This type of incentive mechanism not only encourages active participation of nodes in the federated learning training but also enables nodes to assist the system's training process through authenticated transactions and earn rewards accordingly. This mechanism ensures that nodes with relatively limited computational power can also acquire substantial rewards from the system, enhancing their motivation to participate in learning and preventing training outcomes from being monopolized by nodes with higher computational power and larger datasets. The specific design of the smart contract process is as follows:  
1. The node receiving the training task writes a smart contract within the system and broadcasts it to the network;
2. The smart contract periodically collects transactions within the system based on relevant configurations and selects a set of transactions with higher accuracy for this round of selection;
3. The models from the selected transactions are aggregated using federated aggregation algorithms, and the contribution of each node is assessed based on the transaction source and transaction validation;
4. Rewards are allocated to each node based on their contribution levels in accordance with their participation;
5. Upon achieving the preset expectations, the training is completed, and the smart contract concludes;