Ethereum
How a blockchain can run programs, not just record payments: accounts, a shared state, a virtual machine, fees measured in gas, and validators who stake ether.
In 30 seconds
Ethereum is a blockchain that runs programs. Besides ordinary user accounts it has contract accounts: code with its own storage that lives on the chain.
A transaction can send ether or call a contract. Every node runs the call on the same simple machine, the EVM, so all arrive at the same new state.
Each instruction costs gas, paid in ether, which rations a computer that thousands share. Since 2022 blocks are proposed by validators who lock up ether as a stake, not by miners. Bugs, fees and limited capacity are the main costs.
Ethereum, step by step
Simplified: the instruction list is shortened and the 20 gwei gas price is an assumed round number, not a market figure. This explains the mechanism; it is not advice to buy or use anything.
- Step 1: A chain that runs programs. Bitcoin’s blocks record payments. Ethereum, launched in 2015, keeps the same kind of shared chain but lets its blocks also carry calls to programs stored on the chain itself, called smart contracts. Every node runs those programs and must reach the same result.
- Step 2: Two kinds of account. Ethereum tracks accounts rather than coins. A user account is controlled by a private key and has a balance of ether. A contract account is controlled by its code, and also has storage: here a single number, count. Only a key-holder can start a transaction; a contract runs only when called.
- Step 3: One shared state. The state is the full table of every account: balances, code and storage. A transaction is a signed request to change it. Alice sends Bob 1 ether: her balance drops by 1 plus a fee, his rises by 1. Every node applies the same transactions in the same order, so all copies of the state agree.
- Step 4: The virtual machine. Alice now calls increment(). Each node runs the contract’s code on the Ethereum Virtual Machine, a simple stack computer that executes one small instruction at a time. It reads count, adds 1 and writes 8 back. The EVM is defined exactly, so every node computes the same new state.
- Step 5: Ether and gas. Each instruction costs a fixed amount of gas, and the sender pays for it in ether. A plain transfer is always 21,000 gas; at an assumed 20 gwei per gas that is 0.00042 ETH. A gas limit caps the work, so a looping program just runs out. The base fee is destroyed; the tip goes to the validator.
- Step 6: Proof of stake. Since September 2022 Ethereum has no miners. Validators lock up at least 32 ether as a stake. Every 12 seconds one is picked at random to propose a block, and others vote on it. Once votes from two thirds of all stake build up, about 13 minutes later, the block is final. A validator caught cheating loses part of its stake.
- Step 7: Limits and risks. Running programs on thousands of machines is slow and costly, so fees climb when the chain is busy and much activity moves to separate “layer 2” networks. A deployed contract is public and hard to change: bugs have been exploited for large sums. Ether’s price is volatile, and mistakes cannot be reversed.
Try it yourself
Learn this first
Learn next
- DeFi (decentralized finance)Lending and trading run by smart contracts: collateral, liquidation, yield and risk. Intermediate
- Automated market makers and liquidity poolsA pool of two tokens sets its own price: one swap, slippage, fees and impermanent loss. Intermediate
- DAOsAn organisation run by token votes and code, and where that idea falls short. Beginner
Spotted a mistake on this page?