A smart contract is a computer protocol designed to conclude and maintain self-enforcing contracts which are performed in a blockchain environment. Such contracts are written in the form of code that exists in a distributed ledger — a blockchain that is maintained and managed by a network of computers. In simple words, smart contracts allow exchange of assets without mediators' services.
Smart contracts aims to provide security that is superior to traditional contract law and to reduce other transaction costs associated with contracting. These transactions are trackable and irreversible.
What are the benefits of Smart Contracts?
Smart contracts provide an opportunity to perform reliable and confidential transactions without third parties — banks or state bodies. These transactions are transparent, trackable, and irreversible. Smart contracts not only contain information on commitments of the parties and sanctions for their breach, but they automatically ensure the fulfillment of all the terms of the contract.
The best way to describe smart contracts is to compare the technology to a vending machine. Ordinarily, you would go to a lawyer or a notary, pay them, and wait while you get the document. With smart contracts, you simply drop a bitcoin into the vending machine (i.e. ledger), and your escrow, driver’s license, or whatever drops into your account.
How did the smart contracts come about?
Smart contracts were first proposed by Nick Szabo, who coined the term, in 1994. He described the smart contract as a computer protocol, which independently conducts transactions with complete control over their implementation.
The appearance of the first crypto currency Bitcoin and it's underlying blockchain technology allowed to realize Sabo's ideas. Some principles of smart contracts were at the core of the Bitcoin protocol. However, most modern blockchains, including Bitcoins, do not have Turing completeness, so their "contracts" are relatively simple constructions, such as multi-signature or deferred execution transactions.
Smart contracts are widely used in the project Ethereum, a decentralized platform that runs smart contracts. The project was bootstrapped via an ether presale in August 2014 by fans all around the world.
How does a smart contract work?
Usually a smart contract is written to the block, where all its logic is placed in the software container — the block, which combines all messages connected with particular smart contract. Messages can act as inputs/outputs of the smart contract code and lead to actions outside the blockchain, in the real and digital worlds.
What are the most important features of smart contracts?
The main features of a smart contract are the following:
use of e-signature based on public and private keys which are available to two or more parties to the agreement;
the presence of a private decentralized environment (for example, Ethereum) which records smart contracts and supports inputs/outputs for oracles, connecting the real and digital worlds;
the subject matter of a treaty and the availability of tools for its implementation (crypto currency settlement accounts, oracle programs, etc.);
a precise description of how a smart contract must be implemented which the parties to the Treaty confirm the signature;
authenticity of a digital data source
What types of smart contracts are?
Depending on the degree of automation, smart contracts fall into three categories:
fully automated smart contracts,
smart contracts with hard copies,
mostly paper smart contracts with some blockchain-based provisions (for example, when only payments are automated).
Nowadays, most smart contracts can be attributed to the third type, where only certain aspects of agreements are automated.
Where else can smart contracts be used?
The possibilities and spheres of use of smart contracts are extensive - from simple multi-signature to operations with derivative financial instruments. Multi-signature is a classic example of a smart contract. With multi-signature counterparties, who do not trust each other, can freeze a sum of coins in the blockchain in such a way that, if necessary, more than half of the participants' signatures will be required to spend this money.
Smart contracts are widely used in the field of Initial Coin Offering (ICO). For example, a smart contract can be programmed in such a way the crowdsale participants will get their money back in if the campaign fails; if the ICO's goal is achieved, the funds will be transferred to the developers. However, this will be done under the condition that a sufficient number of multi-signature participants (if it is required) activate their keys, thereby confirming honesty and fairness of the project.
The most promising field of application of smart contracts are financial sector (insurance, banking services, derivatives trading), accounting and audit, supply chain management and logistics, registration of property rights, all kinds of voting, smart transport, digital identity.
What are the advantages of smart contracts?
Supporters of smart contracts are convinced that many types of treaty relations can be partially or completely self-enforcing. Cryptography, underpinning smart contracts, provides a higher level of security than traditional law-based contracts. Smart contracts can reduce transaction costs, as well as exclude the risks of ambiguous interpretations of conditions or unfair judgements.
The main advantages of smart contracts include the following:
autonomy (there is no needs in intermediaries for transaction concluding);
security and reliability (a multiple-duplicated encrypted contract is stored in the blockchain; the security of the system is guaranteed by mathematical laws and makes hacker attacks very unlikely, as well as excludes any possibility of an retroactive substitution of data);
high speed and low costs - thanks to the blockchain many intermediaries are eliminated and processes are automatized;
precision and accuracy — automatization of processes and minimization of manual work the error rate is reduced.
What are the drawbacks of smart contracts?
Smart contracts are far from being perfect: the blockchain infrastructure is still insufficiently developed and there are fatal errors in the code itself. In addition, there are still many gaps in the legal regulation of smart contracts, the oracle programs that are designed for binding of digital and real worlds are not developed. This all complicates integration of smart contracts into the daily activities of organizations and individuals.
Moreover, in some cases, smart contracts are less flexible than low-based contracts. Blockchain data can not be changed, so it is extremely important to stick to accuracy and reliability of the original information, as well as to avoid incorrect data entry.
Many banks and corporations are not able to exchange confidential data through open distributed registries. In addition, the problems of scaling and speed of transaction processing are still relevant.
Many developers are working to address these and other issues. In the future many issues and problems will be solved, and economic agents will completely switch from traditional contracts to smart contracts.