Securely Controlling Hardware Devices with Blockchain
Tags: Blockchain Technology, Connected Home, Smart Contracts, IoT, Smart Home

Securely Controlling Hardware Devices with Blockchain CoreLedger Follow Apr 9 · 7 min read

Blockchain technology sometimes get’s thrown around as a universal fix-all, with use cases ranging from tokenizing high-value artworks to supply chain tracking. But some of the most important and relevant blockchain use cases sound very boring because of their simplicity, though in reality they are neither simple (technologically speaking) nor boring. Think, for example, of the security implications of using blockchain to communicate instructions to a hardware switch.

Smart-home devices and IoT appliances are quickly becoming common place in our homes, but not enough time is spent talking about security. This is one area where blockchain technology can provide a straightforward and obvious value add, allowing you to securely control everything from a simple on/off switch, or even more complicated connected hardware controls for things like the lighting in your home, a garage door or smart lock, or really any other connected hardware switch you might want. But before we get into the actual applications, let’s discuss the technicalities, because there are some important differences in a blockchain powered solution.

The Problem with Conventional Smart-Switch Controllers

Let’s start with current smart solutions and see how they work via conventional methods. If you want to remotely control a smart light switch, then you typically need a (hopefully) secured web service which grants you access after you’ve provided login and password. You can then send the switch a command, and the web service will instruct the hardware to turn the light on or off.

The conventional way to control a connected smart device is fundamentally un-secure

The problem with this setup is that the web services provide so-called “write access.” A client sends instructions, which are then translated into hardware instructions via the web service and then executed by the attached device, in this case a light bulb.

Now, all write-access is by definition un-secure. No web service is perfect. There are always holes in the security. Whenever you grant access to a device from “the outside,” there is a chance that someone can hack this access and abuse the service for nefarious purposes. The vulnerability comes from a single point of failure, the point where the authentication is checked and where instructions from the external client are accepted.

Controlling Connected Hardware Devices with Blockchain

The security issues with IoT and smart devices are well documented and, while the average consumer might be ok with the risks, enterprises, governments, and any other conscious entity certainly won’t be. Blockchain technology can solve the security issues inherent in the single point of access by wrapping the client command in a smart contract.

The smart contract contains the state (on/off etc.) of the switch and controls the permissions for changing its state. Doing so requires a signed transaction from the owner of the smart contract’s private key. The transaction is then submitted to any blockchain client. A hacker does not know which client it will go to and even if they were able to intercept the signed transaction, they can only do a denial-of-service by preventing the message from reaching the blockchain client and being mined. Anything that is mined is synced to multiple nodes within the network.

The ‘On’ command is wrapped up in a smart contract and confirmed by multiple third parties. Goodbye single point of failure!

Now, blockchains such as Ethereum usually require a certain number of “confirmations” from other clients. This ensures that the transaction has been mined and correctly embedded into the blockchain, meaning you have multiple third-party “witnesses” ensuring the transaction’s authenticity. Even if a hacker manages to hijack a single client or intercepts requests to sync the state and modify them, they wouldn’t be able to hijack all of them simultaneously and trick the network into believing that the switch is off when it should be on.

Using a smart contract, the switch itself doesn’t have any external access. Let there be light!

Thanks to the smart contract acting as the vehicle for the command, and that only after multiple third party confirmations, the lightbulb end of all this no longer needs any external accessibility, turning it into a read-only node that just handles outbound connections and syncing with other blockchain clients.

Again, there are more clients, all of them controlled by individual entities, who ensure the safety and security of their devices with individual verification. A hacker might be able to trick one, or even a few, of them into communicating a wrong state… but to do that to the entire network? That’s practically impossible.

The added security of this setup comes from the fact that the system which changes the switch now just has to read instructions from a smart contract, rather than opening up to instructions from the outside world.

How secure is this really?

Extremely. Security is provided by proven cryptographic means, where the private key we mentioned above allows you to create an un-forgable signature, which can then be verified as genuine by any third party without knowing the private key itself. This allows you to make signatures a one-way process. Blockchain by itself is essentially a secure database combined with a range of programming options, called smart contracts. Despite their name, a smart contract is nothing more fancy than a simple computer program. These computer programs can be programed to only trust instructions from an authorized actor. This actor authenticates themself with a signature from their private key, which can be kept entirely secret. In this way, there is no breach of security when sending instructions to the blockchain. So far there is no proven way for an attacker to intercept and modify the message that is sent to the smart contract. This is in contrast to a client-server system with a central database and a multitude of security layers, all of which are needed to fend off attackers.

Blockchain protocols, if properly implemented, are a perfect decentralized information bus. Blockchain technology even has a built-in fault tolerance mechanism to solve the problem of concurrent transactions (one person switching off, another one switching on) Usually this is for double-spending prevention, but the same mechanism can be applied to the switch problem.

A final security advantage is the decoupling of writing and reading from the hardware switch. A conventional client-server system always has to protect its database behind layers of security, since it contains all the important information. By contrast, a blockchain distributes its information around a network. In a client-server system it is sufficient to attack a single node to alter a system’s state. To accomplish the same thing in a blockchain system, you must attack and subvert every individual node, which is practically impossible.

Other factors to consider

Let’s assume that the same blockchain technology described above, such as Ethereum (it doesn’t even have to be the expensive Ethereum Mainnet), is being used by a financial institution. You can assume that the blockchain clients will always be up-to-date with regards to their security. Let us also assume that the network has a sufficient number of blockchain clients, because it is used for things other than just setting switches. Both of these are safe assumptions on any moderately popular blockchain. The only vulnerability of the setup as described is the security of the private key itself, which can be lost or stolen. Fortunately, there are many ways to keep a private key safe, recover it in case of a loss, or even replace it.

What can you use this for?

There are many reasons why someone would might want the security of a blockchain powered remote access system, such as controlling an alarm system. Of course there are a plethora of applications for the simple on/off switch, but thanks to smart contracts you can also set up more elaborate instructions, where numbers, strings, dates and addresses being communicated to the switch. For example, you could run an entire hotel’s door lock system on this foundation, with each lock reading the public addresses of the activated keys off the blockchain. The keycard would initiate a challenge-response process, which takes just milliseconds to process, in order to authenticate the user. And there you have a smart-lock, just as fast as conventional methods and far more secure. It’s also much more versatile. You could apply the same system to a car-sharing service, storage lockers, or a high-security facility. This solution can also be used for other applications. For example, it could be part of a supply-chain monitoring process where the “switch” indicates whether a shipment has reached a warehouse or not. One additional benefit of a blockchain-based system is the fact that any additional security measures, such as requiring multiple-signatures to complete the command, can easily be built into the smart contract. For example, you could require that 2 out of 3 keys have to sign in order to authorize an action. For enterprise clients, governments, or other highly complex or highly secure applications that require remote control, this is a vital factor for security and flexibility.

Smart home devices, connected hardware, and IoT are already fundamental parts of our lives, and that will only increase. As they do, however, the need for security increases. Using smart contracts and blockchain technology is a simple way to secure the access and control of a connected hardware switch, with extremely versatile applications that are perfect for enterprise applications. This use-case fulfills blockchain’s promise to secure our lives and bridge the physical/digital gap, and the possibilities for this hardware control application are endless.

CoreLedger’s mission is to help businesses of all sizes quickly and affordably access the benefits of blockchain technology. From issuing a simple token, to enterprise- grade token economy solutions, we have all the tools you need to integrate blockchain into your business.

Interested in our results-focused, real-world approach? Then visit our website for more information, or get in touch with us directly to discuss your project.