alphaama: Namecoin .bit NIP-05 resolution (vanilla JS web)
A small PR against eskema/alphaama adds Namecoin .bit NIP-05 resolution
to the existing NIP-05 verification path. Identifiers ending in .bit
(e.g. m@something.bit, or bare something.bit) get resolved against
Namecoin via ElectrumX over WSS; everything else still goes through
NostrTools.nip05.queryProfile exactly as today.
PR: https://github.com/eskema/alphaama/pull/9
Implementation
Single new file: aa/fx/namecoin.js (~165 lines incl. comments)
aa.fx.is_bit_nip05(s)— cheap suffix check, callers branch on itaa.fx.nip05_namecoin(s)— drop-in fornip05.queryProfile(s)aa.fx.namecoin_resolve(key)—blockchain.name.showover wss, 5-min cacheaa.fx.electrumx_name_show(url, name)— one-shot wss JSON-RPC
Two hook points (one line each, default path unchanged):
p/p.jsaa.p.check_nip05—.p check <name@domain>CLI + profile UIu/u.jssetup flow — login by NIP-05 identifier
Matches alphaama’s existing style: vanilla JS, snake_case, Allman braces,
hangs off the global aa.* namespace, no build step, no module dance.
Server set
Browser-WSS subset of the canonical six ElectrumX servers, mirroring
Amethyst’s DEFAULT_ELECTRUMX_SERVERS:
wss://electrumx.testls.space:50004wss://nmc2.bitcoins.sk:57004wss://relay.testls.bit:50004wss://electrum.nmc.ethicnology.com:50004
Bare-IP entries from the canonical set are skipped because browser WSS needs SAN-matched certs — they’d need TLSA TOFU pinning (separate NIP-track work) to be usable from a browser.
Wire format
Covers the three nostr value shapes specified by ifa-0001 Domain Name
Object:
- bare hex pubkey
{pubkey, relays}{names: {<local>: <pubkey>}, relays}
Plus shallow one-hop import walking and map sub-label descent. Tries
d/<name> first, then id/<name>.
Verifying live
.p check mstrofnone.bit
Diff
+219 / -3 across 4 files:
aa/fx/namecoin.js(new)aa/aa.js(+1)p/p.js(+4 / -2)u/u.js(+2 / -1)
Cross-client reference set
- nostr-tools PR nbd-wtf/nostr-tools#533 (open)
- jumble PR CodyTseng/jumble#774 (open)
- nostrudel PR hzrd149/nostrudel#352 (open)
- ants PR dergigi/ants#281 (open)
- nostrmo PR haorendashu/nostrmo#33 (open)
- nostur PR nostur-com/Nostur#60 (merged)
- dart-nostr PR ethicnology/dart-nostr#44 (merged)
- Amethyst (Kotlin/Android, multiple merged):
quartz/.../nip05DnsIdentifiers/namecoin/
Eighth shipping N1 reference implementation across five runtimes, now including a vanilla-JS web client with no build step.
- Reference: https://github.com/eskema/alphaama/pull/9
- Reference: https://github.com/mstrofnone/nips
- Reference: https://alphaama.com/
Write a comment