In general, due to the complexity and limited computation capabilities, the security issues occur in Internet of Things (IoT). Security protocols are required to increase the security of the system. Therefore, in this article, an enhanced Elman spike neural network (EESNN) with green proof of work consensus algorithm (GPoW) is proposed for enhancing the security of IoT network. Initially, the generalized security mechanism as EESNN approach is proposed for the IoT network by categorizing the devices into malicious and benign. Then, the GPoW consensus algorithm is used for enhancing the security of the devices from malicious attacks. Subsequently, a coalition formation (CF) algorithm is used for reducing the excess energy consumption in a network. The proposed EESNN‐GPoW‐CF approach has effectively classified the malicious attacks and enhances the security of the IoT network. The simulation of this work is done in Python. From the simulation, the proposed EESNN‐GPoW‐CF approach attains high efficiency outcomes in terms of accuracy, recall, precision, PDR, PLR, throughput, overhead, computation time, and delay. Moreover, the proposed EESNN‐GPoW‐CF approach attains 3.1%, 5.3%, 7.4% high accuracy rate, and 7.5%, 12.5%, 14.7% lower computation time with 4.8%, 2.3%, 5.7% lower energy utilization than the existing methods, such as deep learning based blockchain for IoT security, deep reinforcement learning based blockchain for IoT security, and deep blockchain‐based trustworthy privacy preserving secured framework in IoT, respectively.