In smart city infrastructure, IoT networks contain intelligent devices for collecting and processing data using open channel internet. Some challenges have occurred in the existing methods while transferring the data, like centralism, safety, secrecy (data destroying, inference attacks), transparency, scalability, verification, and controlling the rapid adaptation of smart cities. To overcome these challenges, a machine learning based block chain method is proposed in this manuscript. The machine learning strategies can process massive datasets. Furthermore, they contain adequate generalization to identify various attack vectors. Here, the block chain fostered cycle‐consistent generative adversarial network (CCGAN) framework espoused intrusion detection is proposed for protecting the IoT network. Also, a 3 level privacy model is introduced for protecting the IoT devices. The first level is block chain based privacy detection and the second level is CCGAN and the third level is classification. In first level, ToN‐IoT, BoT‐IoT datasets are taken to detect the IoT intrusion, these data's are given to the block chain to authenticate and to collect the data in the IoT devices in the smart cities and stored in the blocks present in the block chain. In second level, the feature mapping and feature selection are done. The normal and attacked instances are classified in level 3. The performance of the proposed method shows higher accuracy 25.37%, 29.57%, and 18.67%, higher recall 23.75%, 17.58%, and 14.68% better than the existing methods, like block chain and machine learning method based privacy protection in IoT using optimized gradient tree boosting system (IOT‐BC‐XGBoost), and block chain and machine learning method based privacy protection in IoT using deep gated recurrent neural network (IOT‐BC‐DGRNN), respectively.