Skip to content

Namecoin NIP-05 identity resolution (.bit domains)#205

Open
mstrofnone wants to merge 2 commits intocesardeazevedo:mainfrom
mstrofnone:feat/namecoin-nip05
Open

Namecoin NIP-05 identity resolution (.bit domains)#205
mstrofnone wants to merge 2 commits intocesardeazevedo:mainfrom
mstrofnone:feat/namecoin-nip05

Conversation

@mstrofnone
Copy link
Copy Markdown

Add decentralised NIP-05 identity verification via Namecoin blockchain,
enabling .bit domain identities without centralised HTTP servers.

Browser-side (no backend needed):

  • src/services/namecoin/ — ElectrumX WebSocket client, resolver with LRU cache,
    identifier parsing, Nostr data extraction
  • Modified useNIP05 hook to intercept .bit/d//id/ identifiers and route to
    blockchain resolver instead of HTTP well-known
  • Modified UserNIP05 to show distinct teal shield icon (IconShieldCheck) for
    Namecoin-verified identities
  • Search bar detects .bit/d//id/ input and resolves via ElectrumX,
    showing the resolved user in suggestions

Supported identifier formats:

  • alice@example.bit → d/example, localPart=alice
  • _@example.bit / example.bit → d/example, root
  • d/example → direct domain lookup
  • id/alice → identity namespace

Reads Nostr pubkeys and relays from Namecoin name values following
the same JSON structure used by Amethyst and other Nostr clients.

The browser connects directly to ElectrumX servers via WebSocket
(ws:// / wss://) and performs the full scripthash-based name
lookup natively — no proxy, no backend, fully static.

Based on the approach from hzrd149/nostrudel#352

M added 2 commits April 17, 2026 02:46
Enable .bit domain identities without centralised HTTP servers by
resolving Namecoin names directly from the browser via ElectrumX
WebSocket — no backend proxy or server-side code needed.

Browser-side (src/services/namecoin/):
- electrumx-ws.ts — WebSocket JSON-RPC client for ElectrumX
- resolver.ts — identifier parsing, LRU cache, Nostr data extraction
- constants.ts — ElectrumX server list, protocol constants
- types.ts — TypeScript interfaces

Modified:
- useNIP05.ts — intercepts .bit/d//id/ identifiers, resolves via
  blockchain instead of HTTP well-known
- UserNIP05.tsx — distinct teal shield icon for Namecoin-verified
  identities (IconShieldCheck)
- useSearchSuggestions.ts — detects .bit/d//id/ in search bar,
  resolves via ElectrumX and shows result
- SearchContent.tsx — renders Namecoin search results with shield icon

Supported identifier formats:
- alice@example.bit → d/example, localPart=alice
- _@example.bit / example.bit → d/example, root
- d/example → direct domain lookup
- id/alice → identity namespace

Reads Nostr pubkeys and relays from Namecoin name values following
the same JSON structure used by Amethyst and other Nostr clients.

Based on the approach from hzrd149/nostrudel#352
When navigating to /search?q=testls.bit (or any .bit/d//id/ identifier),
the search results page now resolves the Namecoin name via ElectrumX and
redirects to the user's profile page instead of showing empty NIP-50
relay search results.

Also fixes:
- SearchDialog: clicking a Namecoin suggestion now navigates to the
  user profile (was falling through the switch with no handler)
- Relay hints from Namecoin resolution are now passed through the
  suggestion type and used in nprofile encoding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant