08. BG Labs: EVM Fundamentals
Overview
Section titled “Overview”This lesson closes Module 1 by naming the thing that has been implied all along: the EVM, the Ethereum Virtual Machine. It is the shared computer that executes every contract and produces the state that every block records. Understanding the EVM ties keys, transactions, contracts, and gas into one coherent machine — and it is the machine your Solidity code will compile down to in Module 2.
Key concepts
Section titled “Key concepts”- The EVM is a single global computer — every node runs the same virtual machine and, given the same transactions in the same order, computes the same result. That reproducibility is what lets a decentralized network agree on one state without trusting any single node.
- It runs bytecode, not Solidity — Solidity is a high-level language you write; a
compiler turns it into EVM bytecode, a list of low-level opcodes (
ADD,SSTORE,CALL, …). The EVM only ever executes bytecode. - Gas meters the opcodes — each opcode has a fixed gas cost (lesson 05). Metering per opcode is what makes it safe to let untrusted code run on a public machine: nothing can loop forever, because it runs out of gas first.
- State lives in accounts — the EVM’s “memory of the world” is the set of account states: EOA balances and each contract’s storage. A transaction is an instruction to the EVM to transition from one valid state to the next.
- Deterministic and isolated — a contract can only touch its own storage and whatever it is explicitly passed or calls; it has no access to the outside world (no network, no file system, no clock beyond block data). This is why contracts are predictable but also why they need oracles to learn anything off-chain (Module 5).
- Same machine everywhere — “EVM-compatible” chains (many L2s and sidechains) run this same virtual machine, which is why the contracts you write here also deploy there (Module 4).
Common pitfalls
Section titled “Common pitfalls”- Thinking the network “runs your Solidity.” It runs the compiled bytecode; Solidity is a developer convenience on top.
- Imagining a contract can reach the internet or read a live price on its own. The EVM is sealed off from the outside world by design.
- Treating gas as an arbitrary tax rather than what it is: the per-opcode metering that makes running untrusted code on a shared computer possible at all.
Check yourself
Section titled “Check yourself”- What does the EVM actually execute — your Solidity source, or something derived from it?
- Why can’t a smart contract fetch data from a website by itself?
- How does per-opcode gas metering make it safe to run anyone’s code on a shared machine?
Watch the Video
Section titled “Watch the Video”
BG Labs: EVM Fundamentals
Video credit: Austin Griffith · Duration: 43 minutes
