What are smart contracts?

No more lawyers? That's one potential future for smart contracts

One of the most important elements of any transaction, be it a trade for goods or services, is trust. Both parties need to trust that the other will fulfil their end of the bargain. One classic method of ensuring that has been contracts — but legal documents require expertise and oversight to enforce them. Smart contracts have the potential to change all that.

What are smart contracts? In many ways, they’re no different from a contract you might have signed to complete a job, or buy a house. Unlike those, however, they’re digital and automated. Smart contracts write the agreement of the contract directly into lines of code, doing away with the need for a central organization to approve that either party completes their end of the agreement. A smart contract can do that with the help of a distributed network.

Although most commonly spoken about in the same breath as cryptocurrencies like Ethereum, smart contracts have the potential to take blockchain technology beyond Bitcoin and its altcoins and enable a world where trust is digitally secured.

Building on the blockchain

Although originally proposed by computer scientist Nick Szabo back in 1996 in his publication “Smart Contracts: Building Blocks for Digital Free Markets,” smart contracts only became feasible following the launch of Bitcoin in 2009. Bitcoin, created by the pseudonymous Satoshi Nakamoto, is built upon blockchain technology, a distributed ledger that uses a network of nodes around the world to certify transactions. It’s a core component of what makes smart contracts function.

In the same way Bitcoin leverages a network of nodes — with Bitcoin they’re known as miners — to validate Bitcoin transactions, smart contracts would  use a network of nodes to confirm whether elements of it had been completed. They don’t need any one party to oversee the contract, just as Bitcoin doesn’t need a single party to oversee transactions. The network — and the smart contact itself — provide the validation that either or both parties have completed their part of the bargain, thereby providing trust without the need for a mediator.

By distributing the validation services, smart contracts are much more transparent. They’re traceable and viewable by all parties involved — and potentially by external parties too, should there be concerns over the contract’s contents.

Bitcoin technically offers basic smart contract functionality. It’s used regularly on darknet and clearnet sites to facilitate the sale of items. Once a transaction has begun, Bitcoin is sent to an escrow account, which then urges the seller to send their product. When that product arrives, the buyer confirms its receipt and Bitcoin is automatically transferred to the seller. No middleman required.

Beyond Bitcoin

Where a Bitcoin smart contract is limited to the use of its own currency, smart contracts built on platforms like Ethereum can go much further. Ethereum offers a decentralized virtual machine that is “Turing Complete.” That is, its code base supports a broader use of instructions and can, therefore, be used for a wider variety of purposes beyond the transfer of Ethereum’s token, Ether.

Smart contracts are programmable and therefore read just like programmed applications. ‘If this happens, then do that.’

zero dollar car

With such broad applications, smart contracts could, in theory, replace contracts in a variety of situations. It could replace direct debit systems for automated payments, for example. If there is enough money in an account and a certain date is reached, the contract would transfer a set amount of money to another account and deliver a digital service in return.

When buying a house, the main smart contract could digitally transfer the deed to a home once the required funds had entered the seller’s account, with other smart contracts performing all manner of anti-fraud checks and confirmations of their own.

Neither of those instances are different from how financial transactions take place, but where traditional methods are arbitrary, controlled, and viewable by a single party or limited number of several, smart contracts would be entirely transparent. Smart contracts make parties truly accountable for their actions by simply not executing if the contract is not abided. That makes it much harder for any one actor to cheat the system, since nobody has the level of control that banks or legal institutions have currently.

With no chance of arbitrary middleman interference, and neither party having more control than the other, smart contracts should, in theory, create greater trust between parties and streamline the entire process at the same time.

An imperfect world

As powerful as smart contracts could be, they aren’t quite ready to replace every trust system we have in place already. As described in the examples above, a complicated transaction utilizing smart contracts would likely require multiple smart contracts linked together to cover all of the potential ‘if’ situations that would crop up as part of the transaction.

There’s also the “Oracle Problem,” to consider, whereby smart contracts themselves cannot interact directly with the real world. If smart contracts are involved in transactions involving real-world actions, such as professional to client services, they need an entity (an “oracle”) to tell them that that event has taken place.

That’s a real security risk. If you rely on a single oracle for a smart contract, then you have effectively eliminated the decentralizing benefit of a smart contract entirely and created a single point of failure. A decentralized oracle network makes it hard to trust anyone within that network.

Alongside the yet-to-be-fixed Oracle Problem, there also exists the security problem faced by smart contracts. Like any programmed code, smart contracts can have vulnerabilities, and that becomes even more likely as complexity increases. Following a recent research effort into Ethereum smart contracts, one company found tens of thousands of bugged contracts that could allow for the theft of tokens with ease. There is even debate as to whether such contract exploitation is illegal, since the flaws are built into the contracts themselves.

A smarter future

Fortunately for those excited by the potential for smart contracts, there are many developers working on fixing some of their glaring problems and many others keen to try out smart contracts for all manner of purposes. It will take many years and many changes if smart contracts are to be made a viable alternative for many of the legal systems we have in place currently to make sure two transactional partners trust one another, but the potential is certainly there. As cryptocurrencies continue their mainstream adoption and help introduce wider audiences to blockchain technology and some of its derivative uses, smart contracts may follow suit.