# Blockchain-Based Secured Access Control in an IoT System
## 5 Proposed Solution  
The proposed solution is based on a multi-agent system and uses a private blockchain, which provides lightweight and decentralized access control security for an IoT system. The proposed architecture is shown in Figure 2 and relies on a hierarchical blockchain structure, consisting of a Local Blockchain Manager (LBCM), which includes IoT devices at the bottom of our proposed architecture, 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 represents cloud blockchain storage. Each BCM has a block header, MAC policy header and transactions. Our framework meets the requirements of the CIA (Confidentiality, Integrity and Availability) 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. Finally, our proposed architecture is generalizable and can be applied to various IoT applications.  
Figure 2: Proposed blockchain-based framework for secure Internet of Things (IoT) access control.  
Taking into account the limited resources of IoT devices and the high computational overheads for solving cryptographic puzzles such as Proof of Stake (PoS), it is not straightforward to adopt blockchain technology in IoT devices. Regarding the miners in our proposed solution, each Blockchain Manager (BCM) is equipped with an online, high-resource device, identified as a miner, which is responsible for controlling all communications within and outside of each Blockchain Manager (BCM). Moreover, the BCM has the responsibility of removing or adding IoT devices and possesses a policy header, which is a MAC policy that enables the BCM to control all of the transactions inside each BCM and between BCMs. Furthermore, each Blockchain Manager (BCM) has the following mobile agents: Signature Verification Agent, Authentication Agent, Authorization Agent, Encryption and Decryption Agent. However, the Local Blockchain Manager (LBCM) does not contain an Encryption and Decryption Agent due to the existence of resource-constrained IoT devices, as encryption and decryption algorithms are computationally expensive, which would be unsuitable for the limited resources of IoT devices.  
Regarding the applicable consensus mechanisms in our proposed solution, consensus mechanisms in public blockchains require costly mining methods, such as Proof of Work (PoW), which are not suitable for IoT networks for various reasons. For instance, public blockchains allow any nodes in the blockchain network to participate in the consensus process and transactions can be seen publicly, which is not desirable to many business blockchain solutions, as their sensitive data may be revealed and their privacy can be compromised. Moreover, public blockchains are vulnerable to the effects of a 51% attack. Hence, we use private (or permissioned) blockchains [28] to address the abovementioned challenges within IoT resource constraints and we use a lightweight consensus mechanism. In permissioned blockchains, the mining processes are managed via authenticated participants and are not open to the public. We will illustrate the main components of the proposed framework in the following sections.