Custom APIs
Build specialized GraphQL or REST APIs tailored to your use case. Query exactly the data you need with full SQL power.
Get the whole onchain state of ENS in your database.
ENSDb is an open standard for bi-directional ENS integration. It defines a carefully crafted set of database schema designs, rules, and constraints for storing the entire ENS onchain state in a PostgreSQL database — making the data accessible from any programming language.
Any app following the standard can:
Each ENSDb instance is a standard PostgreSQL database, so to interact with it, you can use any programming language that has a PostgreSQL driver. Python, Go, Rust, JavaScript, Ruby, Java, C# — the choice is yours.
ENSNode is the reference implementation of the ENSDb standard, providing a complete ecosystem of tools and services for building with ENSDb. Each ENSNode instance includes:
flowchart LR
subgraph ENSNode["ENSNode Environment"]
subgraph ENSNodeMainnet["ENSNode 'Mainnet' instance"]
direction LR
ENSIndexerMainnet[ENSIndexer 'Mainnet' instance]
ENSApiMainnet@{ shape: procs, label: "ENSApi Mainnet instances" }
end
subgraph ENSNodeSepolia["ENSNode 'Sepolia' instance"]
direction LR
ENSIndexerSepolia[ENSIndexer 'Sepolia' instance]
ENSApiSepolia[ENSApi 'Sepolia' instance]
end
end
subgraph PostgreSQLServer["PostgreSQL Server instance"]
ENSDbMainnet[(ENSDb 'Mainnet' instance)]
PSMainnet(Ponder Schema)
NSMainnet(ENSNode Schema)
EISMainnet@{ shape: procs, label: "ENSIndexer Schema" }
ENSDbMainnet -->|1..1| PSMainnet
ENSDbMainnet -->|1..1| NSMainnet
ENSDbMainnet -->|1..*| EISMainnet
ENSDbSepolia[(ENSDb 'Sepolia' instance)]
PSSepolia(Ponder Schema)
NSSepolia(ENSNode Schema)
EISSepolia@{ shape: procs, label: "ENSIndexer Schema" }
ENSDbSepolia -->|1..1| PSSepolia
ENSDbSepolia -->|1..1| NSSepolia
ENSDbSepolia -->|1..*| EISSepolia
end
ENSIndexerMainnet -->|Write| ENSDbMainnet
ENSIndexerSepolia -->|Write| ENSDbSepolia
ENSApiMainnet -->|Read| ENSDbMainnet
ENSApiSepolia -->|Read| ENSDbSepolia
You can build custom writers, readers, or both. The standard is implementation-agnostic.
An ENSDb instance is a PostgreSQL database that follows the ENSDb open standard. Key characteristics:
| Aspect | Description |
|---|---|
| What it is | A PostgreSQL database (logical database within a server) |
| Where it runs | Served from a PostgreSQL server |
| Multi-tenancy | One ENSDb instance can store data from multiple ENSIndexer instances (tenants) |
| Contains | Complete indexed ENS state, and ENSNode Metadata |
A single PostgreSQL server can serve multiple ENSDb instances for different ENS Namespaces. This allows you to have separate ENSDb instances based on your needs. For example:
flowchart TB
subgraph PGServer["PostgreSQL Server"]
direction TB
Mainnet[(ENSDb Mainnet instance)]
Testnet[(ENSDb Sepolia instance)]
Devnet[(ENSDb ENS Test Env instance)]
end
Each ENSDb instance is an independent database containing complete ENS data for its respective environment.
An ENSDb instance contains the entire onchain state of ENS:
By building on a PostgreSQL database, ENSDb inherits world-class capabilities:
ENSDb unlocks a new universe of ENS applications:
Custom APIs
Build specialized GraphQL or REST APIs tailored to your use case. Query exactly the data you need with full SQL power.
Analytics & Dashboards
Create real-time dashboards and analytics pipelines. Better than Dune — you have the full ENS state locally with sub-second query latency.
CLIs & Developer Tools
Build command-line tools for ENS operations. Query domains, check expiration, analyze name patterns — all from your terminal.
Event-Based Engines
Build reactive systems that respond to ENS state changes. Monitor registration lifecycles, ownership transfers, resolver updates.
Data Pipelines
Feed ENS data into your existing data infrastructure. Sync to data warehouses, trigger webhooks, populate search indexes.
AI & ML Models
Train machine learning models on complete ENS datasets. Predict name values, detect patterns, analyze market trends.
Connect to an ENSDb instance (a PostgreSQL database). The examples below assume you that ENSDb instances are served from a PostgreSQL server at host:5432 with databases named ensdb_mainnet, ensdb_testnet, and ensdb_devnet:
# Production environment (mainnet data)psql postgresql://user:password@host:5432/ensdb_mainnet
# Pre-production environment (testnet data)psql postgresql://user:password@host:5432/ensdb_testnet
# Staging / local development environmentpsql postgresql://user:password@host:5432/ensdb_devnetOnce connected to an ENSDb instance, discover its ENSIndexer Schemas:
SELECT DISTINCT ens_indexer_schema_nameFROM ensnode.metadata;Query data from a specific ENSIndexer Schema within your ENSDb instance:
-- Get domains from the ENSIndexer Schema with the `ensindexer_mainnet` ENSIndexer Schema NameSELECT * FROM ensindexer_mainnet.v1_domains LIMIT 10;
-- Get indexing status for the ENSNode Schema with the `ensindexer_mainnet` ENSIndexer Schema NameSELECT * FROM "ensnode"."metadata"WHERE ens_indexer_schema_name = 'ensindexer_mainnet'AND key = 'ensindexer_indexing_status'AND value -> 'data' -> 'omnichainSnapshot' ->> 'omnichainStatus' = 'omnichain-following';For TypeScript projects, the ENSDb SDK provides typed access:
import { EnsDbReader } from '@ensnode/ensdb-sdk';
// Connect to a specific ENSDb instance by providing its connection string and// the ENSIndexer Schema Name you want to queryconst ensDbReader = new EnsDbReader(ensDbConnectionString, ensIndexerSchemaName);
// Get domains from the ENSIndexer Schemaconst v1Domains = await ensDbReader.ensDb.select() .from(ensDbReader.ensIndexerSchema.v1Domain) .limit(10);
// Get indexing statusconst indexingStatus = await ensDbReader.getIndexingStatusSnapshot()