Smart Contracts
Encyclopedia
A smart contract is a contract-like arrangement expressed in code, where the behavior of the program enforces the terms of the contract. The term “smart contract” was coined by legal scholar and programmer Nick Szabo in the early 1990s, when he, along with Mark S. Miller and Ian Grigg, explored how smart contracts might affect the future of law given the rise of the Internet and ubiquitous computing.
By 2014, the definition of smart contracts had shifted. When introducing a new blockchain called Ethereum, Vitalik Buterin defined a smart contract as “essentially an automated agent that lives on the Ethereum network, has an Ethereum address and balance, and can send and receive transactions.” Since then, the definition of smart contracts has further expanded to refer to any code that runs on a blockchain. However, for the purposes of clarity this article focuses on the subset of smart contracts which both run on a blockchain and perform contract-like arrangements expressed and enforced in code. A blockchain is a disinterested and decentralized network made up of many different computers. Because these independent computers all over the world are running the code and comparing their answers, trying to bribe or censor the owners of the computers in order to change the reported outcome of the execution is expensive. Therefore, a blockchain validated by many computers provides higher integrity execution compared to any single computer. Yet most blockchain computation is entirely public. Keeping the data private while also providing public proof that the computation was done correctly remains an open problem for blockchains.
Smart contracts are not necessarily legal contracts in the sense of being enforceable in the court system. However, smart contracts are able to solve some of the fundamental social problems that have traditionally been solved by legal contracts. For example, commerce often involves an exchange of one thing for another. However, the party that transfers their assets first leaves themselves vulnerable to the other party’s opportunism: the second party can simply walk away from the exchange with both parties’ assets. For Hobbes, the social problem of opportunism was one of the primary reasons for government: “For he that performeth first has no assurance the other will perform after, because the bonds of words are too weak to bridle men’s ambition, avarice, anger, and other passions, without the fear of some coercive power.”
Smart contracts solve the problem of opportunism during an exchange by providing an escrow mechanism for the assets from both parties, only dispersing the assets after both parties have contributed. There is no need for a human intermediary to perform the escrow; the smart contract itself holds the assets. Because the behavior of the smart contract is fully described by its code, and that code runs on a decentralized blockchain with high integrity execution, the parties can be assured that the code describes exactly what will happen. As such, smart contracts hold the promise of being a market-based solution for the opportunism problem that does not rely on State intervention.
However, the enforcement power of a smart contract is limited in several ways. First, a smart contract only has control over digital assets that are represented on the same blockchain as the smart contract. In many cases these are cryptocurrencies, but these digital assets could also represent physical assets in the real world, such as a token representing property title. But only the transfer of digital assets is enforced and secured by a smart contract. The transfer of the associated physical assets is still dependent on other mechanisms, such as courts or reputation. If, for instance, that token representing title to a piece of physical property was transferred via smart contract, actual ownership of that property would still be dependent on something external, such as the traditional legal system.
Secondly, most blockchains only allow for consensual transfer of digital assets, making enforcement of contracts without escrow difficult. If a party to a contract promises to perform an action at a future time, when that time actually comes it may be more advantageous for them to break their promise. One of the main functions of a legal contract is to incentivize the parties to perform their promised behavior even when it is not otherwise advantageous. However, because only consensual transfer is allowed, smart contracts cannot forcibly take assets from users; smart contracts only have control over the digital assets for which the smart contract has been listed as the owner or has been explicitly granted the ability to transfer. Therefore, smart contracts cannot currently enforce future obligations in the same sense that a legal contract can. For example, there is no way to enforce future payments if those payments are not escrowed up front. A mechanism such as garnishing wages doesn’t currently exist in smart contracts. While it is possible to write code that automatically takes money out of an account, this mechanism could easily be bypassed by withdrawing all funds from that account, abandoning it, and creating a new one. Because identity on a blockchain is pseudonymous, the new account would not necessarily be connected with the old account, allowing the user to evade any agreed-upon obligations.
Lastly, a smart contract running on a blockchain cannot directly make a call to the outside world. A smart contract only receives information about the outside world when a new transaction on the blockchain invokes the smart contract. However, many potential uses of smart contracts depend on correctly assessing the state of the world. For instance, if the smart contract is an insurance contract that is paid out in the case of property damage from extreme weather events, the smart contract does not know anything about current weather conditions. Thus, a smart contract is dependent on a source of outside information, called an oracle. Because the outcome of the smart contract could turn on this information, an oracle can have enormous power. Even if the oracle is unbiased, if it is still a singular entity then the oracle may be prevented from talking to the smart contract, undermining one of the powerful benefits of blockchains, their censorship-resistance. Mechanism design has been used to try to solve the so-called oracle problem by incentivizing many oracles to produce the same data as one other, which is then used as a proxy for truth about the world.
Like legal contracts, smart contracts are necessarily incomplete and do not cover all potential eventualities. While legal contracts can depend on laws and judicial precedent to determine how to handle an unforeseen event, smart contracts currently have no comparable option. However, smart contracts can be written to explicitly use decentralized dispute resolution mechanisms. If the contract is thrown into dispute, the contract is able to take into account the output of the dispute resolution services and then continue to execute.
Currently, smart contracts are in their infancy, but they have already been used for tasks such as the secure trading of cryptocurrencies, the creation and trading of decentralized financial derivatives (“defi”), and prediction markets. Because smart contracts allow the secure transfer of assets between parties without the need for a human intermediary, they are transformatively cheap and fast compared to human systems (albeit slow and costly compared to regular computing). Furthermore, they can enforce agreements across national borders easily, something that the legal system struggles to do in an efficient or timely manner. Smart contracts are new tools in the toolkit of private ordering and promise to expand the scope of cooperation and exchange to places that legal enforcement can’t reach. By lowering the risk of cooperation through smart contracts, we can achieve a much more cooperative world.
Further Reading
1. Formalizing and Securing Relationships on Public Networks, Nick Szabo (1997)
2. Computer Security as the Future of Law, Mark S. Miller (1997)
https://www.youtube.com/watch?v=kOFzisF7aNw
3. Ethereum Smart Contracts (Accessed November 2019)
https://ethereum.org/developers/#smart-contract-languages
4. Bitcoin Smart Contracts (2011)
https://web.archive.org/web/20111120234507/https://en.bitcoin.it/wiki/Contracts