Ethereum & Smart Contracts – FIN451
Programmable blockchain, gas & fees (EIP‑1559), tokens, DeFi, rollups, risks, and hands‑on tools.
1) Ethereum in 90 seconds
What it is
- Programmable blockchain (2015) that runs smart contracts.
- Native currency: ETH for gas, staking, and value transfer.
- Consensus: Proof‑of‑Stake since the Merge (2022).
Why it matters
- General‑purpose computation → tokens, DEXes, lending, NFTs.
- Composability: protocols snap together like “money LEGOs.”
2) Accounts & Transactions
Two account types
- EOA: externally owned (your private key).
- Contract: code‑controlled; no private key.
noncevaluedatagas limitmaxFee/maxPriority
3) Gas, EIP‑1559 & Fees
Gas pricing (intuition)
- Each opcode costs gas.
- You bid with maxFee and a tip (maxPriorityFee).
- Pay:
gasUsed × (baseFee + tip)
.
Base fee burn
The base fee adjusts block‑by‑block and is burned; only the tip goes to the validator. Wallets auto‑estimate sane values.
Class tip: Check a block explorer’s pending base fee before demos.
4) Smart Contracts & Tokens
5) DeFi Building Blocks
6) Layer 2 Rollups
7) Major Upgrades & Forks
Upgrade | What changed |
---|---|
DAO split (2016) | Ethereum ↔ Ethereum Classic after recovery fork. |
London / EIP‑1559 (2021) | Base fee burn; fee market redesign. |
Merge (2022) | PoW → PoS transition. |
Shanghai/Capella (2023) | Validator withdrawals enabled. |
8) Security & Wallet Hygiene
Personal safety
- Hardware wallet for savings; hot wallet for daily use.
- Review on‑device; avoid blind approvals.
- Back up seed (+ optional passphrase) offline.
Common pitfalls
- Malicious approvals, phishing, fake airdrops.
- Protocol risks: reentrancy, price oracle manipulation.
9) Interactive Learning Tools
Gas Cost Calculator ⛽
Formula: ETH = gasUsed × (baseFee + priority) × 1e‑9
ETH Unit Converter 🔁
→
L2 Savings Estimator 🏎️
Toy model for class demos (ignores priority fee).
10) Watch & Learn
Ethereum (clip 1)
Ethereum (clip 2)
Wallet security
11) When Ethereum is the Wrong Tool
- Single‑firm database without cross‑company trust issues.
- Traditional APIs with signatures suffice, and edits/deletes are required.
- Ultra‑low latency, high‑throughput internal systems.
12) Quiz – Check Your Understanding
- What are the two account types on Ethereum?
- After EIP‑1559, which fee component is burned?
- List the fields that determine what you pay for a transaction.
- Name two common token standards and what they represent.
- How do Optimistic and ZK rollups differ?
- Give one major protocol upgrade and what it changed.
- What is the security benefit of using a hardware wallet?
Answers
- EOA (key‑controlled) and Contract (code‑controlled).
- Base fee is burned; priority (tip) goes to validators.
- gasUsed × (baseFee + tip) with maxFee cap; nonce orders txs.
- ERC‑20 = fungible; ERC‑721 = NFTs; (ERC‑1155 = multi‑token).
- Optimistic uses fraud‑proofs; ZK uses validity proofs.
- Examples: London/EIP‑1559 (fees), Merge (PoS), Shanghai (withdrawals).
- Keys never leave device; confirm destination on‑device.