Smart contracts

Page 1

Smart Contracts What is it all about?


Smart Contracts THE CONCEPT

In 1997 a computer scientist called Nick Szabo imagined a world in which contracts could be embedded in the world. He started with a familiar example: the vending machine – a device designed to transfer ownership of goods (a chocolate bar), in return for money. In this case, the contract is “in the machine” as the machine controls the property, it enforces the contract to sell chocolate at the price displayed. Breaching that “contract” is, through design of the machine, expensive for the party in breach. It takes time and effort to steal the chocolate. A parallel can be drawn with car parks – the barrier prevents entry to and exit from a car park, unless payment is made thereby enforces the contractual licence to park there. Mr Szabo imagined how the world would look if computer code could be used in place of these machines – putting the contract “in the code”. Take the example of a contract for a bank loan secured on a car. A “smart lien protocol” could transfer the ability to open the car (using electronic keys) to the bank if the instalments went unpaid; and once the loan was paid off, it would remove the lien. Well-designed computer code embodies the logic and behaviour of the contract which governs the rights and obligations relating to the car. Until recently, there were two principal reasons why smart contracts were not a reality. First, it was not clear how software alone might control property. Although the vending machine and car park use software, they both rely on physical barriers to enforce the contractual terms. Second, there was a problem of trust. How could any computer program be sufficiently transparent and reliable to be trusted to execute the terms?

2

SMART CONTRACTS

Russell McVeagh


The blockchain database The “blockchain” has addressed both of these impediments, and made smart contracts a real possibility. A blockchain is an authoritative, public database. No single entity controls it. Instead, it is maintained, updated and secured by a network of participating computers. Each computer keeps a full copy of the database, and they are all kept in synchronicity by a system of mathematical rules. The blockchain’s structure resembles a ledger in which each new data block that is added to the ledger is inextricably linked back, each referring to the previous entry. The blockchain is often visualised as a vertical stack, with blocks layered on top of each other and the first block serving as the foundation of the stack, the others chained on top. By virtue of this chaining process, changing a block in the stack necessitates making changes to all subsequent (higher) blocks. Chaining blocks together involves solving a cryptographic puzzle. It works like a giant Sudoku puzzle in that it is very hard to solve, but easy to check. Finding the solution takes large amounts of computing power (the incentive for expending it can be a reward of currency and/or a processing fee). But once found, it BUYER can readily be confirmed by the other computers, and that confirmation broadcast on the network. When the majority of the computers have broadcast their verification of the new block, it is accepted.

{ }

As a result, the further down the blockchain you go, the less and less likely the blocks are to change. After about 1,000 or so layers, the blockchain is, for all practical purposes, immutable. SELLER

ARBITR ATOR

The way consensus is achieved between a network of unrelated computers, without the need for individual bonds of trust, is one of the defining characteristics of blockchain. This consensus leads to the existence of one single authoritative blockchain.

Russell McVeagh

SMART CONTRACTS

3


Bitcoin The first use made of this technology was to store and transfer digital cash, called Bitcoin. This began life in 2008, before an explosion in value led to an explosion of interest in 2013. With Bitcoin, the blockchain publicly records each transfer of currency to and from unique addresses. Individuals control particular addresses with a private key. The private key acts like a signature on a cheque. Transfers from an address are possible when they are signed by the right private key. In the context of blockchain technology, therefore, controlling a digital asset means controlling a private key that corresponds to the asset in question. The transfer is then broadcast to participating computers in the network, where it will become part of the blockchain database, and thereby an increasingly trusted transaction. The inventor(s) of Bitcoin envisaged that the technology would be used for a wide range of digital cash transactions: design supports a tremendous variety of possible transaction types that I designed “ The years ago. Escrow transactions, bonded contracts, third party arbitration, multi-party signature, etc. If Bitcoin catches on in a big way, these are things we’ll want to explore in {IF NUMBER NOT MET = ISSUE REFUND} the future, but they all had to be designed at the beginning to make sure they would be DEADLINE {IF NUMBER MET = ISSUE TICKETS} possible later.

So it has proved to be. Bitcoin technology is developing a range of ways in which transactions can be processed. For example, a transaction can be set up requiring multiple signatories using their private key to approve the execution of the transaction before a Bitcoin payment is made. It could, for example, require two of three possible signatories to execute a payment, say between a buyer and seller. If the possible signatories are the buyer, seller and a third part arbitrator, you have the basics of a simple dispute resolution system.

BUYERTICKET

SELLER

ARBITR ATOR

Other uses of the blockchain database A trusted database can be used for far more than moving digital cash. The utility of an open and tamper-proof record of transactions has obvious and widespread appeal. Applications are being explored in healthcare (patient records), government (land registries, online voting and benefit disbursement), and tracking the provenance of diamonds. All these applications have in common the promise to significantly reduce transaction costs, reduce the risk of fraud or error, increase transparency and improve the level of security and trust.

4

SMART CONTRACTS

Russell McVeagh

{


Smart contracts Blockchain technology therefore allows for the transfer of digital assets, just as the vending machine transferred chocolate bars. Smart contracts develop this further. They are possible because blockchains can run computer code. They are not limited to recording simple transfer operations of a digital token. They can be used to record and run software.

{

Smart contracts are therefore little programs that live on the blockchain, and execute “if this happens then do that” relations. Both the programs themselves and their execution is – being on the blockchain – verified by the participating computers to ensure trustworthiness. Neither the software itself, nor its operation, can be tampered with. The software can itself control assets recorded on the blockchain database. It can, for example, transfer digital currency from one person to another.

Take a simple example. Suppose you want to organise a small conference. You need 100 people to sign up and pay their deposits, in order to cover the expenses such as renting the venue and paying the speakers. If not enough people sign up by a particular date, the deposits need to be refunded. You can set this arrangement up with simple computer code. The smart contract will ensure that everyone will be allocated an (electronic) ticket to the conference, or everyone will be refunded their (electronic) money, depending on how many sign up.

{ IF NUMBER NOT MET = ISSUE REFUND} DEADLINE { IF NUMBER MET = ISSUE TICKETS } TICKET

Russell McVeagh

SMART CONTRACTS

5


(Smart contracts, cont.)

The possibilities can be taken much further, if one adds links to the real, physical world. Unlike a traditional contract, a smart contract can also take information as an input, process it through the rules set out in the contract, and take any actions required as a result. Because smart contracts can reference only information on the blockchain, exploiting this capability requires trustworthy data sources that can push information onto the blockchain. Another example puts this in context. Musicians, producers and record labels own the rights to music. The rights entitle them to small payments every time their music is used for commercial purposes. It is difficult to keep track of who owns what rights, and to ensure that the necessary payments are made. A blockchain could keep track of the ownership of rights, and their transfers between parties. It could also be used to transfer royalty payments according to agreed terms. If, for example, platforms such as iTunes and Spotify fed information onto the blockchain, so the playing of music could be automatically recognised, the entire process could be left to run with no, or minimal, human involvement.

Uses and limitations Smart contracts work like computer programs. The code executes logical relations, and behaves in predefined ways. They define the rules and consequences in the same way that a traditional legal document would, stating the obligations, benefits and penalties that may accrue to either party in different circumstances. The rules are then reliably executed by the blockchain. This promises to bring clarity and predictability to agreements. A smart contract could be set up and tested against a range of possible inputs to see how the contract would execute. In effect, this would be testing the contractual language against hypothetical fact patterns, to make sure the parties understood and agreed it. Potentially, less lawyers’ time would be required fully to understand the risks of a transaction. However, computer code is limited. It is good at embodying logical relations (eg if Tom pays, allow him to vote). It is not good at capturing matters which allow for flexibility and sensitivity to changing circumstances (eg Tom is permitted to refuse Sally’s assignment if his refusal is reasonable). Neither is it good where a contract calls for an assessment of human performance, unless that performance can be reduced to a trusted “input”. So smart contracts are not yet ready to replace commercial contracts. There are still many grey areas in contracts – because they are useful – which are better addressed by written text interpreted by humans, rather than logical code executed by the blockchain. Initially at least, smart contracts can be expected to complement traditional contracts. The contract will contain many familiar clauses, including one pointing to a blockchain, saying, in effect: “this is what we agree to run, and we will abide by the results of the code”.

6

SMART CONTRACTS

Russell McVeagh


A vision for the future Perhaps the most radical vision for the smart contract, sees it as a novel, alternative form of agreement. Contracts, in this model, along with a strong and functional legal system, are but one means of forming stable, predictable arrangements. Another, is the smart contract, which uses technology to embody and enforce terms. This does not so much attempt to shut out court oversight, as to make it unnecessary. According to this vision, the vending machine is all; and there is never any need to call the telephone number on the machine (let alone the courts) to make a complaint. Another, more particular, way in which the technology might develop, is by enabling machine-to-machine commerce. The idea is that the growing system of smart devices, particularly as they develop greater autonomy, will need some way to do basic commercial transactions with each other: for example, the car that can pay to recharge itself. Smart contracts seem better suited to such transactions than traditional forms of contracting, which are more labour intensive, and which require a degree of trust between contracting parties. The immediate challenge for lawyers is to consider the ways in which smart contracts might help their clients. The potential for their use increases as more assets come to be represented digitally, such as mortgages, intellectual property, land and of course money. That challenge can be taken up by engaging in a process by which the legal industry and coders experiment to discover the clauses which work best as smart contract, and those which are better suited to natural language. We are all vending machine engineers now. References available on request.

Contacts If you have any further queries please contact:

Michael Taylor SENIOR SOLICITOR, LITIGATION EMAIL: michael.taylor@russellmcveagh.com DDI: +64 9 367 8279 MOBILE: +64 21 0849 4123

Russell McVeagh

SMART CONTRACTS

7


AUCKLAND

WELLINGTON

Vero Centre, 48 Shortland Street PO Box 8, Auckland 1140 New Zealand

157 Lambton Quay PO Box 10-214, Wellington 6143 New Zealand TEL: +64 4 499 9555

TEL: +64 9 367 8000

FAX: +64 4 499 9556

FAX: +64 9 367 8163

For more information on the Russell McVeagh team and our recent work please visit our website www.russellmcveagh.com.

This publication is intended only to provide a summary of the subject covered. It does not purport to be comprehensive or to provide legal advice. No person should act in reliance on any statement contained in this publication without first obtaining specific professional advice. If you require any advice or further information on the subject matter of this newsletter, please contact the partner/ solicitor in the firm who normally advises you, or alternatively contact one of our specialist listed at the end of this publication. Š Russell McVeagh 2016


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.