BNS
Overview
The BNS dataset captures every name- and namespace-lifecycle event on BNS-V2, plus marketplace listings on the BNS-V2 NFT, plus a current-state projection answering "who owns alice.btc right now?" It is the canonical reference for BNS analytics and resolution at scale.
BNS-V2 dispatches three different print payload shapes via three discriminator keys: topic for names, status for namespaces, a for marketplace. The decoder normalizes each shape into typed rows.
Source
Decoded from canonical print events on the BNS-V2 contract:
SP2QEZ06AGJ3RKJPBV14SY1V5BBFNAW33D96YPGZF.BNS-V2(mainnet)
v0 ships BNS-V2 only. BNS-V1 historical names are out of scope. Subdomain registrations and zonefile resolution are also out of scope for v0.
Tables
bns_name_events — one row per name-lifecycle event. topic discriminates: new-name, transfer-name, renew-name, burn-name, new-airdrop.
bns_namespace_events — one row per namespace-lifecycle event. status discriminates: launch, transfer-manager, freeze-manager, update-price-manager, freeze-price-manager, turn-off-manager-transfers.
bns_marketplace_events — one row per BNS-V2 NFT marketplace event. list-in-ustx / unlist-in-ustx / buy-in-ustx.
bns_names — current-state projection, one row per FQN. Maintained by the decoder via upsert; burn-name deletes.
bns_namespaces — current-state projection per launched namespace.
API
Six endpoints under /v1/datasets/bns/*:
GET /name-events— filter bytopic, namespace, name, owner, from_block, to_block. Cursor pagination.GET /namespace-events— filter bystatus, namespace.GET /marketplace-events— filter byaction, bns_id.GET /names— current-state listing, filter bynamespaceorowner.GET /namespaces— current namespaces with managers and name counts.GET /resolve?fqn=alice.btc— single-row lookup.
curl
curl "https://api.secondlayer.tools/v1/datasets/bns/name-events?topic=new-name&limit=5"fetch (TypeScript)
const res = await fetch(
"https://api.secondlayer.tools/v1/datasets/bns/name-events?topic=new-name&limit=5",
);
const data = await res.json();// Hit Send to see live JSON.curl
curl "https://api.secondlayer.tools/v1/datasets/bns/resolve?fqn=alice.btc"fetch (TypeScript)
const res = await fetch(
"https://api.secondlayer.tools/v1/datasets/bns/resolve?fqn=alice.btc",
);
const data = await res.json();// Hit Send to see live JSON.Resolver
GET /v1/datasets/bns/resolve?fqn=alice.btc returns the current canonical owner row. 404 if not registered or burned.
{
"fqn": "alice.btc",
"namespace": "btc",
"name": "alice",
"owner": "SP1...",
"bns_id": "12345",
"registered_at": 7869999,
"renewal_height": 7919999,
"last_event_at": "2026-05-05T12:34:56.000Z"
}Freshness
/public/status.datasets[] includes a bns-name-events entry with latest_finalized_cursor, generated_at, and lag_blocks against the chain tip. Parquet exporter is deferred — the API is the primary surface for v0.
Schema doc: docs/datasets/bns/schema.md.