The Ethereum Virtual Machine

world state trie

The world state is Ethereum's complete snapshot of 'who has what' at a given block: the balance and code of every account, and the contents of every contract's storage. The world state trie is the cryptographic data structure that holds this snapshot and squeezes it down to a single 32-byte fingerprint, the state root, which is recorded in every block header. Change one account's balance and that fingerprint changes, so a block header silently commits to the entire state of the chain.

Concretely it is a Merkle Patricia trie keyed by account address (specifically the Keccak-256 hash of the 20-byte address). Each leaf is an account containing four fields: the nonce (number of transactions sent or contracts created), the balance in wei, the storageRoot, and the codeHash. For a contract, the storageRoot is itself the root of a separate Merkle Patricia trie holding that contract's storage slots, so the structure nests: one global account trie, each contract account pointing to its own storage trie.

This design buys two things at once: a compact commitment and efficient proofs. Because the whole state collapses to one root, a node can advertise its current state in 32 bytes. Because the trie is Merkle-authenticated, a light client that knows only the state root can be handed a short proof — a path of sibling hashes — that conclusively shows 'account X has balance Y and storage value Z' without downloading the multi-hundred-gigabyte state. Any tampering breaks a hash along the path.

Every transaction executed by the EVM is, at bottom, an edit to this trie, and recomputing the new state root after each block is a core job of the execution client. The trie's depth and hashing also make state access a real cost — a major motivation for the planned migration from the hexary Merkle Patricia trie to a flatter Verkle tree, which shrinks proofs enough to make stateless clients practical.

There are actually three tries committed per block: the state trie (accounts), the transactions trie, and the receipts trie. Only the state trie persists and mutates; the other two are rebuilt fresh each block.