Skip to content

ZNS integration — name resolution for CipherScan#8

Open
craftsoldier wants to merge 18 commits intoKenbak:mainfrom
zcashme:feat/zns-integration
Open

ZNS integration — name resolution for CipherScan#8
craftsoldier wants to merge 18 commits intoKenbak:mainfrom
zcashme:feat/zns-integration

Conversation

@craftsoldier
Copy link
Copy Markdown

Greetings from the ZcashMe team!

This PR adds Zcash Name Service (ZNS) support to CipherScan — search for registered ZNS names and view a detail page with resolved address, registration transaction, marketplace status, and event history.

SDK

We published zcashname-sdk to npm — a zero-dependency TypeScript SDK for the ZNS JSON-RPC API. This PR uses it for all ZNS interactions (name resolution, status, events, validation, pricing).

Indexer

The testnet ZNS indexer is live at https://light.zcash.me/zns (HTTPS + CORS). CipherScan defaults to this URL on testnet. Mainnet is disabled until a mainnet indexer is deployed.

To override, set NEXT_PUBLIC_ZNS_URL in your env.

Changes

  • /name/[name] detail page — resolved address, registration details (tx, block, nonce), marketplace listing, and event history for registered names. Invalid and unregistered names return 404.
  • Search bar — ZNS name resolution as lowest priority after address, block, tx, hex, and label lookups. Disabled on mainnet.
  • lib/zns.ts — ZNS client singleton with network guard.

Testing

Search "jameswallet" on testnet to see it in action.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 25, 2026

👷 Deploy request for cipherscan pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit d89a02b

@craftsoldier
Copy link
Copy Markdown
Author

Greetings from the ZcashMe team — pushed some architecture changes to this PR, heads up before you merge:

The browser no longer calls the indexer directly. The old approach had the SDK running client-side in a useEffect, which caused CORS failures and broke the pattern every other data source in CipherScan follows. Fixed it.

What changed:

  • New API routes: GET /api/name/:name and GET /api/name/:name/events — names are a first-class resource now, same as blocks and txs
  • lib/zns.ts is server-only — the SDK client lives behind the API, browser never touches the indexer
  • NEXT_PUBLIC_ZNS_URL is gone — replaced with ZNS_MAINNET_URL and ZNS_TESTNET_URL (server-only, optional overrides)
  • isZnsEnabled() is gone — mainnet indexer is live at light.zcash.me/zns-mainnet-test, ZNS works on all networks now
  • API docs updated with the new Names category

To test: curl localhost:3000/api/name/zechariah or search "zechariah" in the search bar on testnet.

The indexer URLs, env vars, and API shape are all documented in ZNS_INTEGRATION.md.

@craftsoldier
Copy link
Copy Markdown
Author

Note: the mainnet indexer URL (light.zcash.me/zns-mainnet-test) is a test instance. We'll swap it out for the production indexer URL before mainnet release — just a config change in lib/zns.ts or via the ZNS_MAINNET_URL env var, no code changes needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant