IoT, meet Blockchain. Blockchain, meet IoT.

Blockchain and IoT
Share on facebook
Share on reddit
Share on twitter
Share on linkedin
Share on email
Share on print

By Adam Calihman

IoT and blockchain are two very hot industries that, until recently, seemed rather discrete and unrelated. Since the dawn of IoT 1.0, it has been a running joke that you can make just about anything into an IoT gizmo (think smart air freshener) and that trend is still moving along!

Similarly, the blockchain industry is rapidly growing with a mission to “blockchain-ify” and find practical applications for the nascent technology. It seems very likely that an integrated application of the two technologies has potential to beget something useful beyond a few laughs. In this article, we’ll give a bit of background and a glimpse at some practical ways that the combination of IoT and blockchain make sense. We’ll also point out why you might want to keep this topic on your radar.

If, however, you are simply craving a hands on tutorial using blockchain and IoT, you can try out our #NetBurnerIoT project integrated with Bitcoin here.

There are those who argue, especially in the economics world, that blockchain is a dead-end path. This road block has yet to be hit despite many bumps in the road. To a great extent, blockchain’s existential crisis is based in a lack of solid adoption and application, rather than the soundness of the technology. Massive claims aside, it is safe to say that it is still gelling, has some very sound and revolutionary concepts, clear potential (including in IoT) and has a growing community of brilliant people who are continuously improving it.

We’re among other leading companies like IBM and SAP who feel that pursuing a hybrid of IoT and blockchain may have considerable benefits for a variety of applications. In a time where people, finance, data, goods and services are globalized and decentralized, a technology like blockchain may be very well-suited to efficiently facilitate and regulate these economies of scale.  

Blockchain Primer

Since this is an IoT-centric blog post, we’ll assume we can skip over why IoT and embedded systems are awesome and just detail blockchain for a bit. Let’s start with the biggest brand in blockchain technology – Bitcoin, right? The bitcoin cryptocurrency is one of the most successful implementations of a blockchain since the illusive Satoshi Nakamoto published his intrepid 2008 white paper explaining the concept. We’ll use bitcoin as an example through much of this article.

Since then, a myriad of other coins, like Ethereum, have come about and some really smart decentralized applications (Dapps) the likes of Crypto Kitties and Origin Protocol have thus evolved. Put in perspective, however, we’re still just at the first few hours after the proverbial big bang moment, so expect a lot more to come.

→If IoT is built on embedded networking and computing, then blockchain is built on immutable distributed ledgers.←

At the core of the blockchain technology is a way to have open, distributed, immutable (unchanging) and secure data ledgers. In fact, blockchain is actually just a type of Distributed Ledger Technology (DLT), which essentially serves as trustworthy records and chains of custody. They include methods to package, track, and encrypt all sorts of data over a decentralized network. Blockchain began as an immutable DLT with a record of ownership, past and present, of cryptocurrency coins. But currency is just the beginning!

Structure.

The “block” elements in bitcoin, for example, each contain an average of 1 MB of data containing up to 500 or so typical transactions or discrete records [1]. They are added to the blockchain chronologically. You can think of the “chain” as the cryptographic glue securely holding blocks together on the blockchain.

A typical transaction, such as trading bitcoin (BTC) between two parties, or at the very least two bitcoin addresses, would record some basic data such as the quantity of bitcoin, fees, the seller’s bitcoin “wallet” address and the buyer’s bitcoin wallet address. The addresses in this case are public cryptography keys. You can see a sample transaction here, which includes  those public keys.

Consensus.

The next phase is that an open pool of “miners” engage in solving an encryption puzzle, also known as a “consensus problem”. The first miner to solve that puzzle wins a bitcoin prize as well as the work of packaging up all 500 or so records into a block which is then appended to the chain, chronologically. This represents the most common type of consensus algorithm known as the “proof-of-work” method. We won’t go too much further into the evolving consensus methods but it is interesting stuff. Here’s a useful article if you want to know more.

The consensus group of miners work as a “democratic body” to provide a majority agreement on the integrity and authenticity of the new block before its addition to the chain. As part of the consensus function and to protect the integrity and immutability of the blockchain, individual blocks each have starting and ending encrypted hash codes (aka “hashes”). A new block must have a starting hash that matches the ending hash of the preceding block on the chain in order to be appended to the blockchain. Here lies one of the keys to how blockchain upholds immutability and security of data. The figure below shows the high-level process of adding records and blocks to the chain.


Multiple discrete transactions or other data records are bundled into a new block. The block is appended chronologically to the blockchain.

Blockchain Nodes.

Want to be a miner or just run a copy on your extra computer? You can run a live copy of a real blockchain “node”, like Bitcoin, for free (if you can spare a computer with at least 200-300 GB of storage plus resources) and to do so without even having to be a miner. As described by Chris Gundy in the coinoffering.com blog, “In its most straightforward form, a node is simply a computer that connects to the bitcoin network. In order to be classified as a full node, the computer needs to actively verify the rules set out in bitcoin.” Most public blockchains welcome and literally need random users to run blockchain “nodes” to make the system work. This really enables a ledger system that can be decentralized, openly distributed, monitored and preserved.[2]

Ultimately, the power of blockchain lies in the immutability of the data ledger coupled with decentralization. This is a core value of the technology. It seems pretty clear how this is important in terms of the transfer of ownership. For example, you need the things that you purchase to always be on record as being your rightful property until you sell it, trade for it, or give it away. Anything less amounts to robbery or fraud! With immutability this capability becomes more determinitistic. Furthermore, you may also need on-demand, 24/7 access to that property regardless of an outage to a particular server on the network. Decentralization accommodates this important requirement by having multiple identical copies of the blockchain, and with it your ownership record, distributed around the world.

Smart Contracts and Dapps.

A newer and very exciting element of some blockchain implementations is that they allow for “smart contracts” to be stored, executed, and documented over the blockchain. Smart contracts make use of the ability of a blockchain to store and execute code on a given node, which allows for infinite possibilities involving business and application logic. The Ethereum blockchain is a leading force in the use of smart contracts, which help functionalize and apply blockchain technology to real world conditions and needs. Such applications are called “Dapps” or Decentralized Applications.

Part II Preview

Part II of this article will provide detail on why this all makes sense for many industries and IoT-related use cases and applications. A review of some of the problems and challenges associated with blockchain and IoT will also be included. Finally, we’ll give an outlook for the IoT integrated with blockchain. Come back next month!

Additional reading and references:

Share this post

Share on facebook
Share on twitter
Share on linkedin
Share on reddit
Share on email

Subscribe to our Newsletter

Get monthly updates from our Learn Blog with the latest in IoT and Embedded technology news, trends, tutorial and best practices. Or just opt in for product change notifications.

Leave a Reply

Your email address will not be published. Required fields are marked *