A smart contract is a computer algorithm designed to conclude and maintain self-executing contracts executed in the blockchain environment.
Such contracts are written as code that exists in a distributed ledger — a blockchain that is maintained and managed by a network of computers. In simple terms, smart contracts allow the exchange of assets without resorting to intermediaries.
What is the trick of smart contracts?
Smart contracts make it possible to carry out reliable and confidential transactions without the involvement of external intermediaries such as banks or government agencies. Moreover, such transactions are traceable, transparent, and irreversible.
Smart contracts not only contain information about the obligations of the parties and sanctions for their violation, but they themselves automatically ensure the fulfillment of all the terms of the contract.
How did smart contracts come about?
The first smart contract idea was 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.
For the first time, Szabo’s ideas were put into practice with the emergence of the first cryptocurrency bitcoin and the blockchain technology underlying it. Some of the principles of smart contracts were laid down 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 deferred transactions.
Smart contracts were widely used in practice with the emergence and development of the Ethereum project. In 2013, its future founder, Vitalik Buterin, concluded that bitcoin is poorly suited as a basic protocol for smart contracts since it was not originally designed for this task. Subsequently, Buterin decided to create the most suitable protocol for smart contracts from scratch.
How do smart contracts work and what are its mandatory elements?
Usually, a smart contract is written to the blockchain, where all its logic is placed in a software container — a block. The latter combines all messages related to a specific smart contract. Messages can act as inputs and outputs of the program code of a smart contract and lead to any actions outside the blockchain, in the real or digital world.
Mandatory attributes of a smart contract:
- using electronic signature methods based on public and private keys held by two or more parties to the agreement;
- the presence of a private decentralized environment (for example, Ethereum), in which smart contracts are recorded and which supports inputs and outputs for oracles that provide communication between the real and the digital world;
- the subject of the contract itself and the availability of tools necessary for its execution (cryptocurrency settlement accounts, oracle programs, etc.);
- precisely described conditions for its execution, which the parties to the agreement confirm with a signature, as well as the reliability of the source of digital data.
What are smart contracts?
Depending on the degree of automation, smart contracts can be:
- Fully automated.
- With a copy on paper.
- Mostly on paper, with some of the provisions transferred to the program code (for example, when only payments are automated).
Blockchain solutions are only at an early stage of development. Technologies are being tested and refined, so in practice, truly complex smart contracts are not yet used. Today, the vast majority of smart contracts are of 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 through the Propy decentralized marketplace (payment was made in Ethereum, and the seller was geographically located in New York).
Where else can smart contracts be used?
The potential and uses of smart contracts are vast — from simple multisignature to transactions with financial derivatives. Multi-signature (multi-sig, escrow) is the simplest, classic example of a smart contract. With its help, counterparties who do not trust each other can freeze a certain amount of coins in the blockchain in such a way that, if it is necessary to spend this amount, signatures of more than half of the participants will be required.
Smart contracts are widely used in the Initial Coin Offering (ICO) space. For example, a smart contract can be programmed in such a way that by sending cryptocurrency to a project wallet, crowd sale 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 multisignature participants (if provided) activate their keys, thereby personally confirming the bona fides of the project.
Many experts include the financial market (banking, insurance, derivatives trading), accounting and auditing, supply chain management and logistics, registration of property rights, all kinds of voting, smart transport, digital identity, etc., to the most promising areas of application of smart contracts. etc.
What are the advantages of smart contracts over traditional contracts?
Proponents of smart contracts are convinced that many types of contractual relationships can be partially or completely self-enforcing. The underlying cryptography of smart contracts provides a higher level of security than traditional law-based contracts. Smart contracts can reduce transaction costs and also eliminate the risk of ambiguous terms or unfair court decisions.
Thus, among the main advantages of smart contracts are:
- autonomy (to conclude and confirm a transaction, you do not need to look for an intermediary in the person of a broker, bank, notary, etc.);
- reliability and security (a multiple duplicated contract is stored in encrypted form in the blockchain;
- system security is guaranteed by mathematical laws and makes hacker attacks unlikely, as well as retroactive substitution of information);
- economy and speed — thanks to the blockchain, many intermediaries are eliminated and processes are automated;
- accuracy — due to automation and minimization of manual work, the likelihood of errors that often appear when filling out forms during the approval process, and the manual execution of various contract operations is reduced.
Do smart contracts have drawbacks?
Smart contracts are still far from perfect: the blockchain infrastructure is still underdeveloped and there are critical errors in the code itself. Also, there are still many gaps in the regulatory legal regulation of smart contracts, oracular programs designed to ensure the connection of the digital world to the real world and provide contracts with input data for their execution are undeveloped. All this creates certain obstacles for the integration of smart contracts into the daily activities of organizations and individuals.
In some cases, smart contracts are less flexible than regular contracts. The information that gets into the blockchain cannot be changed in the future, therefore it is extremely important to maintain the accuracy and reliability of the initial information, as well as to avoid errors when entering data.
Also, many banks and large corporations are not suitable for the exchange of confidential data through open distributed ledgers. Also, the issues of scaling and transaction processing speed are still relevant.
Many developers are working to solve these and other problems and limitations, and they are solved differently within different platforms. Progress does not stand still, and in the future, many issues and problems will be resolved, and economic agents will completely switch from drafting traditional contracts to their digital implementation and even to their implementation with the support of artificial intelligence.