Blockchain Indexer
Software that reshapes raw chain data into queryable tables so apps and explorers do not parse blocks themselves.
Basically
A blockchain indexer organises blockchain data so apps and explorers can find it quickly.
Key Takeaways
- A blockchain indexer extracts, transforms, and loads raw blockchain data into a queryable database, so you can look up all transactions for an address without scanning every block in sequence.
- Indexers power the infrastructure behind block explorers, wallet backends, and payment processors by maintaining optimised indexes on addresses, transactions, and UTXOs.
- Popular Bitcoin indexers range from lightweight options like electrs (~35 GB of index data) to full-featured backends like Mempool.space's fork (~1.3 TB), each trading storage for query speed.
What Is a Blockchain Indexer?
A blockchain indexer is a tool that reads raw data from a blockchain node, processes it into a structured format, and stores it in a database optimised for queries. It acts as a search engine layer on top of the blockchain, so applications can look up balances, transaction histories, and UTXO sets without scanning the entire chain.
Blockchains are designed for consensus and validation, not for answering arbitrary queries. Bitcoin Core, for example, stores the UTXO set in a LevelDB database keyed by transaction ID and output index, with no native way to query "all UTXOs belonging to address X" without iterating through every entry. The Bitcoin RPC interface can look up individual transactions by their txid, but retrieving a full address history means scanning thousands of blocks one by one.
Indexers solve this by building secondary indexes: data structures that map addresses to transactions, track balance changes over time, and maintain the relationships between inputs and outputs. Applications query the indexer instead of the node, turning seconds-long scans into millisecond lookups.
How It Works
Blockchain indexers follow an Extract, Transform, Load (ETL) pipeline. The pipeline runs continuously as new blocks arrive.
Handling Chain Reorganisations
A major challenge for indexers is handling chain reorganisations. When the blockchain forks and resolves to a different canonical chain, the indexer must detect the divergence, roll back data from orphaned blocks, and re-index the new canonical blocks.
Detection works by comparing each new block's parent hash against the stored chain tip. If they diverge, the indexer identifies the fork point and reverses all changes made after it. Most indexers define a maximum reorg depth, commonly 200 blocks for Bitcoin, beyond which data is treated as finalised.
Database Architecture
The database backend determines the indexer's performance characteristics and storage requirements. A simplified schema for a Bitcoin address index might look like this:
Lightweight indexers like electrs store only block heights per script hash and re-parse raw blocks at query time, trading CPU for disk space. Full-featured indexers like Esplora pre-compute and store complete transaction data, enabling fast lookups without touching the underlying node.
Types of Bitcoin Indexers
Bitcoin indexers fall into several categories. Each category is optimised for different use cases and resource constraints.
Electrum Protocol Servers
Electrum protocol servers implement the Electrum protocol to serve wallet queries: balance lookups, transaction history by address, and UTXO lists. They are the backbone of lightweight Bitcoin wallets that do not run full nodes.
electrs is designed for personal use with minimal storage, roughly 10% of the blockchain size, by storing only block heights per script hash and re-reading raw block data at query time. Fulcrum stores complete 32-byte script hashes with transaction numbers, enabling much faster lookups at the cost of higher disk usage. In benchmarks on a Raspberry Pi 4, loading a wallet with ~3,000 addresses took 1.4 seconds on Fulcrum versus 382 seconds on electrs.
Full-Featured Explorer Backends
Full-featured explorer backends build comprehensive databases. Their databases can serve block explorer frontends without needing to query the underlying node for most requests.
EVM Chain Indexers
Indexers on smart contract platforms also decode contract events and state changes. The Graph is the most widely adopted decentralised indexing protocol for EVM chains, where developers define "subgraphs" that specify which contract events to index, how to transform them, and what GraphQL schema to expose. Independent operators stake tokens to process subgraphs and serve queries, with the network supporting over 60 chains and 50,000 active subgraphs.
Wallet Backends
Lightweight wallets like Electrum, Sparrow, and mobile wallets rely on indexers to display balances and transaction histories without running a full node. The Electrum protocol was specifically designed for this: a wallet connects to an Electrum server, subscribes to its addresses, and receives notifications when new transactions arrive. Without indexers, every wallet would need to run its own full node and scan blocks locally, which is impractical for most users, while SPV clients similarly rely on external infrastructure to verify transactions without storing the full chain.
Block Explorers
Services like mempool.space and Blockstream Explorer index the entire blockchain so you can search transactions by txid, view address histories, and monitor network activity. The indexer preprocesses and stores all this data so that web requests return in milliseconds rather than requiring on-the-fly block scanning.
Payment Processors
Payment processors and merchant tools use indexers to monitor incoming payments, track confirmation status, and reconcile transactions. Without an indexer, confirming that a customer's payment arrived at the correct address would require polling the node and parsing raw block data in real time. For high-throughput payment systems like those built on Spark, indexing infrastructure ensures that transaction lookups remain fast even as volume scales.
Analytics and Compliance
On-chain analytics platforms like Dune and Nansen build on indexed data to provide dashboards and research tools. Compliance teams use forensic-grade indexers for chain analysis and transaction monitoring, mapping flows of funds across addresses and identifying patterns.
Why It Matters
Indexers are invisible infrastructure: users interact with wallets, explorers, and payment systems without knowing that an indexer powers the data layer underneath, but the choice of indexer directly affects user experience. A slow indexer means wallet balances take seconds to load, while an unreliable indexer means missed payment notifications. A centralised indexer creates a single point of failure and a potential privacy leak, since the indexer operator can see which addresses a wallet queries.
Developers building on Bitcoin need to understand this tradeoff and balance storage costs, query performance, and operational complexity when choosing the right indexer. A personal wallet server might run electrs on a Raspberry Pi, while a production block explorer needs the full Esplora or Mempool backend on dedicated hardware. You can compare different node and indexer setups in the research article on Bitcoin node implementation comparison.
Storage and Resource Requirements
Full-featured indexers demand significant storage. The Mempool.space backend requires over 1.3 TB after compaction and roughly double that during the initial sync process, while even lightweight options like electrs need 35+ GB on top of the full node's own storage. These requirements grow over time as the blockchain expands, and operators must plan for ongoing disk usage.
Data Consistency During Reorgs
An indexer that does not handle chain reorganisations correctly may serve stale or contradictory data, such as showing a transaction as confirmed when it was actually orphaned. Applications that rely on indexed data for financial decisions, including payment confirmation and balance checks, must either trust the indexer's reorg handling or implement their own confirmation depth thresholds.
Privacy Implications
A wallet that connects to a remote Electrum server reveals which addresses it is interested in. The server operator can correlate these queries to build a profile of the wallet's holdings and spending patterns. Running a personal indexer eliminates this leak, which is why privacy-conscious users run their own Electrum server at home, while compact block filters (BIP 157/158) offer an alternative by allowing wallets to download and scan filtered block data locally without revealing addresses to any server.
Centralisation Risk
Most lightweight wallets connect to a small number of public Electrum servers or hosted APIs. If these services go down or begin censoring queries, wallets that depend on them stop functioning, creating a form of infrastructure centralisation that runs counter to Bitcoin's design as a peer-to-peer system. Every Bitcoin application must navigate the tradeoff between the convenience of using a hosted indexer and the sovereignty of running your own.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. You should always do your own research before using any protocol or technology.