What Are Smart Contracts and How Do They Work?
What Are Smart Contracts and How Do They Work?
First proposed by computer scientist and cryptographer Nick Szabo in 1994, smart contracts are computer protocols designed to digitally facilitate and enforce the performance of a contract. Transactions made through smart contracts are credible, trackable and feasible without interference of third parties required in conventional contracts. The main idea behind the concept of smart contracts is to ‘overgrow’ the traditional contracts and their complicate procedures but as well to reduce the time and costs related to presence of third parties in making and executing a contract.
As the standard contract is based on the terms of a relationship which is usually enforced by law, a smart contract enforces a relationship with cryptographic code.
With an introduction of blockchain technologies, concept of the contract based on cryptographic code ‘came to life’, and even though not without its flaws, it shows promising future. Smart contracts are faster, cheaper and most importantly more secure than traditional contracts which is why companies, banks and governments are showing great interest in introducing and adopting this new technology into their systems.
How it all started?
Known for his research on digital currency, back in 1996, Szabo published his revolutionary article ‘Smart Contracts: Building Blocks for Digital Markets‘ in which he explained the need to establish a new kind of digital contracts to go along with a digital revolution.
Calling contract a ‘basic building block of a free market economy’ but also a traditional way for formalizing the relationship (whether it’s a private one such as marriage, or government enforced such as different agreements and treaties), Szabo highlighted the fact that digital revolution is radically changing the kinds of relationships we make and that it will surely change the concept of a legal contract as we know it.
Calling them ‘smart’ and ‘far more functional than their inanimate paper-based ancestors’, he defined the concept as ‘a set of promises, specified in digital form, including protocols within which the parties perform on these promises’ and all that without use of artificial intelligence.
He accurately predicted that computers will find a way to use algorithms to reduce or eliminate the costs related to presence of third parties in the traditional contracts. According to Szabo, smart contract would also enable both parties in the contract to observe and verify if and when a contract has been finalized by knowing only the details necessary for the parties involved which would save the time spent on policing the contract.The article, published in a 16th edition of magazine Extropy, today serves as a main source of the idea behind the concept of smart contract – digital transaction protocol that executes the terms of a contract.
Smart contracts, blockchain contracts, self-executing contracts, or digital contracts, as we can call them, nowadays offer a format which can be converted to a code and stored on the system supervised by the network of computers that run the blockchain.
How do smart contracts work?
The easiest way to describe the principle of work of smart contracts could be to compare them to the work of vending machines which follow only the instructions given to them. After performing the instructions, the contract is distributed and copied multiple times and then executed in accordance with the contract terms. Checking the implementation of the commitments is done automatically by the program.
Bitcoin, as the first decentralized digital currency, was also the first to support some smart contracts when speaking of network that can transfer value from one person to another.
Anyhow, bitcoin was and is limited to the currency use, while the Ethereum has a more complex scripting language that support a broader instructions and allows users to develop their own programs. This way developers can create apps or agreements with an additional steps such as alternative transaction formats or different ways to transfer ownership.
Ethereum, an open-source, public blockchain that features smart contract functionality and its Ethereum Virtual Machine (EVM), were designed as a platform and learning environment for smart contracts with more expressive and complete language for scripting than bitcoin.
The Ethereum Virtual Machine provides security and prevents Denial-of-service (DoS) attacks, and also ensures that programs don’t have access to each other’s state. It also ensures that communication can be established without any interference. In short, EVM is project designed as a runtime environment for Ethereum smart contracts. This promising technology enables us to automatically conduct transactions or perform other specific actions on the Ethereum blockchain.
The Ethereum Virtual Machine executes smart contracts via ‘bytecode’, which are series of ones and zeroes that can be read and interpreted by the network. Additionally, smart contracts can be written in the high-level languages such as Solidity and Serpent which are easier to read and write.
Ethereum smart contracts can manage agreements between users, provide utility to other contracts and store information about the certain application.
It is important to add that even though Ethereum has no owner, there is a supporting system for its functionality which is not free. In other words, users have to pay the resources with the unique piece of code called ether. Ether, also called a ‘crypto-fuel’ is a form of payment that clients make in order for computers to execute the requested operation.
As many questions were raised about similarity of bitcoin and ether, Ethereum inventors highlighted the fact that their technology would never be possible without bitcoin – both the technology and the currency. They called their currency as a complementary, and not competing with bitcoin, and added that ether is a token whose purpose is to pay for computation, and is not intended to be used as a currency or asset.
Along with being faster, more secure and with a lot of potential for standardization, there is also a certain level of criticism expressed in relation to smart contracts.
Some of the disadvantages of smart contracts are related to the fact that codes are made by humans and, as we all know, people make mistakes. These errors can make smart contracts vulnerable to hacking. Also, there are implementation costs necessary for programming the smart contracts, and last but not the least – question of potential legislative framework of smart contracts that lately became a matter of many discussions.