**3.5 Automated decentralized IoT-based blockchain using ethereum smart contract for healthcare**

In Ethereum, smart contracts are used to automate participant interactions and the execution of data from Things or any other type of data. Nodes use it to test, debug, verify, and test transactions. Consensus algorithms are at the heart of the blockchain, ensuring its security and integrity [8].

The proposed blockchain of Things architecture in the work [8] consists of five layers and is based on Ethereum smart contract including Things, gateway, Fog, Cloud, and Application layer (see **Figure 7**), demonstrated as follows:

**Figure 7.** *Proposed IoT-based blockchain architecture for healthcare network [8].* *A Simulation Model of a Blockchain-Based Decentralized Patient Information Exchange… DOI: http://dx.doi.org/10.5772/intechopen.109591*

Things layer: it consists of a virtual sensor programmed in python version 3.7 programming language [8].

Gateway layer: To transfer data to higher layers, such as the cloud and fog layers, the virtual sensor is connected to an Access Point (AP) as a gateway device with WiFi connectivity (IEEE802.11n Tenda AP) [8].

Fog layer: It stores IoT data on a private blockchain by collecting it from the Things layer's virtual sensor. This layer is a 24-hour power-on with enough storage space to store a local copy of the entire blockchain [8].

Cloud layer: This layer is built on top of a public testnet blockchain that was made for testing and mining. It uses Ether, which has no value, which can be bought from faucets that look like the mainnet network [8].

Application layer: Things' data can be monitored by doctors, patients, and their families. However, because blockchain data are immutable and unchangeable, they are unable to alter or delete them. Additionally, physicians can quickly respond to an emergency by monitoring data in real time even if it is not processed in blockchain [8].
