This technology was first described in the early 90s by Nick Szabo. He was the first who came up with the idea to combine software protocols and a user interface in order to formalize computer networks and make them more secure. For this, smart contracts were needed — the simplest tool that provides trust interaction. However, among the potential ways to use this method, direct work with various finances has not yet been included. It was about various business relationships such as lending, copyright, and various payment processing.
However, specialists soon appeared, who adapted smart contracts for cryptocurrencies. Now they have become a kind of digital agreement, backed up by a set of specific rules determined by the peculiarities of the network computer code and are binding on all other participants (nodes).
If we talk specifically about blockchains, then smart contracts allow you to create trusted protocols. That is, individual participants can interact with each other without knowing anything about each other or trusting. But if any element of the contract is violated, then it is automatically cancelled. It also allows you to work without intermediaries and significantly reduce operating costs.
Despite the fact that the Bitcoin system protocol has been using this technology for quite some time, it was popularized by another cryptocurrency, Ethereum. The difference is that each individual blockchain can set its own ways to implement smart contracts.
How do smart contracts work?
Simply put, a smart contract is a deterministic program that works on the simple principle of “if ... then ...”. It implies strictly defined reactions to well-defined conditions. So the name of the technology does not correspond well to its meaning since this system of interaction is neither “smart”, nor, in legal terms, a contract.
On the Ethereum network, smart contracts govern the execution of any interactions and operations between individual participants — addresses. And if some address does not use this method of interaction, then it is called an Externally Owned Account (EOA) and is controlled not by the program but by a specific user.
As part of the Ethereum system, smart contracts consist of a contract code, which determines the terms of execution, and two public keys. The first is provided by the contract creator, the second is a unique digital identifier for the address.
The execution of any such contract is automatic for every blockchain transaction, but they are launched exclusively from a personal account, i.e. not automatically but at the person’s request.
Smart contracts used in the Ethereum network meet the following characteristics:
- Distribution. It means prevalence across all nodes of the network, in contrast to those systems where the program code and protocols are stored on central servers.
- Determinism. Each “if” is followed by a strictly defined “then”. This ensures that the results are identical, regardless of who sets the conditions.
- Autonomy. This is essentially a self-executing program. As soon as the condition “if” is fulfilled, the effect of “then” is immediately satisfied. This order only. The possibility of manual initiation matters not. If the protocol is not initiated, then it will be inactive, no matter what happens.
- Invariance. When the algorithm is created and activated, it can no longer be changed. Unless, of course, this feature is not provided for in the initial development.
- Customizability. This way of interaction can be developed in different ways, so this technology can be used for so many types of decentralised networks and applications — DAPPs. In addition, it is this characteristic that is responsible for the fact that the Ethereum blockchain can be called a Turing-completed network.
- Confidence. The parties can interact without knowing anything about each other. In addition, all these interactions are taken into account and recorded.
- Transparency. The source code of this program is available to everyone.
Can smart contracts be deleted or changed?
If the SELFDESTRUCT function was attached to it when creating the program, then yes, it is possible. It allows you to delete a smart contract and replace it with a new one. Otherwise, nothing will be fixed or deleted.
But it is believed that systems equipped with this function are more reliable and functional. As an example, we can consider a system where a large smart contract is divided into several small ones, some of which are equipped with the SELFDESTRUCT function. It means that the developer will be able to delete and change some pieces of code without interfering with the functioning of the entire system.
Benefits and opportunities
Smart contracts guarantee increased transparency of the entire system and reduce operating costs. And in a number of situations, they also reduce bureaucratic costs. This is especially true when it comes to exchanges of diverse finances between two parties unfamiliar with each other.
This technology is used to create tokenized assets, to develop voting systems, to increase the reliability of cryptocurrency wallets, for more efficient operation of decentralised exchanges, and similar mobile apps. In addition, smart contracts can be adapted to work in the areas of healthcare, charity, bureaucracy, decentralised financing, and much more.
Each smart contract is a code written by a person. That’s why there is always the possibility for errors and vulnerabilities. This can be avoided by using qualified specialists and repeated checks. This is exactly what they do when it comes to particularly important information and large amounts.
Smart contracts mainly work in distributed peer-to-peer networks, which automatically robs the system of a number of functions and regulatory capabilities. In addition, making changes to such a working algorithm is either impossible or technically very difficult and costly.
The invariance, which we have already talked about, is good, but only so long as the system works stably. When hackers broke into the DAO decentralised organisation in 2016, they were able to steal Ethereum cryptocurrency worth millions of dollars without any problems. And this lasted for some time since the developers could not do anything about it. The solution was eventually found — hard fork, i.e. the division of Ethereum into two chains. One is the current blockchain that cancelled hacked blocks and returned the lost Ethereum to the owners. Another — Ethereum Classic — kept everything unchanged. What is important — it was not the work of the Ethereum blockchain but the incorrect operation of the smart contract that was vulnerable.
Also, the legal uncertainty of smart contracts can be considered a disadvantage. In the vast majority of states, they are in the “grey zone” because they do not fit into the existing legal framework. For example, under this system, minors can also carry out transactions impossible to verify since they are pseudo-anonymous and there are no intermediaries. Therefore, legalization is one of the most important problems that distributed networks in general and smart contracts in particular face with.
On the one hand, smart contracts, according to enthusiasts of this technology, can seriously simplify and automate current commercial and organisational systems. On the other hand, this method of interaction still has too many shortcomings to make it generally accepted in the real world.
Alas, centralised servers are much more suitable for solving a number of problems. They are simpler, cheaper to maintain, work more efficiently, imply the possibility of making changes, and most importantly, they interact with other networks much easier. And smart contracts have practically no interoperability, since different codes and algorithms are initially used.
Smart contracts are an extremely effective technology, especially when it comes to blockchain systems. It is possible that in the near future more and more apps that provide financial services and work with confidential information will use them. Their potential is significant, but only time knows how humanity will manage it and whether it will be accepted.