Introduction
Smart contracts were first described in the 1990s by Nick Szabo. He defined a smart contract as a tool that formalizes and secures computer networks by combining protocols with a user interface.
Szabo has looked at the use of smart contracts in a variety of areas, such as contractual agreements, credit systems, payment processing and content ownership.
In the world of cryptocurrencies, a smart contract is an application that runs on the blockchain. It acts as a digital agreement backed by a set of rules. These rules are determined by computer code, which is copied and processed by all nodes on the network.
Smart contracts allow you to create protocols that do not require trust. This means that both parties can interact via the blockchain without having to trust each other. Participants in the process can be sure that failure to comply with the terms of the contract will lead to its cancellation. Also, the use of smart contracts eliminates the need for intermediaries, significantly reducing transaction costs.
Although the Bitcoin protocol has supported smart contracts for many years, they owe their popularity to the creator and co-founder of Ethereum, Vitalik Buterin. Moreover, each blockchain can use its own way of implementing smart contracts.
The focus of this article is smart contracts running on the Ethereum Virtual Machine (EVM), which is a critical part of the Ethereum blockchain.
How it works?
In simple words, a smart contract works like a deterministic program. It performs certain actions when specified conditions are met. Based on this, the smart contract system often uses “if... then...” expressions. Despite the generally accepted terminology, smart contracts are neither contracts in the legal sense nor “smart”. These are just fragments of code running on a distributed system (on a blockchain).
On the Ethereum network, smart contracts are responsible for performing transactions between users (addresses). Any address that is not a smart contract is called an individual account (EOA). Thus, smart contracts are managed by program code, and personal accounts are managed by users.
Essentially, Ethereum smart contracts consist of contract code (containing execution conditions) and two public keys. The first public key is provided by the creator of the contract. The other key represents the contract itself, being a digital identifier unique to each smart contract.
The execution of any smart contract occurs during a blockchain transaction, and they can be activated when initiated by a personal account (or another smart contract). However, the sequence of smart contracts is always launched from a personal account (i.e., the user).
Main characteristics
An Ethereum smart contract often has the following characteristics:
Distribution. Smart contracts are replicated and distributed across all nodes of the Ethereum network. This is one of their main differences from other solutions that use centralized servers.
Determinism. Smart contracts perform the actions they are designed to perform when specified requirements are met. In addition, the result will always be the same regardless of who completes the requirements.
Autonomy. Smart contracts can automate all kinds of tasks, working as a self-executing program. In most cases, if a smart contract is not initiated, it is “dormant” and does not perform any actions.
Immutability. You cannot change the process of a smart contract after it has been developed and activated. Changes can only be made if the developers have previously implemented a specific feature. Thus, we can say that smart contracts can provide protection against code hacking through proof of authenticity.
Personalization. Smart contracts can be coded in several ways, for example to create different types of decentralized applications (DApps). This is because Ethereum was designed to be Turing complete.
Lack of trust. Two or more parties can interact using smart contracts, without knowing or trusting each other. In addition, blockchain technology ensures that all data is accurate and accounted for.
Transparency. Since smart contracts are based on a public blockchain, their source code is available to everyone.
Can I change or delete a smart contract?
Ethereum users cannot add new features once the smart contract is activated. However, if a developer includes a function called SELFDESTRUCT in the contract code, he can later remove it and replace it with a new one. Without this function, it will be impossible to delete the smart contract.
Notably, so-called upgradable smart contracts provide developers with access to code changes, thereby providing greater flexibility compared to immutable contracts. There are many ways to create this type of smart contracts of varying degrees of complexity.
Let's look at this with a simple example. Let's imagine that a smart contract is divided into several small contracts. Some of them cannot be changed, while others can be deleted thanks to the above-mentioned feature. This means that part of the code (a certain number of smart contracts) can be removed and replaced with another, while the remaining functionality remains unchanged.
Benefits and Use Cases
Because they are programmable code, smart contracts are highly customizable and can be developed in a variety of ways, offering different types of services and solutions.
As a decentralized and self-enforcing program, smart contracts can provide increased transparency and lower operating costs. Depending on the line of business, they can also increase efficiency and reduce bureaucratic costs.
The benefits of smart contracts are particularly evident when it comes to money transfers or the exchange of funds between two or more parties.
In other words, smart contracts can be designed to suit a wide variety of use cases, including the creation of tokenized assets, voting systems, crypto wallets, decentralized exchanges, games and mobile applications. They can also be deployed alongside other blockchain solutions in the areas of healthcare, philanthropy, supply chain, governance and decentralized finance (DeFi).
ERC-20
Tokens issued on the Ethereum blockchain comply with the ERC-20 standard, which describes their main functions. They are often called ERC-20 tokens and make up the majority of existing cryptocurrencies.
Many companies and startups are developing smart contracts to issue their own digital tokens on the Ethereum network. Once issued, most of them distribute their ERC-20 tokens through an initial coin offering (ICO). Smart contracts allow you to reliably and efficiently exchange and distribute funds.
Flaws
Smart contracts consist of computer code written by people. This causes numerous risks as the code is prone to vulnerabilities and errors. Ideally, development should be carried out by experienced programmers, especially when confidential information or large sums of money are involved.
It is believed that centralized systems can provide most of the solutions and functions of smart contracts. The main difference is that smart contracts execute on a distributed peer-to-peer P2P network rather than on a centralized server. And because smart contracts are based on the blockchain, they are usually immutable or too complex to make changes.
Sometimes immutability is useful, but not always. For example, in 2016, hackers hacked the decentralized autonomous organization The DAO and stole millions of dollars of ether (ETH) by exploiting vulnerabilities in the smart contract code.
Because The DAO's smart contract was immutable, the developers were unable to fix the code. This ultimately led to a hard fork and the emergence of a second Ethereum chain. Simply put, one chain reversed the hack and returned the funds to the rightful owners (this chain is part of the current Ethereum blockchain), while the other did not react to the hack, guided by the fact that events in the blockchain should never be changed (this chain is now called Ethereum Classic).
It should be noted that the problem did not arise due to the operation of the Ethereum blockchain. Instead, the error was caused by an incorrect implementation of the smart contract.
Another disadvantage of smart contracts is related to their uncertain legal status. This is not only due to the fact that in most countries this technology is in a “gray zone”, but also because smart contracts do not comply with their current regulatory framework.
For example, the main requirement of many agreements and contracts is the strict identification of participants and the age of 18 years. The anonymity provided by blockchain technology, coupled with the absence of intermediaries, can be a barrier to compliance with such requirements. While there are potential solutions to this issue, the legal aspects of smart contracts are a major concern, especially when it comes to global scale and distributed networks.
Criticism
Some blockchain enthusiasts see smart contracts as a solution that can replace and automate much of the existing commercial and bureaucratic systems. While this is achievable, smart contracts are far from being the norm in this area.
Smart contracts are certainly an interesting technology. But its distributed and deterministic nature, as well as its transparency and partial immutability, make it less attractive for use in some situations.
Essentially, all criticism is based on the fact that smart contracts are not a suitable solution for many real-world problems. And in fact, for some organizations it is easier and better to use conventional alternative servers.
Compared to smart contracts, centralized servers are easier and cheaper to maintain. In addition, they can also provide greater efficiency in terms of speed and interoperability with other networks.
Summary
Without a doubt, smart contracts have had a great impact on the world of cryptocurrencies and have certainly revolutionized the field of blockchain technology. Because end users may not interact directly with smart contracts, they may serve as the basis for a wide range of applications in the future, from financial services to supply chain management.
The combined potential of smart contracts and blockchain can have a significant impact on almost all areas of society. But only time will tell whether these innovative technologies can overcome barriers to widespread adoption.

