lumilumi: Namecoin .bit NIP-05 resolution (Svelte/TypeScript)
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
- Compute the canonical name-index script for
d/<name> - Electrum-style scripthash (reversed SHA-256, Web Crypto API)
blockchain.scripthash.get_history→ latest txblockchain.transaction.get(verbose=true)→ NAME_UPDATE / NAME_FIRSTUPDATE output → JSON value- Walk the ifa-0001
importchain so thed/<name>+dd/<name>pattern (used by the referencetestls.bitdeployment) resolves - Honour the 36000-block expiry window
- 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:50004wss://nmc2.bitcoins.sk:57004wss://relay.testls.bit:50004wss://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.bitresolves tonpub1gvv9ahktvavf9qjtrgm62le7gplmmchd5usp5wpfhr85hf79kncqj8xchsm@testls.bitresolves to the on-chain pubkeytestls.bit(bare) resolves to the root identity from the same recorddoesnotexist.bitreturnsnoPubkey(graceful failure)
Tests
20 new unit tests, all green. npm run build clean. Live-verified against the real Namecoin chain.
See also
- N1 NIP draft: https://github.com/mstrofnone/nips
- nostrudel PR #352 (the closest reference impl, also browser-WSS): https://github.com/hzrd149/nostrudel/pull/352
- ants PR #281 (the inline search-bar indicator pattern, ported here through the existing
Nip05Checkrather than as a new UI element)
- Reference: https://github.com/TsukemonoGit/lumilumi/pull/1037
- Reference: https://github.com/mstrofnone/nips
- Reference: https://github.com/hzrd149/nostrudel/pull/352
Write a comment