How Ethereum Works: Smart Contracts, the EVM and Gas
In the last lesson we said Ethereum is a 'world computer'. This one lifts the bonnet. We'll explain the moving parts in plain English — smart contracts, the EVM, gas, and how thousands of strangers agree on what's true — so the rest of the course makes sense. You don't need any coding background; if you can picture a vending machine and a shared spreadsheet, you already have the two ideas that matter most.
The 20-second version
Ethereum runs programs called smart contracts on a shared virtual machine (the EVM). Every action costs a small fee, paid in ETH, called gas. Thousands of validators agree on the results using proof-of-stake.
A computer everyone shares
Start with how a blockchain works: a public ledger copied across thousands of computers, with new entries bundled into 'blocks' and chained together. Ethereum takes that idea and adds one big twist — those entries can be code, not just payments. So instead of only recording 'Alice sent Bob 1 ETH', the network can record 'run this program, with these inputs, and update everyone's records with the result'. That single change is what turns a payment ledger into a programmable platform.
Every computer in the network runs the same software and reaches the same result, so the whole thing behaves like a single shared machine. Picture thousands of people all working the same maths problem by hand: as long as they follow the same rules, they all get the same answer, and you don't need to trust any single one of them — you can trust the agreement between them. Nobody can secretly change the rules, because everyone else would notice their copy no longer matches. And the network keeps running even if a big chunk of those computers go offline, because the rest still hold the same records.
Smart contracts
A smart contract is a program stored on Ethereum that runs exactly as written. The classic analogy is a vending machine: put in the right coins, press the button, and it automatically gives you the snack — no shopkeeper, no haggling, no chance for it to change its mind because it's having a bad day. A smart contract is the same idea for digital actions. Send it the right input and it produces the agreed output, every single time, with no middleman to trust and no opening hours.
- They're public — anyone can read the code and see exactly what it does before they use it. In theory, you never have to take a project's word for anything; the behaviour is right there to inspect.
- They're automatic — once deployed, they run on their own whenever someone interacts with them. There's no office that opens at 9am and no staff to call in sick.
- They're immutable — most can't be changed after launch. That's powerful, because no one can quietly rewrite the rules on you. It's also unforgiving: a bug is permanent too, and there's no patch on Tuesday to fix it.
Code is law — including the mistakes
Because contracts run exactly as written, a flaw can be exploited and funds lost with no one able to reverse it. Plenty of money has been stolen through buggy or malicious contracts. 'Audited' helps but is not a guarantee. Treat unfamiliar apps with real caution.
The EVM: Ethereum's engine
All those smart contracts run inside the Ethereum Virtual Machine (EVM) — a standard environment that every computer on the network reproduces identically. You can picture the EVM as the engine under the bonnet: it executes contract code step by step and updates everyone's copy of the ledger in lockstep. Because the engine is the same everywhere, the same contract behaves the same way on every machine. That sounds like a small technical detail, but it's the thing that lets thousands of strangers agree on the outcome — there's only ever one right answer to 'what did this contract do?'.
The EVM matters beyond Ethereum itself. Many other networks are 'EVM-compatible', meaning apps and tools written for Ethereum can run on them with little or no change. It's a bit like how a standard plug socket means any kettle works in any house. That's why a wallet like MetaMask can connect to lots of different chains, and it's a big theme in layer-1 vs layer-2. In effect, the EVM has quietly become a shared standard that a whole industry is built around — which is part of why Ethereum's influence reaches well past its own network.
Gas: paying for computation
Running code on a shared computer isn't free — and that's deliberate. If it were free, people would clog the network with junk and nobody could get anything done, the way a free, unlimited motorway would jam solid by lunchtime. So every operation costs gas, a fee paid in ETH that compensates the network and rations its limited capacity. A simple transfer is cheap; a complex DeFi interaction, which asks the network to do far more work, costs more. The more work you ask for, the more you pay — which is exactly the point.
| Action | Roughly how much gas |
|---|---|
| Sending ETH | Low |
| Sending a token | Moderate |
| A DeFi swap or NFT mint | Higher |
Fees also rise when the network is busy and fall when it's quiet, a bit like surge pricing on a ride app or a busy car park charging more at peak times. That's why the same action can cost wildly different amounts depending on when you do it. We unpack the whole thing — and the practical ways to pay less — in Ethereum gas fees explained later in this course, so don't worry if it feels fuzzy right now.
How the network agrees: proof-of-stake
For everyone to trust the shared ledger, the network needs a way to agree on what's true — which transactions happened, and in what order. Ethereum uses proof-of-stake. Participants called validators lock up ETH as a security deposit and take turns proposing and checking new blocks. Their staked ETH is, in effect, a bond that says 'I'll play by the rules' — and which they stand to lose if they don't.
- Validators who behave honestly earn small, steady rewards for their work — a wage for keeping the lights on.
- Validators who cheat or go badly offline can have part of their stake taken away — this is called 'slashing'. The threat alone keeps most people in line.
- That balance makes attacking the network expensive and pointless: it costs more to cheat than you could ever realistically gain, so honesty is simply the better deal. Good security design makes the right thing also the profitable thing.
Ethereum used to secure itself with mining, like Bitcoin, but switched to proof-of-stake, which uses a tiny fraction of the energy — one of the biggest changes in its history. You don't need to run a validator yourself to take part; many people stake indirectly, which we cover in Ethereum staking. That's the engine room. Next up, though, the practical stuff everyone actually wants: how to buy Ethereum.
Key takeaways
- Ethereum behaves like one shared computer running on thousands of machines.
- Smart contracts are public, automatic programs that run exactly as written — bugs included.
- The EVM is the engine that executes contracts identically everywhere.
- Every action costs gas (paid in ETH), and proof-of-stake keeps the network secure.
Frequently asked questions
What is a smart contract in simple terms?
A program on Ethereum that runs automatically and exactly as written — like a vending machine for digital actions, with no middleman needed and no ability to change its mind.
Why do I have to pay gas?
Gas is the fee for using shared computing power. It rewards the network and stops people flooding it with junk. See gas fees explained for the detail.
Is Ethereum still mined like Bitcoin?
No. Ethereum switched from mining to proof-of-stake, where validators secure the network by staking ETH rather than burning electricity — using a tiny fraction of the energy.
Keep reading
What Is Ethereum? A Plain-English Guide
A beginner-friendly explanation of Ethereum: what it is, how it differs from Bitcoin, what smart contracts do,
Ethereum Gas Fees Explained
What gas fees are, why they exist, what makes them rise and fall, and practical ways to pay less when using Et
Ethereum Staking Explained
How Ethereum staking works, the main ways to take part, the real risks involved, and why staking rewards are n