# Machine Learning for Blockchain and IoT Systems in Smart Cities: A Survey
## 3 Blockchain for Security and Data Integrity in Smart Cities  
In the intricate landscape of smart cities, where millions of interconnected IoT devices continuously generate and exchange data, ensuring the security and integrity of these data is paramount. Blockchain technology emerges as a critical solution, providing a decentralized and immutable framework that addresses these pressing concerns [42]. The decentralized nature of blockchain aligns seamlessly with the distributed architecture of IoT systems, creating a robust foundation for secure data management. Each transaction or data exchange in a blockchain network is recorded in a cryptographically secured block, which is then linked to the previous block, forming a chain. This immutable ledger ensures that once data are recorded they cannot be altered or tampered with, providing an unprecedented level of data integrity. This characteristic is particularly vital in smart cities, where the reliability of data directly impacts the efficacy of urban management systems, from traffic control to energy distribution [43; 44; 45; 46]. Blockchain also enhances security through its consensus mechanisms, which require network participants to agree on the validity of transactions before they are added to the blockchain. This consensus process significantly reduces the risk of data manipulation, as altering the blockchain would require the collusion of a majority of participants, which is computationally infeasible in well-designed networks. This property is crucial in protecting against various cyber threats that target centralized databases, such as Distributed Denial of Service (DDoS) attacks, data breaches, and unauthorized data modifications [47; 48; 49; 50; 51]. While blockchain technology excels in ensuring data integrity and transparency through its decentralized ledger system, it faces significant challenges, particularly in terms of scalability and privacy. FL offers an alternative decentralized approach that fo \begin{table}
\begin{tabular}{p{142.3 pt} p{142.3 pt} p{142.3 pt}} \hline \hline
**Approach** & **References** & **Summary** \\ \hline AI \& ML & [7; 8; 9; 10] & Application of AI and ML for smart governance, traffic control, healthcare, crime forecasting, and more in smart cities. \\ \hline CNN-based & [11; 12; 13; 14] & Use of CNNs for pedestrian detection, traffic signal optimization, crime prediction, and malware detection. \\ \hline RNN-based & [15; 16; 17; 18] & Application of RNNs for time-series prediction, environmental noise prediction, and small-object detection in industrial settings. \\ \hline FL & [19; 20; 21; 22] & Privacy-preserving data analysis and decentralized data processing in smart cities using FL techniques. \\ \hline RL-based & [23; 24; 25; 26; 27] & Use of RL for optimizing traffic signal control, autonomous vehicles, smart energy grids, and other IoT systems in smart cities. \\ \hline Deep \& Unsupervised Learning & [28; 29; 30; 31; 32] & Application of deep and unsupervised learning techniques for anomaly detection in IoT systems within smart cities. \\ \hline Transfer Learning & [33; 34; 35; 36; 37] & Research on the application of transfer learning for IoT, smart buildings, IoT attack detection, and secure data fusion in industrial IoT. \\ \hline IoT and Smart Cities—Overview & [38; 39; 40; 41] & Overview of technologies, practices, and challenges related to IoT in smart cities, including a broad analysis of IoT ecosystems and their development in urban settings. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Use of AI, ML, and DL approaches in IoT for smart cities. cuses on maintaining data privacy by keeping data localized on edge devices. Unlike blockchain, which requires data to be recorded on a public ledger, FL trains machine learning models directly on the devices without transferring the raw data, thereby inherently preserving privacy through techniques such as differential privacy [52; 53; 54; 55].