# Federated Learning-Based Resource Management with Blockchain Trust Assurance in Smart IoT
## 3 Federated Learning-Based Resource Management with Blockchain Trust Assurance Mechanism
### Blockchain Security Assurance for Federated Learning in IoT  
Security attacks and security threats are issues that must be considered in the practical deployment of the IoT FL-based resource management framework [14]. FL-based resource management faces not only a large number of heterogeneous communication and computer resources, but is also likely to face hijacked IoT nodes. In the process of FL local models and global models parameters update, IoT devices will likely face poisoning attacks or information leakage attacks, etc. The combination of blockchain technology and federated learning can provide effective security assurance for FL-based resource management in IoT [20; 21; 22; 29].  
Figure 2 shows the proposed IoT resource management framework incorporating blockchain and federated learning technologies in this paper. IoT end devices, IoT gateways, and edge network servers (e.g., MECs) are the physical entities for IoT resource management. In these physical entities, not only are FL training models deployed, but also blockchain nodes and \"decentralized\" applications. The blockchain not only ensures that the nodes involved in FL model training are secure and trustworthy, but also ensures the security of exchanging model parameters in FL. FL nodes upload their own model parameters to the blockchain and obtain the updated model parameters of other FL nodes from the blockchain. By using the security mechanism of the blockchain, the privacy and non-repudiation of model parameters are also able to be guaranteed. Blockchain consensus algorithms such as proof of work (PoW) or proof of stake (PoS) can be used to ensure the consistency of the FL models transaction records [30]. The PoW algorithm is a consensus algorithm used on the Bitcoin network. PoS is an improvement on PoW.  
Figure 3 gives the data structure details of the blockchain in Figure 2. Each \"block\" contains a list of FL model parameters transactions. These transactions are linked together through a chain of \"blocks\" to form the complete transaction records during the FL model training process. In blockchain technology, transaction records are also known as transactions, which are evidence of a specific transaction action between nodes that occurred at a specific time. In the Bitcoin network, transactions record the transfer of Bitcoins. In the proposed IoT resource management framework, transactions record model parameter updates for FL local model and global model interactions. As shown in Figure 3, a block consists of a block header and a block body containing a series of transactions. The block header records the version and timestamp information of the block and the link to the previous block. The block body stores information about the FL model parameter updates. The global aggregation of the FL local models is also performed in the blockchain platform. Adding a new block to the blockchain requires confirmation by the consensus algorithm. A new node participating in the FL model training is added to the blockchain ledger only when it passes the verification of most blockchain nodes.