ants: Namecoin .bit NIP-05 resolution + inline search-bar indicator

A PR against dergigi/ants adds Namecoin .bit NIP-05 resolution to the existing NIP-05 path, plus an inline resolution indicator under the global search bar — a direct port of Amethyst PR #2957 to web. Seventh shipping N1 reference implementation across five runtimes.

ants: Namecoin .bit NIP-05 resolution + inline search-bar indicator

A new PR opened against dergigi/ants — the Next.js / React Nostr search client at ants.sh — adds Namecoin .bit resolution to its existing NIP-05 path, plus an inline resolution indicator under the global search bar.

GitHub PR: https://github.com/dergigi/ants/pull/281

This is the seventh shipping reference implementation of the Namecoin NIP-05 (N1) wire format. ants is a search client first, so this is also the most direct port of the Amethyst inline search-bar resolution row (#2957) to the web. Typing a .bit identifier into the search input now shows a spinner → resolved npub short-form with a Namecoin badge → click-through to the profile page. Lookup failures get an explicit reason instead of falling back silently to DNS.

Supported identifier shapes

  • alice@example.bit
  • example.bit (uses the _ root entry)
  • d/example (Namecoin domain namespace)
  • id/alice (Namecoin identity namespace)
  • a nostr: NIP-21 URI prefix is tolerated on all of the above

What changes in ants

Area Change
src/lib/namecoin/ New resolver: WSS to an ElectrumX server, scripthash path via blockchain.scripthash.get_history, NAME_UPDATE vout parsing, name-expiry check (~36 000 blocks), nostr.names[<localpart>] / nostr.pubkey extraction, session-level cache + in-flight dedup.
src/lib/profile/nip05.ts Routes .bit identifiers through the chain resolver from both resolveNip05ToPubkey and verifyNip05, so any existing call site that already handles a NIP-05 value picks .bit up for free.
src/app/api/nip05/verify/route.ts Short-circuits .bit identifiers through isValidNamecoinNip05 on the server side, so the browser never has to deal with the self-signed ElectrumX TLS certs the public servers ship today.
src/components/NamecoinResolutionIndicator.tsx Inline indicator mounted under the search bar (mirror of Amethyst’s NamecoinResolutionRow).

Why a fresh inline port instead of pulling in nostr-tools

nbd-wtf/nostr-tools #533 adds an isomorphic nip05namecoin export with exactly this API surface, but is still open. Rather than gate the ants PR on it landing, the resolver is shipped inline under src/lib/namecoin/ — same path CodyTseng/jumble #774 took. If/when #533 ships, switching the ants internals over is a small mechanical swap.

The cross-language family

This brings the N1 reference-implementation count to seven, across five runtimes:

  • Kotlin / Androidvitorpamplona/amethyst (PRs #1734, #2707, #2747, #2801, #2911, #2956, #2957)
  • Swift / iOSnostur-com/nostur-ios-public PR #60
  • JS / TSnbd-wtf/nostr-tools PR #533, CodyTseng/jumble PR #774, hzrd149/nostrudel PR #352, dergigi/ants PR #281 (new)
  • Dart / Flutterethicnology/dart-nostr PR #44 (merged)

All seven interop on the same on-chain JSON shape documented in N1.

Verification

  • npx tsc --noEmit — clean
  • npm run lint (next lint + tsc --noEmit) — clean
  • npx jest — 50/50 passing (19 new + 31 existing)
  • npm run build — production build green
  • gh pr view 281 --repo dergigi/ants --json mergeableMERGEABLE

Out of scope for this PR

  • TLSA pinning of the resolver’s WSS dial (N3) — separate PR.
  • Relay-URL resolution for wss://example.bit (N2) — separate PR.
  • CLINK / payment-pointer composition on the same record (N5) — separate PR.

Discussion and review is in the GitHub PR. Replies on Nostr are welcome.

— mstrofnone


Write a comment
No comments yet.