What is a smart contract?
1
What is a smart contract?
A smart contract (from the English “smart contract”) is a computer algorithm designed to conclude and maintain self-executing agreements carried out in a blockchain environment.
Such agreements are written as code that lives in a distributed ledger — blockchain, which is maintained and governed by a network of computers. Put simply, smart contracts let parties exchange assets without intermediaries.
2
What is special about smart contracts?
Smart contracts enable secure and private transactions without outside intermediaries such as banks or government bodies. In addition, such transactions are traceable, transparent and irreversible.
Smart contracts not only contain information on the parties’ obligations and penalties for breach; they also automatically enforce all the terms of the agreement.
3
How did smart contracts emerge?
The first ideas were proposed in 1994 by Nick Szabo. He described a smart contract as a computer protocol that, using mathematical algorithms, executes transactions autonomously with full control over their performance.
Szabo’s ideas were first realised in practice with the advent of the first cryptocurrency, bitcoin, and its underlying technology, blockchain. Some principles of smart contracts were embedded in the bitcoin protocol. However, most modern blockchains, including bitcoin, are not Turing-complete, so their “contracts” are relatively simple constructs such as multisignature or time-delayed transactions.
Widespread practical use came with the rise of Ethereum. In 2013 its future founder, Vitalik Buterin, concluded that bitcoin was ill-suited as a base protocol for smart contracts, since it had not been designed for that task. He then decided to build from scratch a protocol best suited to smart contracts.
4
How does a smart contract work, and what are its essential elements?
Typically a smart contract is recorded on a blockchain, where all its logic is placed in a software container — a block. The latter aggregates all messages related to a specific smart contract. Messages can act as the inputs and outputs of the smart contract’s code and trigger actions outside the blockchain, in the real or digital world.
Essential attributes of a smart contract:
- use of digital-signature methods based on public and private keys held by two or more parties to the agreement;
- the existence of a private decentralised environment (for example, Ethereum) in which smart contracts are recorded and which supports inputs and outputs for oracles linking the real and digital worlds;
- the subject matter of the contract and the tools required to perform it (cryptocurrency settlement accounts, oracle programs, and so on);
- precisely described conditions of execution, which the parties confirm with their signatures, as well as the reliability of the digital data source.
5
What types of smart contracts are there?
Depending on the degree of automation, smart contracts can be:
- Fully automated.
- With a paper copy.
- Primarily on paper, with some provisions translated into code (for example, when only payments are automated).
Blockchain-based solutions are still at an early stage. The technologies are being tested and refined, so truly complex smart contracts are rarely used in practice. Today the vast majority fall into the third type, where only certain aspects of agreements are automated, in particular the exchange of funds for property rights. Example: buying an apartment in Kyiv using a smart contract via the decentralised marketplace Propy (payment was in Ethereum, and the seller was located in New York).
6
Where else can smart contracts be used?
The potential uses and domains are broad — from simple multisignature to transactions with derivatives. Multisignature (multisig, escrow) is the simplest, classic example of a smart contract. It lets counterparties who do not trust each other lock a sum of coins on a blockchain so that, if needed, spending it requires signatures from more than half of the participants.
Smart contracts are widely used in initial coin offerings (ICO). For example, a smart contract can be programmed so that, by sending cryptocurrency to the project’s wallet, crowdsale participants can be sure that if the campaign fails their funds will be returned automatically; if the ICO’s funding goal is reached, the funds will be transferred to the developers. This will be done provided that a sufficient number of multisignature participants (if envisaged) activate their keys, thereby personally confirming the project’s good faith.
Among the most promising areas, many experts cite financial markets (banking services, insurance, derivatives trading), accounting and audit, supply-chain management and logistics, property-rights registration, all manner of voting, smart transport, digital identity, and so on.
7
What advantages do smart contracts have over traditional agreements?
Supporters are convinced that many types of contractual relationships can be partially or fully self-executing. The cryptography underpinning smart contracts provides a higher level of security than traditional, law-based contracts. Smart contracts can reduce transaction costs and eliminate the risks of ambiguous interpretations of terms or unfair court rulings.
Thus, the main advantages of smart contracts include:
- autonomy (to conclude and confirm a deal you do not need an intermediary such as a broker, bank, notary, and so on);
- reliability and security (a redundantly replicated contract is stored in encrypted form on the blockchain);
- the system’s security is guaranteed by mathematical laws, making hacker attacks and retroactive data tampering unlikely;
- economy and speed — thanks to blockchain, many intermediaries are removed and processes are automated;
- accuracy — automation and minimal manual work reduce the likelihood of errors that often arise when filling in forms during approvals and when carrying out manual operations under a contract.
8
Do smart contracts have drawbacks?
Smart contracts are not yet perfect: blockchain infrastructure remains underdeveloped and critical bugs do occur in code. There are still many gaps in the regulation of smart contracts, and oracle programs — meant to tie the digital world to the real one and provide input data — are immature. All this creates barriers to integrating smart contracts into the day-to-day activities of organisations and individuals.
In some cases smart contracts are less flexible than ordinary contracts. Information recorded on a blockchain cannot be changed later, so it is crucial to ensure the accuracy and reliability of the initial data and avoid errors at input.
Many banks and large corporations are ill-suited to exchanging confidential data via open distributed ledgers. Problems of scalability and transaction throughput also remain.
Many developers are working to address these and other limitations, and different platforms approach them in different ways. Progress does not stand still; in future many issues will be solved, and economic agents will move fully from drafting traditional contracts to their digital incarnations, and even to their execution with support from artificial intelligence.
Рассылки ForkLog: держите руку на пульсе биткоин-индустрии!