Why IoT and Blockchain are a perfect match
The Internet of Things (a.k.a. IoT) and the blockchain need each other (and they will get married soon). Before describing why the two powerful buzzword fit each other so nicely, let’s kick off by clarifying some common misconceptions.
Is IoT powerful enough for blockchain?
The “things” in the IoT are by definition not ordinary computers and indeed they are usually much less powerful devices than our laptops, both with respect to processing power and memory capabilities. Given the latter, how could such devices store the 100+ Gb history of Bitcoin? They cannot, right? The solution wouldn’t be just to switch to the more recent blockchains, since the problem would arise anyway at some point, when enough blocks have been added to the chain. One may argue, well, actually it’s not really needed to store the entire history on my laptop to run a software wallet either. More precisely, IoT devices are not required to be full nodes. The common workaround are the so called lightweight nodes (by the way, for a good Bitcoin software wallet I suggest Electrum).
What about the processing power? We are still talking about a full blown computer program and many IoT devices have very constrained processors. In fact it turns out that to give a blockchain identity to an IoT device very few cryptographic functions are necessary, and a very simple wallet, just able to create addresses and sign transactions, can be easily supported by a low power micro processor unit (MCU). A nice example is this, in which an IoT device runs a simple Ethereum wallet. Basically all the heavy lifting is outsourced to remote full nodes, while the cryptographic keys are stored securely inside the device.
Can blockchain handle huge amount of IoT data?
Smart sensors continuously capture data from the surrounding environment and send this information over the Internet. This kind of IoT is the most popular and supported by the big tech giants. It is usually paired with cloud services which perform analytics on the obtained data and remote storage. The misconception regarding the blockchain is that the devices will store the data on-chain, in order to leverage blockchain’s immutability. That would indeed not be possible, or at least very very expensive. The typical procedure is actually storing a hash of the data on the blockchain. This hash can be considered as an address (in the usual city street meaning, not a blockchain address!) for the content, which itself can be stored in a decentralized fashion on protocols like IPFS.
Are blockchain fees too expensive for IoT?
Well, this is indeed true if we consider Bitcoin, Ethereum and the majority of other cryptocurrencies. But first of all, there aren’t fundamental reasons to believe that this situation will remain the same forever for these currencies. Secondly there are already compelling alternatives. One possibility is to use currencies with very low fees, for instance Stellar. A more promising one is to use blockchains, or better Distributed Ledger Technologies (DLT), purposely built for the IoT, such as IOTA, in which the fees are basically zero. Again, there are blockchains that simply don’t use currencies at all, such as Hyperledger blockchains. Finally is worth mentioning that the scalability solution for the big players, Bitcoin and Ethereum, can be around the corner. I’m thinking at the second layer scaling solutions also known as Lighting Networks, which promises to bring zero fees transactions and very low latency.
Let’s now focus on what is good about IoT and Blockchain.
Blockchain needs secure IoT
Some promising blockchain use cases are in areas such as logistics, supply chain and manufacturing. Why is it so? The main benefit of the blockchain is removing the need for trust between different actors, which should just trust the underlying mathematical soundness of the decentralized data structure. But logistics and the other areas are full of actors, middle men and leaps of faith, therefore the first statement follows. Q.E.D.
Ok, let’s say that I want to use the blockchain to store the number of pallets loaded into a container to be shipped to India. The loader from Australia will count the number of boxes and insert the number on the blockchain. Pretty handy, now there is an immutable and long lasting proof of the shipment, right? Not at all! In this way we are trusting the Australian loader and doing this we are defying the purpose of the whole trustless environment. The data insertion on the blockchain must be automatized and tamper-proof, that is IoT device must be able to securely connect to the blockchain and impartially report the current situation. A solution (likely not optimal) for this particular scenario is having IoT sensors in every pallet and another sensor inside the container to confirm the loading of the packages. If you are thinking that having too many IoT sensors is unpractical, think about what will happen in the future when IoT devices will so power-efficient that a tiny solar panel could charge them indefinitely (and we are making progress fast).
Blockchain could decentralize the IoT
What I mean by centralized IoT? I have in mind the big tech giants offering their cloud services, which connect to billions of IoT devices to offer remote storage and computational power. This is indeed the current scenario and it brings multiple shortcomings. First of all, it exposes the IoT infrastructure to a single point of failure. This point can be exploited by malicious third parties trying to hack the server or perhaps by the giant itself, leveraging its power to monitor, filter and discriminate the IoT data traffic. Secondly, it’s not scalable to a future in which IoT devices are everywhere. Just think about suffering connection lags in your IoT pacemaker (which could remotely call an ambulance in case of emergency, so not just a gadget) since the central server cannot handle all the connection request by the smart homes in your area, which maybe are particularly active due to the celebration of a national holiday or a sport event. The blockchain could decentralize the whole IoT, by allowing a secure peer-to-peer network of sensors. The explanation connects to the next paragraph: basically right now central servers are in charge of authentication and security checks on the devices, while the blockchain has the potential to do the same job in a distributed fashion. In conclusion, let me signal the interesting possibility of outsourcing computational power and storage using decentralized services such as Golem and Filecoin. In order to do this, IoT devices will need to have a blockchain addresses to send and receive tokens (somebody is working on it).
Blockchain and IoT security
Last, but not least, the security issue. The list of IoT exploits is longer than Tuco’s crimes list: masquerading attacks, man-in-the-middle, replay attack, Denial-of-Service, clone-ID and Sybil attack and so on (a nice reading on the topic is this book). These IoT manufacturers are so dumb! No, that’s not the point. The issue is with the constrained capabilities of the devices. The trade-offs with cost and low energy consumptions imply that the most secure, but heavy, cryptographic algorithm cannot be ran on such devices. So, how can an IoT device be sure that the other devices are legitimate? How can it safely share value? Fundamentally the blockchain solves an identity problem. Devices with associated addresses can safely transact currency, data and enforce access control mechanisms. Now I can trust that IoT device, since in fact I’m putting trust in the mathematics behind the blockchain. As a caveat, notice that if the private keys of the device are exposed, the whole system is compromised. That’s why the IoT-Blockchain stack must be rooted at the hardware level, security cannot be outsourced. Secure chips should store the private keys on the device itself.
In this blog post we illustrated why the future of the IoT-blockchain couple is very likely going to be bright. This is not to say that there not challenges to be solved, but we don’t see any conceptual great filter at the horizon. Ok, all of this discussion was a bit theoretical (Author’s fault I guess), what can we concretely do with IoT and blockchain? I will cover many interesting use cases in a next post, also describing how this will be concretely possible thanks to AnyLedger, the startup which I recently founded to bridge the gap between IoT and blockchain. Stay tuned.