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. Direct port of the Nostur Swift resolver with a small FIRSTUPDATE fix.

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/ and id/ namespaces; both extended nostr.names tree and short "nostr":"hex" / nostr.pubkey forms)
  • NamecoinService actor 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.bitnpub1gvv9ahktvavf9qjtrgm62le7gplmmchd5usp5wpfhr85hf79kncqj8xchs
  • Live wire path was verified against nmc2.bitcoins.sk:57002 before the PR was opened.

PR: https://github.com/planetary-social/nos/pull/1779


Write a comment
No comments yet.