What is a smart contract?
A smart contract is a computer algorithm designed to enter into and maintain self-executing contracts executed in a blockchain environment.
Such contracts are written as code that exists in a distributed registry, a blockchain, which is maintained and managed by a network of computers. In simple terms, smart contracts allow the exchange of assets without the need for intermediaries.
What’s the trick to smart contracts?
Smart contracts enable secure and confidential transactions without the involvement of external intermediaries such as banks or government agencies. In addition, such transactions are traceable, transparent and irreversible.
Not only do smart contracts contain information about the parties’ obligations and penalties for their violation, but they themselves automatically enforce all the terms of the contract.
How did smart contracts come about?
The first ideas for smart contracts were proposed in 1994 by Nick Szabo. He described a smart contract as a computer protocol that, based on mathematical algorithms, independently conducts transactions with full control over their execution.
Sabo’s ideas were first put into practice with the emergence of the first cryptocurrency, bitcoin, and its underlying blockchain technology. Some of the principles of smart contracts were embedded in the bitcoin protocol. However, most modern blockchains, including bitcoin, lack Turing completeness, so their “contracts” are relatively simple constructs, such as multisignatures or delayed execution transactions.
Smart contracts gained widespread practical application with the emergence and development of the Ethereum project. In 2013, its future founder Vitalik Buterin came to the conclusion that bitcoin was ill-suited as a basic protocol for smart contracts, because it was not originally designed for this task. Later, Buterin decided to create from scratch the most suitable protocol for smart contracts.
How does a smart contract work and what are its mandatory elements?
Typically, a smart contract is written in a blockchain, where all of its logic is placed in a software container – a block. The latter combines all the messages related to a particular smart contract. Messages can act as inputs and outputs of the smart contract’s programming code and lead to some action outside the blockchain, in the real or digital world.
Mandatory attributes of a smart contract:
- The use of electronic signature methods based on public and private keys held by two or more parties to the agreement;
- The existence of a private, decentralized environment (e.g., Ethereum) into which smart contracts are written and which supports the inputs and outputs for oracles that connect the real and digital worlds;
- The subject matter of the contract itself and the availability of the tools necessary for its execution (cryptocurrency settlement accounts, oracle programs, etc.);
- the precisely described terms of its execution, which the parties to the contract confirm by signature, as well as the authenticity of the source of digital data.
What are smart contracts?
Depending on the degree of automation, smart contracts can be:
- Fully automated.
- With a hard copy.
- Predominantly paper-based, with part of the provisions transferred to software code (e.g., when only payments are automated).
Blockchain-based solutions are only at an early stage of development. The technology is being tested and refined, so no truly sophisticated smart contracts are in practice yet. To date, the vast majority of smart contracts are of the third type, where only certain aspects of the agreement are automated, such as the exchange of money for property rights. Example: the purchase of an apartment in Kiev using a smart contract through the decentralized Propy marketplace (the payment was made in Ethereum, and the seller was located in New York).
Where else can smart contracts be used?
The potential opportunities and uses of smart contracts are vast – from simple multisignature to derivative transactions. Multisignature (multisig, escrow) is the simplest, classic example of a smart contract. It allows untrusted counterparties to freeze a certain amount of coins in the blockchain so that more than half of the participants’ signatures are required if that amount is to be spent.
Smart contracts are widely used in initial coin offerings(ICOs). For example, a smart contract can be programmed in such a way that by sending cryptocurrency to the project’s wallet, the crowdsale participants will be sure that if the campaign fails, their funds will be automatically returned; if the financial goal of the ICO is achieved, then the funds will be transferred to the developers. However, this will be done on the condition that a sufficient number of multisignatories (if any) activate their keys, thereby personally confirming the bona fides of the project.
Many experts believe that the most promising areas of smart contracts application are the financial market (banking, insurance, derivatives trading), accounting and auditing, supply chain management and logistics, property rights registration, all kinds of voting, smart transport, digital identity, etc.
What advantages do smart contracts have over traditional contracts?
Proponents of smart contracts believe that many types of contractual relationships can be partially or fully self-executing. The cryptography underlying smart contracts provides a higher level of security than traditional contracts based on law. Smart contracts can reduce transaction costs as well as eliminate the risks of ambiguous interpretations of terms or unfair court decisions.
Thus, among the main advantages of smart contracts are:
- autonomy (no need to look for an intermediary in the form of a broker, bank, notary, etc. to conclude and confirm the transaction);
- reliability and security (the repeatedly duplicated contract is stored in an encrypted form in the blockchain);
- the security of the system is guaranteed by mathematical laws and makes hacker attacks and information substitution unlikely;
- economy and speed – blockchain eliminates many intermediaries and automates processes;
- accuracy – by automating and minimizing manual work, it reduces the likelihood of errors that often occur when filling out forms during the approval process and manually conducting various contract transactions.
Do smart contracts have disadvantages?
Smart contracts are still far from perfect: the blockchain infrastructure is still underdeveloped and there are critical errors in the code itself. In addition, there are still many gaps in the regulatory framework for smart contracts, and oracle programs designed to link the digital world to the real world and provide contracts with input for their execution are underdeveloped. All of this creates certain obstacles to the integration of smart contracts into the day-to-day operations of organizations and individuals.
In some cases, smart contracts are less flexible than traditional contracts. The information that enters the blockchain cannot be changed later, so it is critical to keep the source information accurate and reliable, and to avoid data entry errors.
In addition, many banks and large corporations are not comfortable sharing sensitive data via open, distributed registries. The problems of scaling and transaction processing speed are also still relevant.
There are many developers focused on solving these and other problems and limitations, and they are solved differently in different platforms. Progress does not stand still, and in the future many issues and problems will be solved, and economic agents will completely move from drawing up traditional contracts to their digital embodiment and even to their implementation with the support of artificial intelligence.