nos (Planetary): Namecoin .bit NIP-05 resolution
nos (Planetary): Namecoin .bit NIP-05 resolution
A PR against planetary-social/nos (the iOS Nostr client behind nos.social) adds optional Namecoin .bit NIP-05 verification to the existing NIP-05 path.
What it does
Any identifier ending in .bit (or starting with d/ / id/) is routed through a small ElectrumXClient and matched against the Namecoin chain’s published nostr field instead of the standard /.well-known/nostr.json HTTPS lookup. Everything else falls through to the existing HTTP path unchanged — no UI changes, the existing NIP05View covers it.
Why it matters
.bit gives Nostr users a DNS-free, censorship-resistant identity layer. NIP-05 verification is the natural entry point. Same UX (name@example.bit), no new fields to fill in, falls back gracefully if any of the default ElectrumX servers are unreachable.
How
Direct port of the resolver from the Nostur Swift PR #60. Same wire format (ifa-0001 + ElectrumX scripthash), same client surface, same suffix-branch hook in the verify call site.
One small correctness fix over the Nostur template: the name-script parser now accepts OP_NAME_FIRSTUPDATE (0x52) in addition to OP_NAME_UPDATE (0x53). Names that are still in their first-update window otherwise resolve to nil even when the chain has the data — a known bug in several other ports across the ecosystem.
Scope
ElectrumXClient(Network.framework TLS + TOFU cert pinning)- Name-value parser (
d/andid/namespaces; both extendednostr.namestree and short"nostr":"hex"/nostr.pubkeyforms) NamecoinServiceactor singleton + in-memory cache (1h TTL, 500 entries)- One hook in
NamesAPI.verify() - 17 unit tests, including a real-world fixture (
mstrofnone.bit) that exercises the FIRSTUPDATE path
Wire format
Same as Amethyst (Kotlin, merged), dart-nostr (merged), Nostur (Swift, in review), and in-review across the JS ecosystem. See the N1 NIP draft.
Try it
mstrofnone.bit→npub1gvv9ahktvavf9qjtrgm62le7gplmmchd5usp5wpfhr85hf79kncqj8xchs- Live wire path was verified against
nmc2.bitcoins.sk:57002before the PR was opened.
- Reference: https://github.com/planetary-social/nos/pull/1779
- Reference: https://github.com/mstrofnone/nips
- Reference: https://nos.social
Write a comment