Abstract
Wireless sensor networks (WSNs) will be necessary for the next generation of Internet of Things (IoT) apps. They make it possible to use smart and long-lasting sensors and smart automation in healthcare, Industry 4.0, and critical infrastructure. But security is particularly hard since they have built-in flaws, not enough computer power, not enough energy, and a significant danger of insider threats. Standard encryption methods aren't enough, and in situations where resources are restricted, heavier blockchain or machine learning solutions aren't always possible. This study presents ChainShieldML, a lightweight hybrid security architecture that combines Blockchain (BC) and machine learning (ML) to provide decentralised, adaptive, and resource-efficient protection for wireless sensor networks (WSNs). The idea is based on a two-pronged defence strategy. The Blockchain Prevention Module's permissionless blockchain architecture for base stations and cluster heads makes it possible to verify identities, maintain trust in a decentralised way, and keep node interactions unchangeable. Smart contracts made in solidity and connected to the Ethereum ecosystem make it possible to safely register nodes and keep an eye on what they do. The VBFT consensus algorithm makes it possible to quickly validate without using as much computing power as most proof of work methods. The machine learning detection module uses the lightweight gradient boosting method (LightGBM) to find and rank dangerous nodes in real time. LightGBM is the best machine learning classifier when looking at things like recall, F1-score, Matthews correlation coefficient, training cost, and inference latency. ChainShieldML dramatically improves the detection of insider attacks, builds trust, and protects data while using very little energy and having very little communication delay, as shown in tests. For Wireless sensor networks (WSNs) to keep working, all of these things are very important. ChainShieldML is a novel solution to keep IoT devices safe. It uses blockchain's decentralised trust and ML's adaptive intelligence to make a defence system for next-generation wireless sensor networks that can grow, is strong, and is ready for the future.