Although smart contracts have become a hot topic due to the blockchain revolution, the term “smart contract” was first actually used back in the 1990’s by American computer scientist Nick Szabo.
By Tebogo Motloutsi, CA and Danie Pienaar, partner at Spoor & Fisher
The main purpose of a smart contract is to enable two or more parties to transact with each other based on trust and without the need for an intermediary. In essence, a smart contract is basically a computer program that is cast on to a blockchain network and that executes certain instructions when certain pre-set conditions are fulfilled.
The computer program therefore includes a number of “if/then” statements whereby if, for example, a certain condition A is met, a certain step B is executed automatically. Since this process is automated on the blockchain network, no intermediary is therefore required.
By way of background, there are mainly two types of smart contracts which parties may enter into, namely code-only smart contracts and ancillary smart contracts. Code-only smart contracts refer to contracts where there is no underlying signed, written agreement between the parties and where all the conditions are solely set out in the actual smart contract. Ancillary smart contracts, on the other hand, are dependent on a signed, written agreement which has been entered into between the parties.
An ancillary smart contract is therefore effectively an ancillary to the main written agreement and would be used to implement certain/all parts of the agreement (e.g. to perform certain payment actions which are set out in the written agreement).
At first glance, smart contracts seem to be a very effective solution which can be applied in a variety of different applications. However, it should be borne in mind that a smart contract is only as “smart” as the actual computer code which embodies the underlying agreement between parties.
The code should therefore reflect the actual terms agreed upon by the parties and cater for all scenarios which can reasonably be expected. The reason for this is that once a smart contract has been implemented on a blockchain network, it is no longer possible to amend it. It is therefore important to make sure that the terms which the parties have agreed on (for example, orally or via email) are correctly reflected in the computer code.
Furthermore, if the computer code does not cater for a specific situation, and that situation arises, then the smart contract can essentially ‘crash’, thereby making it inoperable. For example, a smart contract may be programmed to collect money at the end of the month from a wallet of a party. However, on the collection day, the user does not have any available funds in the wallet. If the smart contract is not programmed in a way to circumvent this scenario, then it may end up ‘crashing’.
It is therefore essential that the person who is programming the smart contract, be presented with an exhaustive list of all the “if/then” functions which cater for all possible scenarios. Once programmed, it is also important that the program code be validated in order to ensure that the code actually implements all the functions in the correct manner. For the validation, an independent third party can be briefed in order to conduct the investigation.
In some instances, smart contracts may need information from “off-chain” resources (that is, outside the blockchain) in order to perform certain functions. However, smart contracts are not able to “pull” information into the blockchain. The information therefore needs to be introduced into the blockchain by another party, which is also referred to as an “oracle”. An oracle, in the context of smart contracts, is an independent third party that would feed information into the blockchain network, so that the smart contract can execute the relevant instructions.
The reliance on an oracle therefore does increase the level of risk, since failure by the oracle to introduce the correct information in a timely manner could lead to various unwanted consequences. However, in many instances it is unavoidable due to the nature of the contract.
From the above, it should be apparent that smart contracts can by a very effective tool, but it is at present still a purely rule-based system and therefore does not include any artificial intelligence (AI) which allows the smart contract to learn over time and make certain judgement calls. However, with the rapid developments in AI, blockchain and smart contracts, the implementation of AI within smart contracts might not be too far way. If successfully implemented, AI could address many of the difficulties which current rule-based smart contracts are faced with.