Ethereum Basics
Ethereum expanded blockchain from a payment network to a world computer. Understanding Ethereum is essential because Solana borrows many concepts while making different architectural choices.
The Vision: A World Computer
Bitcoin's Script is intentionally limited. Vitalik Buterin asked: what if we made a blockchain with a Turing-complete programming language?
The result was Ethereum—a blockchain that can run arbitrary programs called smart contracts.
Ethereum's Account Model
Unlike Bitcoin's UTXOs, Ethereum uses an account-based model:
Externally Owned Accounts (EOAs)
Regular user accounts controlled by private keys:
Contract Accounts
Accounts controlled by code:
Comparison with Bitcoin
Smart Contracts
A smart contract is code stored on the blockchain that executes when called.
Simple Example: Counter
How Contracts Execute
- User sends transaction calling
increment() - Transaction included in block
- Every node executes the function
- State change (
count += 1) recorded - New state becomes part of blockchain
The Ethereum Virtual Machine (EVM)
The EVM is a stack-based virtual machine that executes smart contract bytecode.
EVM Architecture
EVM Opcodes
Execution Example
Gas: Ethereum's Resource Model
Every operation costs gas. Gas serves multiple purposes:
- Prevents infinite loops: Transactions have a gas limit
- Prices computation: More complex operations cost more
- Creates fee market: Users compete for block space
Gas Costs
Transaction Fees
Solidity Deep Dive
Solidity is Ethereum's primary smart contract language.
Data Types
Functions and Visibility
Events
Events allow contracts to log information efficiently:
Events are:
- Cheap (only ~375 gas + data)
- Indexed (searchable by indexed parameters)
- Not accessible by contracts (only external applications)
Complete Example: ERC-20 Token
Ethereum vs Solana: Key Differences
Understanding Ethereum helps you appreciate Solana's design choices:
| Aspect | Ethereum | Solana |
|---|---|---|
| Account Model | Contracts have code + storage | Programs are stateless, data in separate accounts |
| Execution | Sequential (single-threaded) | Parallel (Sealevel runtime) |
| State | Stored in contract | Stored in accounts passed to programs |
| Gas | Dynamic pricing (EIP-1559) | Fixed fee + compute units |
| Block Time | ~12 seconds | ~400ms |
| Throughput | ~30 TPS | ~65,000 TPS (theoretical) |
| Language | Solidity (custom) | Rust (general purpose) |
| VM | EVM (stack-based) | BPF (register-based) |
Why Solana Made Different Choices
Sequential Execution Problem:
Solana's Solution:
Stateless Programs:
Common Misconceptions
"Ethereum is too slow"
Layer 2 solutions (Optimism, Arbitrum, zkSync) process thousands of TPS while inheriting Ethereum's security.
"Gas fees are always high"
Fees vary with network demand. During low activity, transactions cost pennies. High fees during congestion indicate demand, not a flaw.
"Smart contracts are immutable"
While deployed code can't be changed, proxy patterns allow upgradeable contracts. This is both a feature and a risk.
Key Takeaways
- Ethereum = blockchain + Turing-complete smart contracts
- Account model differs from Bitcoin's UTXOs
- Gas prevents abuse and creates a fee market
- EVM executes bytecode deterministically across all nodes
- Solana made different trade-offs for higher throughput
Try It Yourself
-
Read a contract: Go to Etherscan, find the USDC contract, and read its verified source code.
-
Trace a transaction: Find a recent Uniswap swap on Etherscan and trace the internal calls.
-
Calculate gas: If a transaction uses 150,000 gas at 30 gwei, what's the fee in ETH?
-
Compare fees: Check current gas prices on ETH Gas Station and Solana Explorer. How do they compare?
Next: Blocks & Transactions - Understanding the fundamental data structures of blockchains.