# Blockchain-Based Secured Access Control in an IoT System
## 5 Proposed Solution
### Results and Discussion  
The result of this paper is that current security solutions are not fully suited to IoT due to the distributed nature of IoT networks and the limited resources of IoT devices. Traditional access control methods are costly in terms of their high power consumption and processing overheads. Furthermore, public blockchains are not suitable for resource-constrained IoT devices as they demand high computational power for mining processes. Therefore, there is a need to design distributed and lightweight secure access control for an IoT network. The paper's contribution is the proposal of a novel architecture based on a multi-agent system, which uses a private distributed blockchain, providing a lightweight architecture and decentralized access control security for the IoT system. The framework relies on a hierarchical blockchain structure and consists of a Local Blockchain Manager (LBCM), which includes IoT devices, a Fog Blockchain Manager (FBCM), which includes fog/edge nodes, a Core Fog Blockchain Manager (CFBCM), which includes core fog nodes and a Cloud Blockchain Manager (CBCM), which is a cloud computing node. Our framework meets the requirements of the CIA security triad and is well-suited to the specific requirements of IoT in terms of its scalability, distributed nature, constrained devices and defense against various security issues, such as single points of failure. The limitations will appear clearly after the implementation and testing of the proposed architecture. However, it may be deduced that they will involve performance and convenience issues. Finally,  
Figure 5: Sequence diagram for Authentication and Authorization Agents. the objectives of the proposed solution are achieved in the framework by enhancing the security of the access control mechanisms among IoT devices, as well as enabling secure communication between IoT devices, fog nodes and cloud computing. The Internet of Things has many uses. Such uses are still increasing and a promising future for the Internet of Things is expected. With this increase, however, there have been cases and incidents that have revealed the weaknesses of the Internet of Things and the extent of its threat to users' rights and freedoms [31]. It is imperative to develop technologies and solutions that reduce these effects and allow users to benefit from the advantages of the IoT. One of the most widespread examples of the Internet of Things is smart home devices, which may be the next arena for attacking and influencing individuals [32]. An attacker could take control of the victim's home and enter it by remotely opening the front door or opening windows and damaging the home devices. Cameras can be hacked, access to sensitive data and household appliances can be controlled and destroyed or fires can threaten residents. This type of attack poses a new threat to smart home device users. The risks in smart homes fall into five classes: technical vulnerabilities, user data risk, a lack of encryption, privacy issues and increased complexity of the system [33]. On October of 2016, in one of the worst breaches, Mirai botnet attacked IoT, which affected the control of the world's Domain Name Server (DNS) infrastructure. As a result, many IoT devices, such as DVR players and digital cameras as well as many websites including Netflix and CNN, were affected and turned off. The attacker used default authentication data to log in to victims' IoT devices. The estimated number of targeted devices was approximately 100,000 [34]. In our proposed solution, we provide different levels of blockchain managers that manage the IoT's entire system. In the case of smart homes, the Local BlockChain Manager (LBCM) works as a miner. It is installed in the home hubs or on a personal computer and is directly connected to and manages the IoT devices located in a smart home, such as smart TVs, lights and refrigerator devices. Each smart home has various IoT devices managed via LBCM.