Ethereum, smart contracts and altcoins
The EVM and gas
4 min
To run smart contracts, Ethereum needs a shared computer that every node can execute identically, and a way to stop programs from running forever or for free. Those are the EVM and gas.
The Ethereum Virtual Machine
The EVM (Ethereum Virtual Machine) is the runtime environment in which every smart contract executes. Every node runs the EVM and processes each transaction the same way, so they all reach the same result and agree on the new state. You can think of Ethereum as a single, globally shared computer that no one owns.
Because the EVM became a de facto standard, many other blockchains are EVM-compatible, meaning contracts written for Ethereum can run on them with little change.
Gas: paying for computation
Every operation a contract performs costs gas — a unit measuring computational effort. The user pays a fee, denominated in ETH, calculated from the gas an action uses multiplied by a price per unit of gas.
Gas serves two purposes:
- It compensates validators for the work of executing and storing the transaction.
- It prevents abuse: an infinite loop would simply run out of gas and halt, and spamming the network costs real money.
Why gas fees fluctuate
When many people want to transact at once, they bid higher gas prices to get included sooner, so fees rise with demand and can become very high during congestion. This cost is a major reason layer-2 networks (covered shortly) exist — to move activity off the expensive base layer.
This content is for educational and informational purposes only and is not investment, financial, tax or legal advice. Trading and investing carry risk, including the possible loss of capital. Any performance shown by third-party tools is hypothetical and not a promise of future results. Do your own research and consider professional advice before making any decision.