On the blockchain, nobody knows you’re a fridge

Making Smart Things Smarter with Smart Contracts

I happen to be the tech guy in my house and anything that breaks is automatically my problem and fault. This includes laptops, tablets and smartphones and extends to appliances and the occasional plumbing problem.

A while ago, when the water filter needed to be changed, our refrigerator was good enough to let us know with a visual indicator on the front panel. Of course, I ignored it for a few days and eventually the reminders spread to the rest of the family, so I had to do something about it.

After looking inside the fridge to get the model number, I did a quick web search for the matching part and placed an order, then tracked the shipment to make sure I received the two-day shipping I’d requested.

I’m going to use my smart-ish refrigerator to think how our everyday things can get smarter – maybe a lot smarter using blockchain technology and smart contracts.

Let’s start with a few definitions.

What’s Property?

It might help to list a few things that I might consider my property – common things like my phone, my car, my house and of course the refrigerator I mentioned earlier. What makes any of these my property is that I have possession of them, the ability to use them to do something useful and to transfer them to someone else if I want.

What makes my refrigerator “smart”?

As a computer scientist, my answer might be that I could make some “thing” smart by adding computational capabilities and logic to it. This computational logic could be used to do something that is useful to me. For example, my refrigerator used sensors and a microprocessor to let me know when it needed a new water filter. Similarly, my car tells me how many miles before it needs service and could be equipped with the ability to recognize me and start and run only for me. My home could be instructed to open only for my family or perhaps for certain visitors for a period of time.

Smart property might “know” who it belongs to.

This is reality today as we’ve seen with smart appliances, smart cars and smart homes. The trend continues as we add network connectivity to smart things to develop Internet of Things (IoT) devices. I’ll use the terms “property” and “thing” interchangeably.

Virtual Property

It’s useful to extend the idea from physical property to “virtual” property which I own and from which I can extract value or utility. The gmail account that I’ve had and used since 2006 is pretty valuable to me. Similarly, my eBay, Twitter and LinkedIn profiles and their accumulated reputation is virtual, but valuable property. My insurance policies and electronic health records not to mention any unspent bitcoins, are all examples of my virtual property.

Since virtual property lives on computers and often in the cloud, we could think of it as being inherently smart with the ability to have and run computation. In fact, it’s increasingly common to have digital representations of physical property which can be stored, tracked and transferred as tokenized assets on a blockchain, just like bitcoin.

What’s a contract?

According to Wikipedia, a contract is a “voluntary arrangement between two or more parties that is enforceable by law as a binding legal agreement”.

When I think of a contract, I usually conjure up a picture of pieces of official looking paper written by lawyers or realtors. In this mental model, the paper itself doesn’t actually do anything other than specify some terms and conditions agreed upon by multiple parties. It’s up to the parties participating in the contract to carry out the agreed upon terms. Enforcement of these terms relies on trusted authorities such as banks, brokers, escrow services or governments.

Contracts and Intermediaries

Imagine that Alice sells her house to Bob. They go through a process of signing contracts and agreements in which ownership is formally transferred. There’s an exchange of money and in return an agreement that Alice will vacate the property and hand over possession to Bob. How is this agreement enforced? If Bob’s deposit check bounces, realtors or lawyers would sound the alarm and the sale would fall through. If Alice refused to vacate the house, chances are Bob would call on some authority figure such as the police to get Alice to leave.

Existence of such authorities is what allows two parties to trust each other with such a substantial transactions. The system works quite well and has for quite some time. The problem is that centralized authorities tend to be inefficient and expensive. For anybody who has bought or sold a home recently you understand the cost of services and providers associated with the transaction. Could there be an alternative?

Can I automate contracts?

When I take a local train at the subway station, I agree to pay a fare. This agreement can be thought of as a simple contract, the terms of which can be automatically enforced.

Consider the turnstile at a subway station or a concert. This device does one thing really well: it allows a single person, presumably holding a ticket, to enter at one time, essentially enforcing a simple contract that exchanges payment for entry without needing a human operator.

The terms of this contract can be depicted using a state transition diagram. The turnstile is a thing that can exist in two states – locked and unlocked. We change (transition) through these states by paying for entry and passing through. Simple, right?

Now let’s extend this idea to the slightly more complex scenario of a vending machine that automatically enforces the terms of a different contract. It allows anybody to walk up to it, deposit some money and get something out. Again, no shopkeeper needed.

The corresponding state diagram will look similar to the one for the turnstile, but you’ll see that the machine exists in three states: it has the ability to accumulate funds, dispensing goods and make change.

So, in answer to our earlier question: Yes, it is certainly possible to automate execution of simple contracts.

Smart contracts

Smart contracts take the notion of automation to a more complex and digital level. Although smart contracts have recently been popularized in the context of blockchain technology, the term was first proposed by computer scientist and cryptographer Nick Szabo in 1994 as a means to programmatically execute agreements between parties without needing manual intervention.

An easy to understand example of a smart contract is the online bill payment for a recurring service such as a health club membership. On a fixed day each month a program faithfully wakes up and transfers money from one bank account to another. This can be great (if it’s what you want).

Smart Contracts on Blockchains

To understand smart contracts in the context of blockchains, let’s consider Bitcoin transactions which execute some procedural logic to be validated. Bitcoin transactions are constantly coming in and the state of the blockchain’s ledger inexorably transitions every 10 minutes and never goes back to a previous state.

A useful insight towards this goal is to understand that transactions added to the Bitcoin blockchain are more than data – they actually require execution of a small script on each node. This is done using a simple stack-based programming language (https://en.bitcoin.it/wiki/Script) that validates the transaction.

Instead of baking the transaction processing code into the protocol, it’s possible to decouple it into a component that can execute complex programmable conditions and logic as Smart Contracts.

This is done in blockchain platforms like Ethereum and Hyperledger Fabric, which allow programming of arbitrary smart contracts operating on digital assets stored in the blockchain ledger.

Applications and Use Cases

A compelling scenario could be an insurance policy blockchain smart contract with multiple transactions throughout its lifecycle. An initial purchase transaction would trigger an automatic deposit of monetary assets into the contract. A second transaction might add documentation proving ownership and value of real world property being insured. Subsequently, a loss notice event from an external claims system might trigger a Claim transaction which would execute autonomous Verification and Payout smart contracts. The policyholder would not need to file a claim, and the insurer would not have to administer it. This would reduce the potential for fraud, decrease administration costs and simplify the claims process.

It’s early enough that fully self-executing smart contracts are still fraught with risk as seen with the DAO which resulted in an Ethereum hard fork. However, we are already seeing smart contract usage on assets with limited value. This will inevitably expand to more valuable transactions as the technology and our trust in it continues to grow and mature.

Faisal is an expert in blockchain technologies, mobile, visual and conversational User Experience (UX) design, Application Programming Interface (API) design and open source technologies. As architect for DXC Digital Insurance, he directs design, training, and development activities and helps to set technology direction. Faisal also devotes part of his time to research and implementation of emerging technologies.