alphaama: Namecoin .bit NIP-05 resolution (vanilla JS web)

A PR against eskema/alphaama adds Namecoin .bit NIP-05 resolution to the existing NIP-05 path. ~165 lines of vanilla JS, single file, matches the scrappy style of the codebase. Eighth shipping N1 reference implementation across five runtimes.

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 it
  • aa.fx.nip05_namecoin(s) — drop-in for nip05.queryProfile(s)
  • aa.fx.namecoin_resolve(key)blockchain.name.show over wss, 5-min cache
  • aa.fx.electrumx_name_show(url, name) — one-shot wss JSON-RPC

Two hook points (one line each, default path unchanged):

  • p/p.js aa.p.check_nip05.p check <name@domain> CLI + profile UI
  • u/u.js setup 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:50004
  • wss://nmc2.bitcoins.sk:57004
  • wss://relay.testls.bit:50004
  • wss://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

Eighth shipping N1 reference implementation across five runtimes, now including a vanilla-JS web client with no build step.


Write a comment
No comments yet.