# A Survey on Blockchain-Based Federated Learning
## 3 Blockchain-Based Federated Learning
### Frameworks of BFL
Its main purpose is to reduce user costs during crowdsourcing and to ensure its security. In CrowdSFL, the entire crowdsourcing system is built on the blockchain, and every participant has an independent blockchain account. CrowdSFL introduces a data interaction mode controlled by smart contracts, ensuring that the data are uploaded in the correct format and stored in blocks. The aforementioned BFL frameworks all use a single type of blockchain to replace the central server used in traditional FL. In recent years, a few studies have proposed BFL frameworks that replace central servers with more complex multi-level blockchains. [PERSON] et al. [87] proposed a BFL framework based on a hybrid blockchain called the permissioned blockchain and the local Directed Acyclic Graph (PermiDAG). In this framework, the hybrid blockchain uses a permissioned blockchain running on the road side unit (RSU) as the main chain, while allowing vehicle nodes to form multiple local directed acyclic graphs (DAG). The permissioned blockchain serving as the main chain is responsible for recording information related to data sharing and parameters related to global model aggregation. Multiple local DAGs formed by vehicle nodes are used to enhance the efficiency of data sharing, as well as to store data-sharing events and trained model parameters as transactions in blocks. At the same time, based on the local DAG, neighboring vehicle nodes communicate with each other, obtaining local models of nearby vehicles, and use these models to enhance their own local models, realizing the asynchronous learning process. Additionally, the blockchain-empowered federated edge learning (BFEL) framework proposed in [88] also adopts a multi-level blockchain structure. This framework consists of an application layer and a blockchain layer, with the application layer mainly responsible for executing the FL process. The blockchain layer in this framework includes a main chain based on a public blockchain and multiple sub-chains based on consortium blockchains. By leveraging multiple sub-chains to set access permissions, this framework can enhance the data-privacy-preserving capabilities and achieve performance isolation. However, in some BFL frameworks, the blockchain neither directly replaces the central server nor directly participates in the traditional FL process. For example, in the BFL framework proposed in [89], the blockchain is only used to implement data sharing functions. The blockchain in this framework contains three different types of transactions: (1) retrieval transactions, allowing nodes to notify other nodes of the requested model information; (2) model transactions, allowing nodes to pass model training data to other nodes; and (3) data sharing transactions, allowing nodes to return the shared data to the requester. Specifically, a data requester sends a data sharing request to the blockchain. The blockchain conducts a retrieval transaction to check whether the cache already contains the corresponding data: if it exists, the blockchain returns the query result and the requested data model directly to the requester and generates a data sharing transaction; if not, the blockchain performs a multi-party information retrieval process, forms a model training committee, uses model transactions for model training, generates the model required by the requester, and caches the model for future needs while returning it to the requester. In the fine-grained FL framework proposed in [90], the execution of FL mainly takes place in cloud nodes and fog nodes. The blockchain in this framework does not directly participate in FL and is mainly responsible for calculating and storing the reputations of various nodes participating in FL. Moreover, in the BFL framework for equipment fault detection in the industrial IoT proposed in [91], the blockchain is mainly used for trustworthy storage and verification of client data. In this framework, clients regularly create Merkle trees to organize data collected from sensors and store the Merkle root in the blockchain.