coinstackWithIndexer.drawio.svg
Overview
This file is an SVG diagram illustrating the architecture of a **Coinstack with Indexer** setup for blockchain nodes. It visually represents how different components such as blockchain nodes, indexers, APIs, and clients interact in a cryptocurrency stack, specifically highlighting configurations for Bitcoin and Ethereum networks.
The diagram provides a clear conceptual map of how decentralized blockchain nodes connect with indexers and expose APIs and WebSocket interfaces to clients, facilitating blockchain data retrieval and event streaming. It is intended to help developers, system architects, and operators understand the interaction layers, data flow, and modular components of a blockchain stack integrated with indexing services.
Detailed Explanation of Diagram Components
Major Entities
COIN (Bitcoin / Ethereum)
Represents the cryptocurrency network in focus.
Two main coin stacks are shown: Bitcoin and Ethereum.
Each coin stack includes a native blockchain node and an indexer component.
Blockchain Node
Could be self-hosted or third-party.
Examples shown:
Bitcoin: Bitcoind Node
Ethereum: Geth Node
This node maintains the full blockchain, processes transactions, and validates blocks.
Exposes RPC and ZMQ (for Bitcoin) or WS (WebSocket) interfaces for external communication.
Indexer (Blockbook)
An indexing service that parses blockchain data from the node.
Provides efficient querying capabilities, indexing blocks, transactions, and addresses.
Supports REST API, WebSocket (WS), and RPC interfaces for client consumption.
Decouples heavy blockchain data scanning from client queries for better performance.
API and SOCKET Layers
Abstracted interface layers that provide data access endpoints.
REST API and WebSocket (WS) interfaces enable clients to interact with the indexer and node.
These interfaces serve as communication points for frontend or backend clients to request blockchain information or subscribe to events.
Client
End-user or application consuming blockchain data.
Interacts with the stack via REST, WebSocket, or RPC APIs.
Examples include wallets, explorers, analytics dashboards, or other services.
Workflow / Data Flow
The Client communicates with the API layer through REST or WS protocols.
The API layer interacts with the Indexer to fetch pre-indexed blockchain data efficiently.
The Indexer retrieves raw blockchain data and events from the Blockchain Node via RPC, WS, or ZMQ.
The Blockchain Node connects directly to the underlying blockchain network (Bitcoin or Ethereum).
Data flows from the blockchain network → node → indexer → API → client.
Two parallel setups are drawn side by side: one for Bitcoin (left) and one for Ethereum (right), showing similar architecture patterns adapted for each blockchain.
Important Implementation Details and Concepts
Separation of Concerns: The diagram clearly separates the blockchain node (data source) from the indexer (data processor and cache) and the API layer (data exposer).
Interoperability: Multiple interfaces (RPC, REST, WS, ZMQ) are provided to support different client needs and protocols.
Scalability: By using an indexer, the system avoids overloading the blockchain node with direct queries, improving scalability and performance.
Flexibility: Nodes and indexers can be self-hosted or third-party, allowing deployment flexibility.
Real-time Updates: WebSocket and ZMQ connections enable real-time event streaming to clients.
Interaction with Other System Components
The diagram fits into a larger blockchain service ecosystem, where the Coinstack with Indexer acts as a backend data provider.
It interacts upstream with the decentralized blockchain network (Bitcoin or Ethereum).
Downstream, it supports various client applications such as wallets, explorers, or analytics platforms.
The API and WebSocket interfaces serve as integration points for other modules or microservices in the system.
It can be combined with user interface layers, business logic modules, and database layers in a larger application architecture.
Visual Diagram
flowchart TD
subgraph Bitcoin Stack
B_Coin["BITCOIN (COIN)"]
B_Node["Bitcoind Node<br/>(Self hosted or 3rd Party)"]
B_Indexer["Indexer (Blockbook)"]
B_API["API<br/>(REST / WS)"]
B_Client["Client"]
B_Coin --> B_Node
B_Node -->|RPC, ZMQ| B_Indexer
B_Indexer -->|REST, WS, RPC| B_API
B_API --> B_Client
end
subgraph Ethereum Stack
E_Coin["ETHEREUM (COIN)"]
E_Node["Geth Node<br/>(Self hosted or 3rd Party)"]
E_Indexer["Indexer (Blockbook)"]
E_API["API<br/>(REST / WS)"]
E_Client["Client"]
E_Coin --> E_Node
E_Node -->|RPC, WS| E_Indexer
E_Indexer -->|REST, WS, RPC| E_API
E_API --> E_Client
end
Usage Example
While this file is a diagram (SVG) and does not contain executable code, the diagram can be used as a reference to:
Design and implement a blockchain backend infrastructure.
Set up a Bitcoin or Ethereum node with an indexing service.
Develop client applications that consume blockchain data via REST or WebSocket.
Understand the communication protocols (RPC, ZMQ, WS) involved in blockchain data access.
For example, a developer setting up a Bitcoin wallet backend could deploy:
A
bitcoindfull node.A
Blockbookindexer connected to the node's RPC and ZMQ interfaces.An API layer exposing REST and WS endpoints for wallet clients.
Wallet clients connect to the API layer to fetch transaction history and listen to real-time updates.
Summary
This SVG file visually documents the architecture of a Coinstack with an Indexer, showing how blockchain nodes, indexers, APIs, and clients interconnect for both Bitcoin and Ethereum blockchains. It emphasizes modular design, multiple communication protocols, and real-time data access, serving as a valuable blueprint for blockchain infrastructure development.
If you need further assistance on implementing or integrating components shown in this architecture, please refer to the relevant project documentation or contact the system architects.