NIP-07 Visitor Identity in the Workshop #14

Closed
opened 2026-03-20 22:24:23 +00:00 by replit · 1 comment
Owner

What & Why

Visitors are currently anonymous. NIP-07 support (Alby, nos2x, etc.) lets visitors connect their Nostr identity with one click. Their npub appears on their presence indicator, and Timmy can greet them by name. This is the sovereign, key-owned identity model the project is philosophically committed to.

Done looks like

  • 'Connect Nostr' button in the Workshop header
  • Clicking calls window.nostr.getPublicKey() (NIP-07); no key ever sent to server
  • Visitor's npub displayed in header (first 8 chars + last 4)
  • npub included in WebSocket visitor presence events so Timmy can reference it in greetings
  • If no NIP-07 extension detected: 'Get Alby' button with link; no hard error
  • Identity stored in localStorage; persists across page refreshes
  • Visitor can disconnect (removes npub from session, clears localStorage)

Out of scope

  • NIP-07 signing of messages (pubkey only)
  • Zap sending (separate task)
  • Server-side Nostr authentication

Tasks

  1. NIP-07 detection + connect flow — Browser-side NIP-07 detection; 'Connect Nostr' → getPublicKey() → store in localStorage; display formatted npub in header.
  2. Presence broadcast — Include visitor's npub in WebSocket visitor enter/leave events.
  3. Timmy greeting with name — Update greeting logic to include npub when available.
  4. Fallback UI — Detect missing NIP-07 extension; show 'Get Alby' link with tooltip explaining Nostr identity.

Relevant files

  • the-matrix/js/nostr-identity.js
  • the-matrix/js/ui.js
  • the-matrix/js/websocket.js
  • the-matrix/js/main.js
  • artifacts/api-server/src/routes/events.ts
## What & Why Visitors are currently anonymous. NIP-07 support (Alby, nos2x, etc.) lets visitors connect their Nostr identity with one click. Their npub appears on their presence indicator, and Timmy can greet them by name. This is the sovereign, key-owned identity model the project is philosophically committed to. ## Done looks like - 'Connect Nostr' button in the Workshop header - Clicking calls `window.nostr.getPublicKey()` (NIP-07); no key ever sent to server - Visitor's npub displayed in header (first 8 chars + last 4) - npub included in WebSocket visitor presence events so Timmy can reference it in greetings - If no NIP-07 extension detected: 'Get Alby' button with link; no hard error - Identity stored in localStorage; persists across page refreshes - Visitor can disconnect (removes npub from session, clears localStorage) ## Out of scope - NIP-07 signing of messages (pubkey only) - Zap sending (separate task) - Server-side Nostr authentication ## Tasks 1. **NIP-07 detection + connect flow** — Browser-side NIP-07 detection; 'Connect Nostr' → `getPublicKey()` → store in localStorage; display formatted npub in header. 2. **Presence broadcast** — Include visitor's npub in WebSocket visitor enter/leave events. 3. **Timmy greeting with name** — Update greeting logic to include npub when available. 4. **Fallback UI** — Detect missing NIP-07 extension; show 'Get Alby' link with tooltip explaining Nostr identity. ## Relevant files - `the-matrix/js/nostr-identity.js` - `the-matrix/js/ui.js` - `the-matrix/js/websocket.js` - `the-matrix/js/main.js` - `artifacts/api-server/src/routes/events.ts`
replit added the backendworkshopfrontendnostr labels 2026-03-20 22:24:23 +00:00
gemini was assigned by Rockachopa 2026-03-22 23:37:42 +00:00
Collaborator

Work completed on branch gemini/issue-14.

Implemented NIP-07 support for visitor identity, including UI for connecting/disconnecting, local storage persistence, inclusion of npub in WebSocket presence events, fallback UI, and personalized Timmy greetings.

I was unable to create a pull request due to a policy denial. Please create a pull request from gemini/issue-14 to main.

Work completed on branch `gemini/issue-14`. Implemented NIP-07 support for visitor identity, including UI for connecting/disconnecting, local storage persistence, inclusion of npub in WebSocket presence events, fallback UI, and personalized Timmy greetings. I was unable to create a pull request due to a policy denial. Please create a pull request from `gemini/issue-14` to `main`.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: replit/timmy-tower#14