Home / Publications / Digital Assets / Smart contracts

Smart contracts

A smart contract is a self-executing contract whose terms are wholly or partly written in computer code. 

The most basic bit of any computer code is: if x, then y. If condition x is met, then perform action y. And in essence, that’s all a smart contract is – a piece of software that performs specified actions (e.g. pay out money or transfer the title to goods) when certain conditions are met, whether as a one-off or repeatedly. 

The first smart contracts were mostly written in natural language. They either required performance to be executed in code or included some terms in code. But it is now possible for contracts to be written entirely in code – which can make them hugely more economic and efficient, but which may also  raise new legal issues and which certainly requires an extra degree of due diligence from the contracting parties.

Creating a framework and managing risk

There is a strong argument for using a ‘real world’ contract as part of a framework, alongside one or more smart contracts. This may not be necessary if the smart contract is a very simple one that can be easily monitored. But otherwise, unless a contract is extremely low value and low risk, you probably want to have a failsafe governing structure around the outside of it.

For more on failsafes, disputes and other problems that may arise with smart contracts, see managing smart contract risks.

How do you build a smart contract?

You can use some types of smart contract ‘off the shelf’. But they might not do what you want to do. If you have a bespoke problem, it's highly unlikely somebody has programmed exactly the right rules you need. So you'll probably use of the many available open source code kernels that are now available as the starting point for your smart contract. 

A key issue is determining the conditions that will trigger the performance of the contract. These may be that somebody does something and that information is passed to the contract. The contract may perform verification – e.g. by checking that money is in a bank account. Or the contract may draw its information from an ‘oracle’, which is the industry term for a (typically third party) data feed. 

Data from oracles may take many forms, ranging from share price information to stock control data.  Potentially any sort data can be accessed via an oracle, although the parties to a contract will want to assure themselves of its reliability. In some cases – for instance, weather data used as an oracle in insurance contracts for farmers – there may be a number of potential data sources. Choosing the most appropriate one may make a material difference to the performance of the contract.

It is important to remember that, whatever the conditions are, they will have to be met exactly in order to trigger the action of the contract. A smart contract can’t say “close enough” or “OK in the circumstances”. Any latitude that is required has to be built into the contract from the start, by broadening the parameters of the trigger conditions. 

Who uses smart contracts?

Inevitably, the tech sector and, to a lesser extent, the financial sector have been in the forefront of adopting smart contracts. Where the assets behind a contract are digital to begin with, there is a greater degree of certainty, as key data can be easily captured in a way that may be harder to achieve for physical assets. While sensor technology and the Internet of Things are rapidly lowering the barriers between the real and virtual worlds, human intervention is still necessary for many assets. In a shipment of agricultural produce, for example, somebody may have to measure it and verify its condition, possibly a number of times during its transit. 

A use case that is attracting a lot of interest is the potential high-volume use of smart contracts in consumer business, particularly in transactions of certain types – where, for example, there is a significant time delay, and businesses want to ensure a guarantee of payment. In that context, the contract would probably be commoditised, as one would expect a high volume of repeatable usage.

A smart contract can be part of an asset

Some digital assets are actually designed to incorporate smart contracts. For example, an NFT is basically an asset that has been tokenised using a blockchain. That blockchain can also be used to attach conditions to the asset.

"Companies using promotional NFTs, perhaps as metaverse or in-game giveaways, will want to build in robust restrictions on how they can be used to minimise the risk of damage to their brands."

Doing business with DAOs

Decentralised autonomous organisations (DAOs) are online communities owned and controlled by their members. Without formal leadership, their actions are usually determined by vote – and in many cases, this decision-making is built into a DAO’s structure through smart contracts, which act as a DAO’s version of a constitution.

Key contacts

Ian Stevens
Partner
London
T +44 20 7367 2597
Daniel Gallagher
Senior Associate
London
T +44 20 7367 3418
Rachel Macrae
Associate
Aberdeen
T +44 1224 261 022