Lesson 4 of 9

Ethereum and smart contracts

Step 2 of 6

The idea

A shared computer

Ethereum is a blockchain where an entry can be "run this code" as well as "move this money". Every node runs the same code on the same inputs and must get the same result, so everyone agrees on the outcome.

A smart contract is a program stored on the blockchain at its own address (its account number on the chain; lesson 05 covers addresses properly). Anyone can call it. It does exactly what its code says. ethereum.org's favourite picture is a vending machine: put in the right input, get the promised output, no shop assistant needed.

Where the analogy stops: a vending machine's owner can open it and fix a jam. Many contracts can't be changed once deployed, so a bug can't be fixed. Others can be changed by whoever holds an admin key (a secret that lets its holder change the contract; keys are lesson 05), which means you are trusting that person. "Smart" also doesn't mean clever: the contract can't check facts about the outside world unless someone feeds them in.

Gas: paying for computation

Every operation a contract performs has a fixed cost in units called gas. A plain ETH transfer uses 21,000 gas; complicated contract calls use far more.

You pay for gas in ETH, Ethereum's own coin, priced in gwei (one billionth of an ETH). Since 2021 the price per unit has two parts:

  • a base fee, set by the network from how full recent blocks were, which is burned (destroyed);
  • a priority fee (tip) you add, which goes to the validator (lesson 03).
fee = gas used × (base fee + priority fee)

Gas stops anyone from jamming the shared computer with an endless program for free. Module 13 looks at what the burn does to ETH's supply.

Coins and tokens

  • A coin is the asset a blockchain itself tracks and pays fees in: BTC on Bitcoin, ETH on Ethereum.
  • A token is an asset created by a smart contract running on a blockchain. The contract keeps its own little ledger of who holds how many.
  • ERC-20 is the standard set of functions a token contract offers (check a balance, send, approve), so every wallet (the app that holds your keys, lesson 05) and every other app can handle any ERC-20 token the same way.

Anyone can create a token in minutes; existing on Ethereum says nothing about its worth.

Upgrades

Ethereum changes its rules through scheduled upgrades. The next one, Glamsterdam, had no date as of 20 Nov 2026: on 6 Nov its developers decided to wait until problems found in testing are fixed. Check the Ethereum Foundation blog before quoting any upgrade date.