Smart contracts turn code into law

Why would anyone want smart contracts? Because they allow significantly reduce the probability of fraud and enforcement costs in many commercial transactions.

Nick Szabo, Mark Miller, and Lawrence Lessig have explored to what extent can law be mechanized and proposed that software code can provide a reliable platform for legal rules. Here I focus mainly on the viewpoint of Nick Szabo since his clear vision and explanations strongly shaped the way smart contracts are implemented on Ethereum and Bitcoin blockchains.

Building blocks

In the broadest sense, contracts define relationships between people and organizations. A contract is the basic building block of a free market economy, that governs mutual rights and obligations among its parties. As technology advances, many of these formalized relationships can be automated with new types of contracts based on public blockchains. These new types of contracts, strongly embedded in computer code, are way more functional than their paper-based ancestors, so we call them smart contracts.

Code as law

A smart contract is a computerized transaction protocol that automatically executes the terms of an agreement. The general objectives of smart contract are:

Advanced cryptography, standing at a foundation of a blockchain, allows for radically enhanced security on public networks. At the current state of technology, we can secure contracts through computer science, rather than by the expensive labor of accountants, police, and lawyers. Contract law, like other areas of private law, varies by jurisdiction, and smart contracts can exceed borders by transforming a manual system that is local into one that is automated and global.

A digital code of smart contracts can augment or even replace the functions of the traditional legal system and can be applied to almost any law that is traditionally settled in a private lawsuit, rather than by a criminal prosecution.

Smart contracts have the potential to replace lawyers, politicians, and violent enforcement in many business and social interactions. They can also be used to create entirely new free-market institutions. The opportunities for creating new kinds of organizations based on smart contracts are vast, but we are currently at a very early stage in exploring the possibilities they are opening ahead of us.

Computer security is the future of law.
– Mark Miller

The melody of the present

Because of its automated execution, a smart contract is far more functional than its paper-based ancestors and can be successfully applied in software-driven areas, such as the Internet.

Vending machines are the most common example of a primitive smart contract, that we already know from everyday life. A vending machine is a contract with a bearer: anybody with coins can participate in an exchange with the vendor. The lockbox and other security mechanisms protect the stored coins and contents from attackers, sufficiently to make vending machines profitable.

Photo by Thom on UnsplashA vending machine is strongly embedded in the physical world, but instead of the machine itself, the touch screen of your smartphone can display any user interface, and interaction with the handheld device can seamlessly execute a smart contract operating on a blockchain.

Smart properties might be created by embedding smart contracts in physical objects. The right to use or access the property can be regulated by a smart contract. The easiest to imagine is a transaction of renting a car or an apartment. A set of sensors in combination with automatic locks can guard access to the property, or depending on the contract, to its parts or individual functions. When the rental period expires, access will be automatically revoked, fully transferring the right to use the property to its rightful owner. An example could be a sauna in a rented apartment, or a massage chair feature in a rented car.

Digital cash protocols are another more sophisticated example of smart contracts. Cryptocurrency doesn’t require trusted intermediaries to transfer value precisely and without unnecessary delay. This is achieved by reducing trust in favor of strong cryptography.

Carving in stone

Irreversibility is a huge advantage of smart contracts, but can also carry a risk because once a smart contract is deployed to a public blockchain it can’t be altered in any way. Like blockchain itself, the smart contract becomes immutable, which basically means it gets “carved in stone”.

Law lowers vulnerability to violence, theft, and fraud. Smart contracts can further reduce this vulnerability by levels of magnitude.