Think of a vending machine: put in the right amount of money and make your choice, and the product drops without any need for a seller. Computer scientist and legal scholar Nick Szabo used this analogy in the 1990s to define the “smart contract”: programs that express the terms of an agreement between parties in code and execute automatically when the conditions are met. The idea became practical with blockchain technology.
Ethereum’s role
Bitcoin was designed mainly for transferring value. Ethereum, proposed in a white paper published by Vitalik Buterin in 2013 and launched in 2015, was designed as a blockchain on which any kind of program could run. On Ethereum, smart contracts are deployed to the network for anyone to see and are executed identically by thousands of computers. Transaction fees are called “gas” and are paid in the network’s native currency, Ether (ETH). In September 2022, with an update called “The Merge”, Ethereum switched from proof of work to proof of stake, which uses far less energy.
Uses
- Decentralised finance (DeFi): Lending, borrowing and swapping without an intermediary.
- Stablecoins and tokens: Creating new digital assets.
- NFTs: Ownership records of digital works and collectibles.
- Supply chains and certificates: Experiments in areas that need tamper-proof records.
The DAO incident and the “code is law” debate
In 2016 a project called “The DAO”, built on Ethereum and raising a large amount of ETH from investors, was attacked through a flaw in its smart contract and a significant share of the funds was drained. The community decided to fork the blockchain to reverse the losses; those who opposed it continued the old chain as “Ethereum Classic”. The incident showed the limits of the “code is law” view and the importance of smart contract security.
Risks
- Code bugs: A bug in a deployed contract usually cannot be fixed, and attackers can exploit flaws to drain funds.
- Lack of audits: Projects without an independent security audit are riskier, and an audit is not a full guarantee either.
- Legal uncertainty: The legal enforceability of smart contracts and dispute resolution vary from country to country.
- User errors: Assets sent to the wrong address or transactions approved without reading cannot be reversed.
Gas fees: the cost of running a smart contract
Running a smart contract on Ethereum is not free. Each transaction is priced in units of "gas", measured according to the amount of computation the network performs, and the fee is paid in ether, the network's own cryptocurrency. This system both rewards validators and prevents the network from being clogged by infinite loops or unnecessary transactions.
- Network congestion: When demand rises, fees go up; a complex contract transaction can cost far more than a simple transfer.
- Failed transaction: Even if a transaction fails, the fee for the computation used up to that point is usually not refunded.
- The 2021 change: With the London upgrade in August 2021 (EIP-1559), the base part of the fee began to be burned and fee estimation became more predictable.
With "The Merge" in September 2022, Ethereum moved from proof of work to proof of stake; according to the Ethereum Foundation, this transition cut the network's energy consumption by about 99.95 percent.
The oracle problem: how is off-chain information reached?
Smart contracts can directly see only the data inside the blockchain. Yet an insurance contract needs the weather, and a lending application needs currency or asset prices. The services that bring this external information onto the chain are called "oracles".
Oracles are one of the most sensitive points of smart contracts: even if a contract is written flawlessly, it makes the wrong decision if it receives wrong data. In the past, attackers succeeded in draining funds from protocols that took prices from a single source by briefly manipulating the price. That is why reliable projects prefer decentralised oracle networks that combine several independent data sources.
This article is for general information and is not investment advice. Crypto assets are very high risk and you can lose your entire investment. Consult a licensed professional and check the regulations in your country before deciding.
Frequently asked questions
Are smart contracts really “smart”?
No, the name is misleading. Smart contracts are simply programs that automatically apply the conditions they are written with; they cannot make decisions on their own and don’t capture all the nuances of legal contracts.
Sources and further reading
- Ethereum Foundation, ethereum.org “Introduction to smart contracts” and “The Merge”.
- Vitalik Buterin, “Ethereum Whitepaper” (2013).
- Nick Szabo, “Formalizing and Securing Relationships on Public Networks”, First Monday, 1997.
- ethereum.org – Gas and fees
- ethereum.org – Oracles
Leave a comment
Your email address will not be published. Required fields are marked *