Blockchain and IoT in smart homes (Part 22)

Techskill Brew
Blockchain 101 by Techskill Brew
10 min readApr 20, 2022

Welcome to the 22nd part of the 100 part series on Blockchain.

Previous parts: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 and 21.

A smart home may be defined as a “residence equipped with the Internet of Things or IoT devices that send and receive data in real-time to anticipate and respond to the needs of the residents, promoting their comfort, convenience, security, and entertainment within the home and connecting them to the world.

The IoT technology provides automation to various home devices, making them smart, such as smart TVs, smart lights, smart refrigerators, smart locks, smart coffee makers, and so on. For instance, a smart coffee maker can prepare the perfect coffee for you as soon as you wake up, a smart microwave can differentiate between a perfectly cooked pizza from a burnt pizza, and a smart air conditioner can send a maintenance service request on its own in case it breaks down.

Smart home with various IoT devices connected to the internet

IoT smart home challenges

Home is a private space where individuals perform different activities while carrying out their daily routines. They need to feel secure and enjoy emotional and physical comfort when they are inside their house. But by connecting home devices to the internet, security issues arise.

(i) Security and privacy challenges: The data collected from the sensors embedded into IoT devices is sent to the cloud via IoT gateways. The devices are connected to the IoT gateway through low-power wireless networks like ZigBee, Bluetooth, Z-wave, LoRaWAN, etc. IoT gateway collects data from the sensors, pre-processes it locally, and sends it to the cloud via the internet. Additionally, various IoT devices communicate with each other through the gateway. The gateway thus becomes the main target for the hackers to steal sensitive data of the residents or to take remote control of an IoT device. For instance, a hacker could take control of a smart door lock to break into the house. Even the hackers could also hack smart home devices to send malicious emails and spam messages, making them the main target to cause cyberattacks.

(ii) Restricted access challenges: In super-connected smart homes, there will be many situations where you will want to give limited access instead of complete access of your home to the other party. For example, when you hire a pet sitter for paying a half an hour visit to feed and look after your dog. In such a situation, you would want him to access your lobby only and not the entire house.

In today’s IoT-enabled smart homes, this pinpoint access is not feasible. We can give complete access of our home to the sitter through our mobile app, but we can’t choose what devices or services he can access and what devices and services should be kept off-limits for him.

Proposed Blockchain architecture for smart homes

Because of the decentralized and peer-to-peer network, Blockchain technology overcomes the challenges IoT devices face and enables them to operate in a decentralized manner without relying on a trusted or centralized intermediary.

The architecture will contain four layers: the smart home layer, Blockchain network, IPFS, and application layer.

Proposed Blockchain architecture for smart homes

(i) Smart home layer: Smart home layer consists of many IoT devices like a security system, smart lights, smart refrigerators, smart thermostats, and so on. These devices have sensors that collect real-time data and transmit it to the gateway.

(ii) Blockchain layer: Blockchain can be applied to the smart home gateways for transmitting data with integrity and confidentiality between devices and other media. All of the smart devices of a home are connected to one gateway. Each IoT device and gateway needs to be registered on the Blockchain network and is given a fixed unique ID. Similarly, each user on the network is assigned a unique User ID.

D1, D2, D3, D4 are unique device IDs, and U1, U2, U3 are unique user IDs assigned on the IoT network.

The IoT data captured is timestamped and then inserted into blocks that are cryptographically protected by a hash. With Blockchain, all data exchanged by the individual devices on the network is recorded as transactions on the shared ledger.

Data exchanged by smart devices are recorded on Blockchain.

For better clarity, let us understand it through a real-life scenario, Jaime got a new thermostat for his smart home. When the device is added on to the network — the device is given a unique ID, say TH1. His cousin Robert visits his home for the weekend, but Jaime has to leave for a colleague’s party. He gives access of the thermostat to his cousin so that he can feel comfortable in his absence. As soon as Robert is granted access to the thermostat, a unique user ID, say C1, will be generated for him. All his interactions with the thermostat will be recorded on the ledger as immutable transactions.

Access of thermostat given to Jane on Blockchain

A home server computer may be considered a validating node responsible for verifying and adding transactions to new blocks, while smart contracts on the Blockchain follow predefined rules and facilitate decentralized transactions.

Generally, a permissioned private Blockchain is used in a smart home network to maintain privacy and reduce overhead costs.

The communication between devices and gateway is done through pre-shared keys.

· When a device intends to communicate with the gateway, the gateway requests its ID.

· The gateway encrypts the gateway information and sends it to the device. Devices with the pre-shared keys decrypt the encrypted messages.

· The registered devices also send encrypted data to the gateway, which then decodes the transmitted data to verify that they received data from the authorized registered devices.

· The gateway stores the decoded data, pre-processes it and sends it to the IPFS.

· Only those smart devices can communicate with each other that the owner has granted permission by giving them a shared key.

(iii) IPFS: The third layer, the IPFS, is a peer-to-peer network that stores the data processed by each gateway in the Blockchain. IPFS stores the entire digitized IoT data with high integrity, and only the hash address of the data is stored on the Blockchain.

(iv) Application layer: The fourth layer, the application layer, is created to facilitate communication of various smart home devices with other existing Blockchain platforms such as data marketplace, access management, homecare or healthcare, automated utility payment, smart city services, etc.

Smart home data marketplace: Data marketplace is an online platform where entities can trade data. In a conventional data marketplace, data providers and potential consumers contact each other directly or via a third party. In such cases, trust is the main issue that hinders the transparency of the trade. There are certain real-life cases in which malicious actors have fraudulently tampered with the customer data to illegally increase their benefits. But through the Blockchain, a decentralized and secure data marketplace can be created, which has two advantages: The first is continuous data availability for IoT device manufacturers. And the second is the availability of a diverse set of data for the AI and ML startups. This data is then processed by these companies using their specialized algorithms to produce useful insights. For instance, data from smart coffee makers can be used to get insights into people’s choice of the coffee brand and preferences for the strength of the coffee in a specific region.

Smart home access management: To maintain privacy and enhance the smooth operation of a smart home, it is required to integrate a customized access control system that permits third parties on demand. The access to third parties can either be “Approved” or “Rejected” by the user using a smart contract. The user can even define a time limit for the access, after which the access status will be changed.

Access granted to third-party through a smart contract

Let us take a scenario to understand it in a better way: Jaime has a lovely dog named Miller. He knows that he will be late from work today. Therefore he hires Smith, a pet sitter, for Miller’s evening walk. Jaime gives a digital key of his house to Smith, and that too only for today, so as to avoid any unwanted accident. This time-bound access can only be given with the implementation of Blockchain, which is not possible otherwise.

Time-bound access of home on Blockchain

For this,

· The visitor Smith is required to initiate a request to access Jaime’s house.

· Upon receiving the visitor’s request, the Blockchain verifies the access control list.

· The request received from the visitor is then forwarded to the owner Jaime who could authorize or reject any access request.

· Once the owner grants the access, the visitor is permitted to get access of the area and perform actions according to the conditions pre-defined in smart contracts.

Advantages of Blockchain in smart homes

Blockchain can overcome certain challenges faced by smart homes. These challenges can be classified under these major four heads:

1. Network Security

2. Identity Management

3. Privacy

4. Resilience

These security issues are a big pain point for the IoT devices, but with the implementation of Blockchain, these issues can be mitigated, and the IoT networks can be made more secure, reliable, and robust.

Network Security — The first critical issue that Blockchain mitigates is network security. The software of any IoT device is the most crucial component that supports its functioning. Once a specific device is installed in the IoT network, its software needs to be updated with time to address the identified issues or to further add new functionalities. For a better understanding, you can compare this with the updates that your mobile apps get to fix the latest identified issues or add new functionalities.

These upgrades in the IoT devices are not secure and prone to hacking, resulting in a compromised network. Any hacker can use this lacuna in security to introduce a harmful update instead of the proposed update by the manufacturer, thus leading to a serious security breach.

But with the implementation of the Blockchain, the whole network can be made secure and robust. It is much easier to validate the authenticity of the software update once Blockchain is introduced into the network.

Blockchain can further ensure that all the devices on the network are updated and are using the latest software version released by the manufacturer.

Identity Management — The second critical issue that Blockchain mitigates is Identity Management. Every device on the IoT network is authenticated to satisfy its identity management requirement.

During the authentication process, only trusted devices are added to the network, and unsecured or unauthorized devices are rejected. However, current IoT systems don’t have a foolproof mechanism to enforce these measures. But with the implementation of smart contracts, this can be made foolproof and much more robust.

Privacy — The third critical issue that Blockchain mitigates is Privacy. IoT devices in the smart home network generally capture sensitive and very personal data of the users. Therefore permission handling process is a must-have requirement in the network. In such a scenario, whenever a third-party entity tries to exchange data with any of the devices in the smart home network, the user is required to authorize this exchange. This exchange can either be Approved or Rejected by the user using a smart contract. The user can even define a time limit for the data exchange, after which the data exchange status will be changed.

Resilience — The fourth critical issue that Blockchain mitigates is Resilience. Resilience in the system is built by detecting and mitigating unauthorized access and intrusion. For this purpose, a private Blockchain network can be used where network access to any unauthorized user will be prohibited. Thus, keeping the network robust and resilient.

Challenges in implementing Blockchain

Undoubtedly, Blockchain technology has the potential to open new opportunities for state-of-the-art smart home applications. However, several issues need to be investigated before mainstream adoption of the Blockchain in the smart home IoT ecosystem.

(i) Delayed response: The IoT devices continuously stream data, but the employment of Blockchain may cause delayed response because of lengthy processing periods for transaction validation. For instance, the block time of Bitcoin Blockchain is 10 minutes, which leads to a maximum throughput of 7 transactions per second. As a result, the traditional Blockchain technology is unsuitable for time-sensitive smart home IoT applications, where a minimum delay results in severe consequences.

(ii) Scalability: As the number of IoT devices increases, the processing of high volumes of data will become extremely complicated and lengthy on the Blockchain because of restricted transactional throughput (transactions/second), efficiency, and high computational cost. Thus, reducing the overall performance of the Blockchain.

These issues can be overcome by implementing certain Blockchain scalability layer 1 and layer 2 solutions before integrating Blockchain with IoT. These solutions will increase the transactional throughput and decrease the block time. Thus, reducing the delayed response to make it near real-time system while maintaining its security and tamper-proof properties for a sustainable smart home Blockchain ecosystem.

If you liked this article and want to know more about Blockchain, NFTs, Metaverse, and their applications, click the below link.

Happy learning!

Other related articles

Thanks for reading!

--

--