Home

What is the LMDB database used by monerod?

LMDB is the database software that monerod, Monero’s node program, uses to store its local copy of the blockchain. It holds blocks, transactions, and the records your node needs to check new activity. It is not your wallet, and it does not hold your wallet’s private keys.

What your node stores in LMDB

LMDB stands for Lightning Memory-Mapped Database. Think of it as the storage engine behind your node’s organized record of Monero activity.

The blockchain is the shared history of confirmed transactions. When you run monerod, it downloads that history from other nodes, checks it against Monero’s rules, and saves the resulting records in LMDB.

These records include:

  • Blocks and transactions: The confirmed history your node has downloaded.
  • Transaction outputs: Records of coins created by transactions, which your node needs when checking later spending.
  • Key images: Unique markers that let Monero detect attempts to spend the same coins twice without revealing which output was spent.
  • Indexes and related records: Lookup information that helps your node find and check data quickly.

LMDB stores this information efficiently. The rules for deciding whether a transaction or block is valid belong to monerod, not to the database itself.

Why Monero uses it

“Memory-mapped” means your operating system makes a database file available to the program through its memory system. It brings the needed parts into working memory, called RAM, as they are used.

That does not mean you need enough RAM to fit the whole blockchain. Most of the database stays on your drive.

LMDB is designed for fast lookups and reliable updates. It supports many readers while allowing one write transaction at a time. This suits a node that needs to answer queries while adding newly verified blocks.

It also uses database transactions: groups of changes that are committed together. This helps avoid half-written records after an interruption, although failing drives and unsafe storage settings can still cause problems.

Where it lives and how to handle it

Inside your Monero data directory, you will normally find an lmdb folder containing:

  • data.mdb: The main blockchain database.
  • lock.mdb: A coordination file that helps manage safe database access.

The directory’s location depends on your operating system and any custom data-directory setting.

Treat these as internal files. Do not edit them, delete the lock file while the node is running, or point separate monerod instances at the same database.

For a straightforward file copy or move, stop monerod cleanly first. Use a solid-state drive, or SSD, if possible: its faster access usually makes synchronization much smoother. Keep spare disk space because the database grows over time.

What it means for mining and pruning

If you solo mine or use P2Pool with your own node, LMDB is part of the node’s supporting infrastructure. It is not the mining engine and does not directly increase your mining speed.

A pruned node saves disk space by leaving out some older transaction proof data while retaining what it needs to validate the chain. It still uses LMDB. Enabling pruning on an existing database may not immediately shrink its file, because freed space can be reused internally.

The bottom line

LMDB is your Monero node’s local blockchain storage engine. Let monerod manage it, give it reliable storage and room to grow, and keep your wallet backups separate. Losing this database generally means downloading the blockchain again—not losing your wallet’s keys.

All 1,000 questions

MyAiMiner.com

MyAiMiner.com — Monero mining blog. 1,000 questions. Clear answers.

Monero (XMR) Mining BLOG

Hashes0
Blocks accepted0
Blocks rejected0
Runtime00:00:00