What is the State Trie?
The state trie is a Merkle Patricia Trie data structure that stores all Ethereum state: account balances, nonces, contract code hashes, and contract storage values. Every Ethereum block references a state root. A single cryptographic hash representing the complete world state at that block height. This structure enables efficient verification and compact proofs of any state element without downloading the entire state.
Structure and Components
Ethereum maintains multiple tries working together in a hierarchical structure. The main state trie maps addresses (20-byte account identifiers) to account data (nonce, balance, storage root, code hash). Each contract's storage trie maps 32-byte storage slots to their values, with its own Merkle root referenced in the account data.
Additionally, the transaction trie contains all transactions in a block, and the receipt trie holds execution results including logs and gas used. All these tries use the same Merkle Patricia Trie structure, enabling consistent cryptographic verification patterns.
The Merkle Patricia Trie structure combines Merkle trees (enabling cryptographic verification) with Patricia tries (enabling efficient key-value storage with path compression). Each node is either a branch (16 children plus optional value), extension (shared path prefix), or leaf (actual data). Paths through the trie correspond to hexadecimal account addresses or storage keys.
State Growth Challenges
Ethereum's state continuously grows as new accounts and contracts are created. Each new storage slot adds to the state trie, and this data must be maintained by full nodes indefinitely. State growth has reached hundreds of gigabytes, creating node operation challenges and contributing to debates about state rent or state expiry mechanisms.
Storage operations (SSTORE/SLOAD opcodes) are expensive precisely because they modify or read this persistent state. Writing new storage slots costs significantly more gas than modifying existing ones because new entries expand the state trie structure.
State Proofs and Light Clients
The trie structure enables state proofs. Compact cryptographic evidence that a particular account or storage value exists without requiring the full state. Light clients can verify state by requesting proofs from full nodes and checking them against the block's state root. This capability underlies stateless client designs, optimistic rollup fraud proofs, and some bridge security mechanisms.