Summary
MonadDb is a critical component in Monad for maintaining full Ethereum compatibility while delivering high performance. It is a custom-built key-value database designed for storing authenticated blockchain data. MonadDb, specifically, is optimized for efficiently storing Merkle Patricia Trie nodes on disk.Merkle Patricia Trie Structured Database
Most Ethereum clients use generic key-value databases that are implemented as either B-Tree (e.g. LMDB) or LSM-Tree (e.g. LevelDB, RocksDB) data structures. However Ethereum uses the Merkle Patricia Trie (MPT) data structure for storing state and other authenticated fields like receipts and transactions. This results in a suboptimal solution where one data structure is embedded into another data structure. MonadDb implements a Patricia Trie (a specific variant of radix tree) data structure natively, both on-disk and in-memory. Despite the opinionated design, MonadDb is a flexible key-value store capable of storing any type of data. For instance, MonadDb is also used to store block headers and payloads for Monad.Page-based storage state
Under MIP-8, the storage trie commits to pages rather than to individual slots. A page is a contiguous group of 128 storage slots (4096 bytes), and each storage leaf holds a 32-byte commitment to the contents of one page, so the trie stores{page_index, page_commitment} pairs. The trie is otherwise unchanged: keys are hashed with keccak, and branch, extension and leaf nodes follow the standard MPT rules. Reading a single 32-byte slot already pulls a whole page off the SSD, so the commitment now covers the same unit as one disk read.
A page commitment is a BLAKE3 Merkle root built over the occupied slots of the page alone. The work of computing it, and the size of a proof against it, grow with how much of the page is occupied rather than with the 4096-byte page size. See Storage pages for the resulting gas schedule, and MIP-8 Activation and Page Storage Migration for how existing databases are migrated.

