ants: Namecoin .bit NIP-05 resolution + inline search-bar indicator
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.bitexample.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 / Android —
vitorpamplona/amethyst(PRs #1734, #2707, #2747, #2801, #2911, #2956, #2957) - Swift / iOS —
nostur-com/nostur-ios-publicPR #60 - JS / TS —
nbd-wtf/nostr-toolsPR #533,CodyTseng/jumblePR #774,hzrd149/nostrudelPR #352,dergigi/antsPR #281 (new) - Dart / Flutter —
ethicnology/dart-nostrPR #44 (merged)
All seven interop on the same on-chain JSON shape documented in N1.
Verification
npx tsc --noEmit— cleannpm run lint(next lint+tsc --noEmit) — cleannpx jest— 50/50 passing (19 new + 31 existing)npm run build— production build greengh pr view 281 --repo dergigi/ants --json mergeable→MERGEABLE
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
- Reference: https://github.com/dergigi/ants/pull/281
- Reference: https://github.com/mstrofnone/nips
- Reference: https://ants.sh/
Write a comment