Understanding crypto: What is a smart contract?


The concept of the “smart contract” has been around longer than blockchain. But blockchain-based technology – Ethereum in particular – has created new potential for smart contracts in many areas of life and business.

In a primer it put out in November 2018, the US Commodity Futures Trading Commission (CFTC) says a smart contract “[a]llows self-executing computer code to take actions at specified times and/or based on reference to the occurrence or non-occurrence of an action or event (e.g., delivery of an asset, weather conditions, or change in a reference rate).” Or, as Investopedia puts it: “Smart contracts are self-executing contracts with the terms of the agreement between buyer and seller being directly written into lines of code.”

While smart contracts “might sound new, the concept is rooted in basic contract law,” a 2018 US Senate committee report notes. The computer scientist Nick Szabo is widely credited with first conceiving of the idea in 1994, well before Satoshi Nakamoto brought Bitcoin’s blockchain into being. And some hold up the vending machine – a device with origins dating back to the first century – as an example of early smart contracts in action.

“If the machine is operating properly and money is inserted into the machine, then a contract for sale will be executed automatically,” law fellow Max Raskin wrote in 2017. “This is a smart contract.”

As it’s generally used today, though, the term “smart contract” tends to be linked to blockchain technology. That’s because of the new capabilities blockchain makes possible.

While the Bitcoin protocol enables a “weak version” of smart contracts, it has a number of issues that limit its usefulness, Ethereum co-founder Vitalik Buterin wrote in a 2014 whitepaper. Ethereum, he continued, was developed to eliminate those limitations, making it possible for “anyone to write smart contracts and decentralised applications where they can create their own arbitrary rules for ownership, transaction formats and state transition functions”.

Buterin offered an example of how Ethereum could enable “a smart contract that hedges against the volatility of ether (or another cryptocurrency) with respect to the US dollar”. Such a contract, he said, would specify several actions that need to take place between two parties:

1. Wait for party A to input 1000 ether.
2. Wait for party B to input 1000 ether.
3. Record the USD value of 1000 ether, calculated by querying the data feed contract, in storage, say this is $x.
4. After 30 days, allow A or B to “ping” the contract in order to send $x worth of ether (calculated by querying the data feed contract again to get the new price) to A and the rest to B.

So what are the benefits of such automated processes?

Smart contracts, the American Bar Association points out, promise “disruptive advancement that will have far-reaching impact for many industries, including financial services, government, real estate, manufacturing, and healthcare”. They could help to automate everything from insurance payouts and bills of lading to land title records and Internet of Things (IoT) processes.

“The key feature of a smart contract is that it has trustless execution,” Bitcoin expert Jimmy Song notes on Medium. “That is, you don’t need to rely on a third party to execute various conditions. Instead of relying on the other party to make good on their word or even worse, relying on lawyers and the legal system to remedy things should something go wrong, a smart contract executes what’s supposed to happen timely and objectively.”

It sounds promising. But smart contracts that truly live up to their promise are “really hard” to write without bugs or unintended consequences, Song says.

The DAO provides a dramatic example of the problems that can arise with imperfect smart contracts. Launched in 2016 as a venture capital fund based on a new kind of business model (DAO stands for “decentralised autonomous organisation”), the DAO was built on the Ethereum protocol and used crowd-based, smart contract-based processes – rather than a board of directors or traditional management team – to make decisions about investments. However, a vulnerability in the code enabled someone to gain access to a significant amount of the Ether tokens that had been issued. It wasn’t technically a hack, but someone using The DAO code to their advantage.

The incident led to the Ethereum network being hard-forked so investors could recover their funds, and The DAO’s delisting from major exchanges. It also inspired concerns that “smart contracts are too clever by half”.

Like blockchain technologies themselves, smart contracts are still in an early stage of development. Researchers and developers are working on ways to resolve a wide range of potential stumbling blocks – not only DAO-like vulnerabilities, but questions about how digital tokens can be used to represent physical assets and how such code-based contracts can be easily understood by human beings.
While smart contracts could enable more efficient record-keeping, reporting, identity verification and other things, they could also be used to circumvent laws, diminish transparency, impair market integrity and introduce new risks, the CFTC notes in its primer.

“Smart contracts have the potential to solve existing problems in business procedures and are being developed and tested by many,” a team of Australian and Finnish researchers wrote last year. “However, smart contracts are still limited in their ability to fulfil all expectations, they need to be improved further in many different aspects. We believe the future development should mainly focus on improving the scripting languages, integration with existing procedures, as well as the usability and legality of smart contracts. If smart contracts can be made to work with enhanced security, legality and flexibility, we can foresee a wider adoption of smart contracts in both commercial and non-commercial domains.”

RegisterJoin the new era of cryptocurrency exchangeSign inAccess the cryptocurrency experience you deserve