lumilumi: Namecoin .bit NIP-05 resolution (Svelte/TypeScript)

A PR against TsukemonoGit/lumilumi adds optional Namecoin .bit NIP-05 resolution via a browser-native WSS ElectrumX client. One module, one hook in the verify path, no new UI surface. Sixth shipping client-side reference implementation of Namecoin NIP-05.

lumilumi: Namecoin .bit NIP-05 resolution (Svelte/TypeScript)

A new PR against TsukemonoGit/lumilumi adds optional Namecoin .bit NIP-05 resolution to lumilumi’s existing NIP-05 verification path.

PR: https://github.com/TsukemonoGit/lumilumi/pull/1037

What it does

NIP-05 addresses ending in .bit are resolved via a direct browser WebSocket to ElectrumX instead of the regular HTTPS /.well-known/nostr.json fetch. Users get a DNS-free identity option; everyone else’s NIP-05 keeps working unchanged.

The whole behavioural change is one .bit-suffix branch at the top of validateNip05 in src/lib/func/nip05.ts. Existing UI (Nip05Check.svelte and friends) renders the result through the same code path it already uses for HTTPS NIP-05 — no new UI surface.

How it works

  1. Compute the canonical name-index script for d/<name>
  2. Electrum-style scripthash (reversed SHA-256, Web Crypto API)
  3. blockchain.scripthash.get_history → latest tx
  4. blockchain.transaction.get(verbose=true) → NAME_UPDATE / NAME_FIRSTUPDATE output → JSON value
  5. Walk the ifa-0001 import chain so the d/<name> + dd/<name> pattern (used by the reference testls.bit deployment) resolves
  6. Honour the 36000-block expiry window
  7. Tiny in-memory LRU cache, 5 minute TTL

The browser talks directly to ElectrumX over WebSocket — no backend proxy, no extra server-side dependency.

Wire format

Same wire format already in Amethyst (Kotlin), Nostur (Swift), dart-nostr (merged), and in-review across the JS ecosystem (nostrudel #352, nostr-tools #533, jumble #774, ants #281). lumilumi is the sixth shipping client-side reference implementation across Kotlin, Swift, Dart, and now multiple TypeScript variants.

Server set

Browser-WSS-compatible subset of the canonical reference list:

  • wss://electrumx.testls.space:50004
  • wss://nmc2.bitcoins.sk:57004
  • wss://relay.testls.bit:50004
  • wss://electrum.nmc.ethicnology.com:50004

Bare-IP entries are omitted because browsers refuse WSS handshakes to bare IPs without an IP-SAN certificate.

Try it

  • _@mstrofnone.bit resolves to npub1gvv9ahktvavf9qjtrgm62le7gplmmchd5usp5wpfhr85hf79kncqj8xchs
  • m@testls.bit resolves to the on-chain pubkey
  • testls.bit (bare) resolves to the root identity from the same record
  • doesnotexist.bit returns noPubkey (graceful failure)

Tests

20 new unit tests, all green. npm run build clean. Live-verified against the real Namecoin chain.

See also


Write a comment
No comments yet.