Namecoin .bit NIP-05 lands in futr (Haskell)
Namecoin .bit NIP-05 lands in futr (Haskell)
Tracking PR: https://github.com/futrnostr/futr/pull/162
futr is a Haskell desktop Nostr client. PR #162 wires optional Namecoin .bit NIP-05 verification into the existing Nip05Search path: identifiers ending in .bit (plus the bare d/<name> / id/<name> Namecoin shapes) are routed to an ElectrumX-backed resolver; everything else stays on the existing HTTPS .well-known/nostr.json path. Both branches return the same Nip05SearchResult shape, so call sites stay branch-free.
Why a Haskell port matters
.bit ↔ Nostr is already shipping or in-review across several runtimes:
- Kotlin / Android — vitorpamplona/amethyst (canonical wire-format reference, in production).
- Swift / iOS — nostur-com/Nostur (merged); planetary-social/nos #1779 (open).
- Dart / Flutter — ethicnology/dart-nostr (merged); haorendashu/nostrmo #33, 0xchat-app/0xchat-app-main #65, ZharlieW/Aegis #14 (all open).
- TypeScript / JavaScript — nbd-wtf/nostr-tools #533, hzrd149/nostrudel #352, CodyTseng/jumble #774, dergigi/ants #281, cesardeazevedo/nosotros #205, SnowCait/nostter #2128, TsukemonoGit/lumilumi #1037, eskema/alphaama #9 (open).
A clean Haskell implementation, written against the same wire format from a referentially-transparent language, is useful evidence that the spec isn’t shaped by any one runtime’s idioms. ifa-0001 + ElectrumX scripthash + N1 NIP draft are sufficient to derive a working client; this PR is the proof.
Implementation summary
- New module
Nostr.Nip05Search.Namecoin(~626 LOC). - One hook in
Nostr.Nip05Search(single suffix-branch). - ElectrumX JSON-RPC over TLS with sensible defaults (six servers; both
:50002SSL and bare-IP endpoints, since this is a desktop runtime — no browser-WSS restrictions). - Parses the full ifa-0001 Domain Name Object:
d/<name>andid/<name>shapes,importwalking,mapsub-label descent, all threenostrvalue forms. - Hspec test suite (
NamecoinTest.hs) covers parsing, opcode handling (bothOP_NAME_FIRSTUPDATE 0x52andOP_NAME_UPDATE 0x53— note: some earlier reference impls only matched 0x53, which silently drops names whose only on-chain transaction is the initial FIRSTUPDATE), and end-to-end resolution against mocked ElectrumX responses. - No new UI surfaces — existing NIP-05 indicator covers the
.bitcase. - Falls back gracefully on resolver failure.
Try it
_@mstrofnone.bit→npub1gvv9ahktvavf9qjtrgm62le7gplmmchd5usp5wpfhr85hf79kncqj8xchsmstrofnone.bit→ same (bare-name form)doesnotexist.bit→ null (clean failure)
Pointers
- N1 NIP draft (proposed): https://github.com/nostr-protocol/nips/pull/2349
- Canonical wire-format reference (Kotlin):
vitorpamplona/amethyst/quartz/.../nip05DnsIdentifiers/namecoin/ - Test
.bitrecords (live on the Namecoin chain):d/mstrofnone,id/mstrofnone,d/testls
Normative discussion: please use the GitHub PR thread.
- Reference: https://github.com/futrnostr/futr/pull/162
Write a comment