###### Abstract  
The Internet of Things (IoT) compromises multiple devices connected via a network to perform numerous activities. The large amounts of raw user data handled by IoT operations have driven researchers and developers to provide guards against any malicious threats. Blockchain is a technology that can give connected nodes means of security, transparency, and distribution. IoT devices could guarantee data centralization and availability with shared ledger technology. Federated learning (FL) is a new type of decentralized machine learning (DML) where clients collaborate to train a model and share it privately with an aggregator node. The integration of Blockchain and FL enabled researchers to apply numerous techniques to hide the shared training parameters and protect their privacy. This study explores the application of this integration in different IoT environments, collectively referred to as the Internet of X (IoX). In this paper, we present a state-of-the-art review of federated learning and Blockchain and how they have been used in collaboration in the IoT ecosystem. We also review the existing security and privacy challenges that face the integration of federated learning and Blockchain in the distributed IoT environment. Furthermore, we discuss existing solutions for security and privacy by categorizing them based on the nature of the privacy-preservation mechanism. We believe that our paper will serve as a key reference for researchers interested in improving solutions based on mixing Blockchain and federated learning in the IoT environment while preserving privacy. Blockchain; federated learning; Internet of Things; privacy +
Footnote †: journal:  
0000-0001-6000-0000-00001-6000-0000-0000-00000-00000-00000-00000-00000-00000-00000-00000-00000-00000-000000-000000-000000-0000000-0000000  
capabilities responsible for the first phase of processing the IoT raw data. Later on, cloud-computing layers are applied to provide the low-level IoT resource-constrained hardware devices additional computation and storage capabilities [5]. Figure 1 presents a high-level overview of the cloud IoT ecosystem [4]. However, more in-depth analysis layers can be included to process the raw IoT data. Data flow from the IoT devices to the centralized cloud layer for analysis, and the analysis results travel back to the IoT devices. This flow puts a heavy transmission cost on the network, and to address this issue, edge computing, or the fog layer, was introduced; it started as a content delivery network (CDN) component. CDN security issues have been discussed in [5], and the \"edge\" addresses transmission and storage issues. The distributed architecture of edge nodes and the need to analyze the large amounts of raw data have led to a research direction which aims to develop approaches that integrate machine learning (ML) into the IoT edge system [6]. Federated learning, which belongs to the family of decentralized machine learning (DML), is a collaborative learning model where nodes share and train a unified model with an aggregator node [7]. Federated learning addresses the need for computing the IoT data [8], but federated learning alone cannot guarantee the integrity and privacy of raw data traveling among clients and aggregated nodes. Blockchain is the technology of nodes that share a distributed ledger of transactional information, which is designed to ensure means of integrity and privacy [9]. The strong characteristics of Blockchain encouraged researchers to develop ways to integrate it with federated learning to preserve data integrity and privacy. **Research contributions of this work**  
We summarize the main contributions of this work as follows:  
1. We present a state-of-the-art review of federated learning and Blockchain and how they have been used in collaboration in the IoT ecosystem. 2. We review the existing security and privacy challenges that face the integration of federated learning and Blockchain in the distributed IoT environment.