Blockchain is a database that contains the history of all exchanges made between its users since its creation. Blockchain is a new tool that enables essential distributed applications without the need for centralized trust. It is a transparent and secure technology for storing and transmitting information that operates without a central control body. Moreover, the large-scale presence of wireless sensors, especially in the IoT, produce a large volume of data. This data must be protected to guarantee its correctness.However, due to the difficulty of encrypting this data, there are many problems, including limited resources, whether in terms of computation, memory, or energy, as well as the complexity of encryption algorithms. Therefore, we wanted, through this article, to show the importance of adopting the blockchain in wireless sensors. This enables it to send data as quickly and securely as possible, as little of the literature has dealt with this topic. For this, one imaginable solution must be managed in WSN which is to put the necessary keys for networks or groups at the level of each sensor for the different scenarios implemented, mobile node and orphan nodes, so that the latter can authenticate and link to these multiple networks or clusters, using our blockchain security IoT (BSI) protocol. The latter makes it possible to design a decentralized, transparent, and scalable authentication system, which does not negatively impact the performance of sensors or that of networks. This system must provide complete freedom to change the state of the sensor from one network to another, while ensuring the safety of the latter. This means that if a sensor is authenticated in a legitimate network, it becomes reliable and accepted by all other networks. This allows you to have a global vision on all networks. We evaluate the performance of our protocol with simulations using MATLAB.The results confirm that the BSI protocol is robust and efficient, provides lower power consumption and fast computing time.