Smart contract platforms like Ethereum, Cardano, NEM and EOS have become more popular over the last couple of years. But what exactly is a “smart contract?” And what can it be used for?
What is a smart contract?
The term ‘smart contract’ was first coined in a paper by the American computer scientist and legal scholar Nick Szabo in 1994. In this paper, Szabo defined smart contracts in the following way:
“Many kinds of contractual clauses (such as collateral, bonding, delineation of property rights, etc.) can be embedded in the hardware and software we deal with, in such a way as to make breach of contract expensive (if desired, sometimes prohibitively so) for the breacher.”
In Szabo’s definition, a ‘smart contract’ is a protocol or code, which automatically executes earlier drafted and signed agreements and penalties between two parties. In this way, contract execution is automatized and breaches can be dealt with in a conflict-free manner. An example of a smart contract is a vending machine, which may be understood as a ‘primitive’ smart contract: when you give money to a vending machine, there is an implicit agreement between you and the vending machine owner that you will get soda, candy or other snacks in return. However, this agreement is not enforced through the law. Instead, it is enforced through the mechanism or technology of the machine itself.
Whilst Szabo had described the fundamental principles of smart contracts, there was no environment available yet where these self-executing protocols could be realized. This was the case until 2014, where the Russian programmer Vitalik Buterin, drawing upon Nick Szabo’s idea, proposed that smart contract software may be created based on blockchain technology found in cryptocurrencies such as Bitcoin. His solution was to create Ethereum, a decentralized platform that runs smart contracts. In the first version of Ethereum’s white paper, Buterin defined a smart contract with the following description:
“A contract is essentially an automated agent that lives on the Ethereum network, has an Ethereum address and balance, and can send and receive transactions. A contract is ‘activated’ every time someone sends a transaction to it, at which point it runs its code, perhaps modifying its internal state or even sending some transactions, and then shuts down.”
In essence, a smart contract is a piece of code that enforces rules between participants, without the need for a trusted, central authority.
The Problem With Trusted Third-Parties
Let’s suppose that Joe wants to hire Bill to design a website and that Joe and Bill live in different countries and do not know each other except through a few brief conversations online. The two of them may be unwilling to do business with each other simply because there is not enough trust between them. The usual solution to this problem is for Joe and Bill to connect with a third-party that they both trust, such as a website that specializes in matching up web-designers with businesses that need web-design services. Through this third-party, Joe can escrow payment and only release funds to Bill once the website is completed. Furthermore, in the rare case that Joe and Bill get into a dispute over the project and cannot resolve it themselves, this third-party site can be asked to step in and mediate the dispute. While having a mediator can be a workable solution, the solution suffers from a serious flaw: the third-party site is likely to charge high fees for the use of this service, and these fees will cut into both Joe’s and Bill’s profits.
The Smart Contract Solution
Situations like Joe’s and Bill’s are where a smart contract can come into play. Instead of using a third-party website, Joe can write a smart contract and deploy it on the Ethereum blockchain. This contract will be coded to follow instructions like these: ‘If Bill delivers the website, release x number of ether coins to his address’. Joe can then send x number of coins to this contract, and the contract will execute the code based on whether Bill fulfills the conditions or not. Bill can also read the code and see for himself that it will execute as long as he fulfills his side of the bargain. In addition, he can search the Ethereum blockchain and find the transaction where Joe sent the funds. This way, he knows that he will get paid if he delivers the website as promised.
In theory, this is how smart contracts work. In practice, a smart contract may need to be much more complex than is described here. For example, Joe may not want just any website, but a website with certain features or that looks a certain way. Maybe human beings will still have to be brought in if negotiations break down. In this case, the contract may need to specify ahead of time how arbitrators will be chosen. Nevertheless, the basic principle of a smart contract is that two people agree on a set of conditions that are written in code and enforced by the blockchain running the code.
Uses for Smart Contracts
Smart contracts have the potential to simplify daily tasks for many people. Here is a list of just a few of the applications that have been developed or are currently being developed.
Many companies and even individuals use cloud storage services such as Dropbox and Amazon Web Services to store large amounts of data. However, these services are expensive. A smart contract alternative called StorJ allows users with excess hard drive space to rent their hard drives out to companies in exchange for StorJ tokens.
Just as companies need to rent hard drive storage, these companies may also need to rent processing power. A smart contract application called Golem allows users with idle computers to sell their processing power in exchange for cryptocurrency.
Passengers currently rely on Uber or taxicab services to hire drivers to take them where they want to go. A smart contract alternative called DAV Network is currently being built that developers believe will decentralize transportation services and lower their costs.
In order to get packages to customers, shippers rely on large logistics brokerages to match them up with reliable carriers. However, paperwork is often lost, and packages don’t get delivered. Developers of a smart contract alternative called Fr8 claim they will fix this problem by storing the paperwork on an immutable blockchain.
Customers of online poker platforms often fear that they are secretly being cheated. Platform administrators can potentially look at player’s cards and have employees play against customers, easily defeating them with inside information. Platforms also sometimes go offline, disappearing with customers’ deposits.
A solution called Virtue Poker seeks to solve this problem by having each “table” of poker consist of a smart contract whose funds are inaccessible to the administrators and whose cards cannot be seen except by players and “justices” chosen through an impartial trust algorithm.
Digital Collectible Trading Card Games
Digital collectible trading card games such as Magic: The Gathering Online are very popular. But many players fear these games may go offline at some point in the future, causing users’ cards to cease to exist. Alternatives such as Gods Unchained use smart contracts to guarantee that a player’s cards will exist forever, and that the game can always be played as long as someone wants to play.
Freelancing platforms like Upwork charge high fees. An alternative smart contract version called WorkCoin is currently being developed to lower costs.
Smart contracts can be used for fixed income investing, precious metals investing, smart gun control, payment systems for merchants and many other applications.
Smart Contract Platforms
Ethereum is currently the most popular smart contract platform. However, new platforms have emerged to challenge it recently, including Cardano, NEM and EOS . These platforms offer alternatives for the deployment and operation of smart contracts.
While Bitcoin and other cryptocurrencies represented a revolution in the finance sector, smart contract platforms promise to do much more than just allow people to make payments—they promise to transform the Internet itself. In the future, smart contracts will likely continue to play a role in the cryptocurrency community and beyond in industries as varied as insurance, supply chain, mortgage, employment, real estate and any other area where automated contracts could be beneficial.