How to Implement Blockchain in IoT?
Internet of things — is a term describing the system, where smart devices(things) interact as humans do by the means of the internet. In this article, we will show how to integrate the blockchain technology into an IoT network, and what difficulties might appear.
The idea of Internet of Things is that various smart devices, such as sensors, wearables, complicated mechanisms (actuators), collect data, connect to the internet and other devices through routers and gates via Bluetooth or Wi-Fi. They share and collect data and/or commands. Moreover, in the IoT networks devices with user interfaces can be applied, like personal computers, laptops, tablets, etc.
This technology is used for various purposes — starting at data transfer between meteorological and hydro-meteorological stations or launching the infrastructure for smart houses and towns. The issues, methods, and ways to apply IoT constantly appear. So do the requirements for their security and scaling. According to the Gartner forecast, these two things will be the main difficulties for IoT development in the next few years, and the very best solution is blockchain technology.
These are the major «gaps», that blockchain technology can fix:
The decentralized structure of the blockchain considers that there is no centralized control point and data storage, so there are no single attack points. Despite clouds, the blockchain network is managed by different independent points, so there is no organization to control a major amount of data generated by the devices of IoT.
Secure dives updating. The increased safety and secure measures of blockchains allows the developers to solve the outdated IoT software issues, since they can safely transfer the code on the IoT devices. This was successfully tested by the University of Tulsa workers, who used the open-source blockchain to update the ESP8266 firmware via Wi-Fi connection.
Enhanced privacy. The blockchain can even hide the connection between the devices, offering transaction validation without third-party implementation. Moreover, the blockchain can optimize the IoT protocols, and supply the encryption. This lowers the risks of data leaking and IoT network hacking.
Enhanced data management. IoT networks should transfer huge amounts of data in real-time through devices, systems and platforms, which raises new challenges for data management. The blockchain allows the devices to transfer data directly, without server’s, cloud’s, or local database’s help., This shortens the number of transactions at least for one third (device — other device — server / cloud / local network — device). Moreover, smart contracts can make most of the processes between IoT devices automatic.
Enhanced scaling. Decentralized blockchain networks share the workload, which provides an improved transaction processing and increases the coordination between billions of IoT devices that are connected to it. The ability to share the data also helps to scale.
Stricter authentication. To identify the users, many blockchain platforms use the decentralized PKI approach that generates hidden and open keys. This approach is different from centralized PKIs, its security measures are much more developed since only the user has the hidden key for their personality identification, while the network provider gets the open key. Since both keys are cryptographically generated, it is practically impossible to hack them.
Automatic connection. Blockchain technology helps to make the commands and messages in IoT automatic by the means of smart contracts. These computer algorithms are used within IoT devices for data analysis, IoT devices temperature measuring, and daily temperatures measuring. The other example is an automatic filling of custom documents or automatic duty checkout after passing the border.
Before developing an IoT architecture based on blockchain, you will need to consider the way it will interact. Here you will have 3 solutions.
IoT — IoT. This is actually the easiest way of blockchain integration into the IoT network, since it requires using only a sharing register for IoT data storage. The data transferring will take place out of the blockchain using various mechanisms of routing. This will help to achieve fast transaction speed and fewer delays. Furthermore, this approach offers the ability to offline work for the devices.
This is an easy solution to implement, since it is not considering major changes to the workflow of the IoT devices, all you need to do is to set up the transferring, storing, and extracting data from blockchain instead of a cloud or a server.
IoT — blockchain. For this approach, the IoT devices interaction will take place through the blockchain, which actually works as a cloud for traditional IoT networks. From one point of view, this will enhance the tracing, security of communication, workflow automatization, and it will increase the capacity. From the other point of view, it will make the system much more complicated, which will cause delays, if the blockchain is not fast enough.
The implementation of this blockchain in IoT networks is complicated, since it requires many changes in the work of IoT devices and blockchain development. Furthermore, a proper blockchain with increased working speed, capacity and zero fees should be used. This can be an IOTA, Modum.io, or Riddle & Code-based blockchain.
Hybrid approach. In this case, a major part of data and interactions are shared between the IoT devices, while the blockchain stores only some types of data. This brings a lot of advantages, but the low delays and high working speed for IoT devices in real-time are hardly possible.
Moreover, this approach helps to introduce fog computing to compensate for the limits of blockchains and IoT devices. For example, you can use this computing method to extract, store, and use the analysis of private data by the means of peripheral devices instead of cloud computing which will help to save operating expenses.
Difficult choice of a consensus protocol. To choose the best blockchain option for the IoT you will need to take into account that many mechanisms can not be used in the modern IoT environment due to high requirements to the computing power, scaling difficulties, high fees etc.
For instance, if you choose the Bitcoin or Ethereum Blockchain, then each transaction between the devices will cost 2-20 dollars. Since the IoT deals with thousands or even millions of transactions every day, a vast amount of money is necessary, which is a huge drawback. Furthermore, the blockchains are very picky in terms of validators, which is not appropriate for IoT, since IoT devices are tiny sensors with little computing power and limited functionality.
To match the blockchain consensus algorithm and the IoT environment, it should fit the following criteria:
Limited resources of the Internet of Things infrastructure. The next problem is in the limited computing abilities and little memory available of the IoT devices. The blockchain technology requires a lot of memory to store the record and power to mine.
As for now, no one has found a solution for this issue, but it seems that IBM is really close. They have invented the concept of versatile and regional blockchains. The idea is that the network nodes are divided on:
One of the possible solutions to increase the encrypting security in IoT is providing the entropy encryption, based on quantum random number generation. This approach uses quantum physics-based data that is different from classical physics, because it is random.
You can apply the mechanism of quantum random number generation to improve IoT network encryption. EaaS providers offer high-quality sources of entropy on the physical processes of quantum devices ground. These devices guarantee real randomness, which can be used by the developers to make their IoT applications, systems, and devices safer and secure from cyberattacks.
Scaling difficulties. The problem is that IoT networks continue their rapid growth, which means that more smart devices, more transactions, and more data should be processed. The connection between the IoT elements normally requires immediate data transferring. All this causes difficulties with scaling, especially for blockchains with poor working speed.
The perfect architecture of a blockchain for the Internet of Things should process thousands of transactions per second and provide security for simple network nodes. This can be achieved in a few ways.
The risk of overloading smart contracts with IoT devices. We have discussed the advantages that the Internet of Things gets for smart contracts integration. But, it still brings some difficulties.
These issues do not have proper solutions for simple and fast blockchain integration. It can be done by the means of custom development, which should be only done by a reliable technical partner, with proper developing experience, such as — Merehead.