## 1 Introduction  
The \"Internet of Things\" is the rising field in the technological era. IoT is currently used in various applications such as healthcare, food packaging, structural monitoring, groundwater remediation, accident avoidance, wildlife monitoring, home automation system, and emergency response in industries. The Internet of Things is a collection of many little objects and low-cost battery-powered sensor nodes commonly used to monitor the distributed environment. The failure of any sensor node can badly affect the performance of the whole IoT network. As everyone knows, the IoT (Internet of Things) works with less human interaction, and there is no limit for location and environment; this raises some security, energy, and recovery issues. Blockchain technology will be used for the security problem in the proposed system, where systems ensure the network's security. Confidentiality in wireless sensor networks is made with hundreds and thousands of small appliances that are fit for detecting and preparing and have some correspondence capacities. The security components offered in regular organizations are, for all intents and purposes, not appropriate to be executed in WSNs due to their asset-compelled nature. These organizations cannot deal with higher overhead bits. For increased security, we use blockchain technology, and some protocols are used for this. The most popular protocol is the LEACH, a homogenous protocol used for the same type of transaction. The motivation of this work is to secure the WSNs, and there are some challenges related to the security of WSNs. As it is known that WSNs are open-access networks, anyone can operate them. Most of the protocols used in WSNs are insufficient for the security method. It is challenging to employ strong protection on sensors due to their complexity. Blockchain innovation has arrived at a point of dissatisfaction, particularly concerning sharing economy stages. Some essential security goals are \"confidentiality, integrity, and availability,\" as everyone knows all the communication devices connected through the Internet. IoT security plays an important role; there are three layers of IoT security. The first layer is the physical, network, and application layer attack. The privacy and security issues still need to be addressed. As the \"IoT\" devices are resource limitation devices, current security protocols or mechanisms are not appropriate. Inconsequential algorithms (cryptographic algorithms) or communications protocols are much needed for \"IoT\" devices [1]. There is one problem that exists in the Blockchain, which is the Byzantine Generals Problem. There are many algorithms used to solve this problem, such as Proof-of-Work, Proof-of-stake, Delegated-Proof-of-Stake, Proof-of-Authority, Proof-of-Capacity/Space, Proof-of-weight, Proof-of-Importance, Proof-of-Burn, Proof-of-Activity, Practical-Byzantine-Fault-Tolerance, Federated-Byzantine-Agreement, Delegated-Byzantine-Fault-Tolerance, and Directed-Acyclic-Graphs. As mentioned above, all algorithms have some properties and pros and cons according to their capability. Every algorithm is used for a different issue because all have other qualities. Nowadays, the Internet of Things (IoT) is the most advanced strategy, which is an arrangement of interrelated smart devices, items or objects, power-driven and electronic machines, beings, or individuals that will be used to give unique identities such as IP addresses and the energy or capacity to exchange data or important information through a network without relying on human-to-human or human-to-PC collaboration. With the advancement of information technology, gadgets or smart devices such as tablets, laptops, phones, and others which communicate wirelessly have become essential needs in everyone's life. Many of the applications are developed by using IoT technologies for monitoring in real-time.