feat(namecoin): resolve .bit NIP-05 identifiers via Namecoin ElectrumX#2128
Open
mstrofnone wants to merge 1 commit into
Open
feat(namecoin): resolve .bit NIP-05 identifiers via Namecoin ElectrumX#2128mstrofnone wants to merge 1 commit into
mstrofnone wants to merge 1 commit into
Conversation
Adds optional Namecoin .bit verification to the existing NIP-05 path. Identifiers ending in .bit (and the d/<name> / id/<name> shorthands) are routed to a small browser-WSS ElectrumX client instead of HTTPS, giving users a DNS-free option for identity verification. Wire format follows the parallel ports in Amethyst (Kotlin), Nostur (Swift), nostr-tools PR SnowCait#533 / Jumble PR SnowCait#774 / nostrudel PR SnowCait#352 (JS), and dart-nostr PR SnowCait#44 (Dart, merged). Domain names use "nostr.names[<local>]" with optional "nostr.relays" map; identity names (id/) use "nostr.pubkey" + array relays; the shorthand "nostr": "<hex>" form is accepted for root entries. - Module: src/lib/namecoin/ (cache + electrumx + parser + tests). - Single hook: src/lib/Nip05.ts wraps nostr-tools queryProfile, routing .bit identifiers and falling through for everything else. - Two call sites updated: NostrAddress.svelte (profile NIP-05 row) and the npub route slug-overwrite path. - No new top-level UI: the existing verified checkmark either lights up or stays dark, no extra badges or noise. - Browser-WSS pool is the 4-of-6 subset of amethyst's DEFAULT_ELECTRUMX_SERVERS that operators expose over WSS. Bare-IP amethyst entries are deliberately skipped (no IP-SAN cert path in browsers). Documented in a comment in electrumx.ts. - 21 new unit tests, all passing; full suite stays at 103/103. Try it: `_@mstrofnone.bit` resolves to the same pubkey as the existing mstrofnone npub.
Author
Owner
|
I know nothing about Namecoin, so I cannot judge whether I should implement a specification that does not exist in NIP-05. Also, I cannot verify your code. |
Author
|
sure @SnowCait that seems very reasonable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds optional Namecoin
.bitverification: NIP-05 addresses ending in.bit(and thed/<name>/id/<name>shorthands) are resolved over the Namecoin blockchain instead of HTTPS, giving users a DNS-free alternative for identity verification. Everything else still flows throughnostr-toolsexactly as today.Why
.bitis a censorship-resistant naming layer (Namecoin, since 2011). For a calm reader-oriented client like nostter, this lands as a one-line suffix check in the existing NIP-05 path — no new UI noise, no new badges, no new top-level components. The existing verified checkmark either lights up for a.bitaddress or it doesn't, same as for a.comaddress.Scope
src/lib/namecoin/(cache + WSS ElectrumX client + ifa-0001 value parser + tests).src/lib/Nip05.tswrapsnostr-toolsqueryProfile..bitshapes route to the Namecoin resolver; everything else falls through unchanged.NostrAddress.svelteand the[slug=npub]slug-overwrite path).nostrfield, expired name).Wire format
Same wire format used in Amethyst (Kotlin), Nostur (Swift),
dart-nostr(merged), and the in-review PRs againstnostrudel,jumble, andnostr-tools:d/<domain>records: readnostr.names[<local-part>](with_as the root entry), with optionalnostr.relaysmap keyed by pubkey.id/<name>records: readnostr.pubkeyplus optional flatnostr.relaysarray."nostr": "<hex>"accepted as the root entry of ad/record.See the N1 NIP draft for the formal definition.
Try it
_@mstrofnone.bitresolves to the same pubkey as the existingmstrofnonenpub on the Namecoin chain.mstrofnone.bit(the bare shorthand) does the same.Footprint
+1012 / -8 across 10 files (most of that is the WSS client + tests). The two existing Svelte components each get a 2-line import-swap; everything else is new code under
src/lib/namecoin/.Tests & checks
svelte-check: zero regressions (11 pre-existing errors, same count before and after; none introduced by this change).Server pool note
The shipped default list is the 4-of-6 browser-WSS subset of Amethyst's
DEFAULT_ELECTRUMX_SERVERS. Two of Amethyst's entries are bare IPs that browsers refuse over WSS (no IP-SAN cert), so they're deliberately omitted here. This is documented inline inelectrumx.ts. Of the four shipped servers,electrum.nmc.ethicnology.comis the most browser-friendly today (Let's Encrypt-fronted); the other three serve self-signed certs and will only succeed once the user has TOFU-trusted them. The calm-failure UX means this is fine:.bitverification is optional, and if every server fails the checkmark just stays dark.