In the previous blog, we looked at the fundamentals of blockchain technology. It was established that a blockchain is essentially a database which is verified, validated and written through a decentralised network. Therefore no single individual organisation holds the bulk of power in a transaction. Although heavy on computational needs, storing data in a public blockchain provides many advantages over a typical database. However, blockchains have more to offer than just storage capabilities.

Many of the pioneering use cases for blockchain contain smart contracts. If we consider blockchain as essentially being a type of database, then smart contracts are applications which interact with and store data within the blockchain. With smart contracts, executable code is overlaid onto the blockchain enabling it to autonomously carryout transactions stipulated in a legal contract.

So what does that mean in English? Let’s break it down

At its core a smart contract is a computer program that has prebuilt functions that will act out in response to certain criteria, i.e. “If this happens, then I will do that.” That in itself is not particularly ground breaking. All programs have pre-set instructions on what do depending on if this or that happens. E.g, your phone is programmed to ring when you receive and incoming call. Part of what makes smart contracts different to ordinary programs, is their ability to autonomously transfer value from one area to another. This is different from banking applications because the transaction does not need to be authorised by a third party, such as a bank or clearing house. The blockchain is the vehicle by which the value is transferred, whilst the smart contract is an ‘add on’. The smart contract has access to the necessary accounts, and it moves the funds from one account to another through the block chain.

Moreover, the programs are built to the specifications of a legal contract. Once the program has received the correct triggers, it will act out the legal contract autonomously. The legal contract could be anything; for example, if you made a bet with your friend on the outcome of a sports match, in the event that you won or vice versa, the smart contract would automatically transfer funds from the loser’s account into the victor’s on the basis of the result. Smart contracts offer an advantage over traditional legal contracts because they are not opaque,there have been numerous cases where contracts have been overturned because the language in the contract was ambiguous. This is not the case with smart contracts; code is written in parlance with legalese but it remains separate and unambiguous.

Smart Contracts

The idea for smart contracts was first introduced by Nick Szabo in 1997, at a point when the technology necessary to support his ideas was yet to have been created. It wasn't until bitcoin (and hence the blockchain) was created in 2009, that technologists returned to the idea and started to realise the value it could deliver.

Nowadays, most of the innovative proposed use cases for blockchain technology involve smart contracts somewhere. For example, solar panels are gaining popularity in the UK, partly because if the solar panel makes more energy than is consumed, there is the option to sell the energy back into the grid. Smart contracts can manage that transaction more efficiently than the current technology in place. Details of the transactions can be stored on the blockchain whilst the contract side of it ensures that neither party owes money to one another.

However, this is not to say that smart contracts come without risks. If the smart contract is attached to a public decentralised blockchain (one that is maintained by hundreds of independent nodes* around the world), then if an adjustment needs to be made to the Smart contract, the majority of the nodes must download the new smart contract and run it. If the majority does not run it, then the changes will never be adopted. This is similar to what happened with The DAO (Distributed Autonomous Organisation).

Watch out for the hackers!

The DAO was a new type of venture capitalist funds, where the smart contact would release funds to investees autonomously. Unfortunately, hackers realised there was a vulnerability in the code, and were able to redirect the approved funds away from investees, and into their own accounts. The creators of the DAO immediately set about closing this vulnerability, but ensuring that everyone in the node network accepted and ran the new code has caused major rifts in the structure of that particular blockchain and its associated cryptocurrency.

Notably, smart contracts are a new technology, and with all new technologies there are teething problems. As the technology matures, it may prove that smart contracts are only good within certain use cases, or we may find that we can mitigate their risks.

In this blog, there have been two references to blockchains as being “Private”. In the next blog we will delve into the differences between public and private blockchains, and which types of situations would lead one to have an advantage over the other.

If you have any comments or questions surrounding blockchain, don’t hesitate to Contact us