Title: auth: serve /.well-known/did/nostr/
Open Graph Title: auth: serve /.well-known/did/nostr/
X Title: auth: serve /.well-known/did/nostr/
Description: Today the "Sign in with Schnorr" button (#403/#405) requires the user to type their username because the IdP login URL has no resource owner to derive the WebID from. As discussed: the cleanest architectural answer is that the local inde...
Open Graph Description: Today the "Sign in with Schnorr" button (#403/#405) requires the user to type their username because the IdP login URL has no resource owner to derive the WebID from. As discussed: the cleanest arc...
X Description: Today the "Sign in with Schnorr" button (#403/#405) requires the user to type their username because the IdP login URL has no resource owner to derive the WebID from. As discussed: the cl...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/407
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"auth: serve /.well-known/did/nostr/\u003cpubkey>.json so the pod is its own DID resolver","articleBody":"Today the \"Sign in with Schnorr\" button (#403/#405) requires the user to type their username because the IdP login URL has no resource owner to derive the WebID from. As discussed: the cleanest architectural answer is that **the local index and the global resolver are the same mechanism, sharded by host**. Each JSS pod can serve its own users' DID documents at the `did:nostr` HTTP-resolution path the spec already defines:\n\n `https://\u003cpod-host>/.well-known/did/nostr/\u003cpubkey>.json`\n\n(per [did:nostr spec § HTTP Resolution](https://nostrcg.github.io/did-nostr/) — same path nostr.social and nostr.rocks already implement.)\n\nOnce a pod publishes its users' DID docs at that path, JSS's existing `src/auth/did-nostr.js` resolver finds them via the same code path it uses for nostr.social — just one HTTP hop earlier when the pod is the authority for that user. The \"type your username\" UX hack goes away.\n\n## Plan\n\n1. **Server side**: add `GET /.well-known/did/nostr/:pubkey.json` route. For any local account whose profile has a Nostr Multikey VM matching that pubkey (referenced from `authentication`, with valid controller), generate the DID doc on the fly:\n - `@context`: `[\"https://w3id.org/did\", \"https://w3id.org/nostr/context\"]`\n - `id`: `did:nostr:\u003cpubkey>`\n - `type`: `\"DIDNostr\"`\n - `alsoKnownAs`: `[\u003cwebId>]` — JSS knows it from the account record\n - `verificationMethod`, `authentication`, `assertionMethod` per the spec example\n - Headers per spec: `Content-Type: application/did+json`, `Cache-Control: max-age=3600`, `Nostr-Timestamp`, `Last-Modified`\n - 404 when no local account claims that pubkey.\n2. **Pubkey → account index**: small in-memory map, rebuilt on TTL miss (5 min) by scanning the existing `_webid_index.json` and reading each account's `profile/card.jsonld` for f-form Multikey or `JsonWebKey` (kty:EC, crv:secp256k1) entries. Real production wants a PATCH-time hook on the LDP write path; out of scope for this MVP.\n3. **Resolver side**: tweak `resolveDidNostrToWebId` to try `\u003crequest-host>/.well-known/did/nostr/\u003cpubkey>.json` BEFORE the configured fallback (nostr.social). For same-pod auth this becomes a zero-network self-resolve.\n4. **handleSchnorrLogin**: with the resolver picking up local users automatically, the typed-username fallback (#403) becomes a third-tier safety net rather than the primary mechanism.\n\n## Acceptance\n\n- [ ] `GET /.well-known/did/nostr/\u003cpubkey>.json` returns a CID-shaped DID doc for any account with a matching Nostr Multikey VM in its profile\n- [ ] Returns 404 (with proper headers) for unknown pubkeys\n- [ ] Existing Sign-in-with-Schnorr flow works without typing a username for local accounts\n- [ ] Cross-pod Schnorr auth still works via the configured fallback resolvers (nostr.social, etc.)\n- [ ] Pubkey index rebuilds correctly when a profile is updated (caveat: only on TTL expiry in this MVP — a write-path hook is filed as a follow-up)\n\n## Refs\n\n- #4 — overall Schnorr auth tracker\n- #386 — Phase 4 cross-protocol unification\n- #400 — resource-side NIP-98 → WebID via VM lookup\n- #405 (just merged) — IdP-side Schnorr login with typed-username fallback\n- [did:nostr DID Method Specification](https://nostrcg.github.io/did-nostr/) § HTTP Resolution","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-05-09T23:53:23Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/407"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:41116a78-b12f-442a-a299-4b7c6ef5e982 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BBBA:2DC49E:FDF926:1436D99:6B038A08 |
| html-safe-nonce | 26d99d0d6eafac34ffbebcb86cd8cdd97f44936c9a94ad171e14f9fe1f7318cd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkJBOjJEQzQ5RTpGREY5MjY6MTQzNkQ5OTo2QjAzOEEwOCIsInZpc2l0b3JfaWQiOiI3NDc0ODgyODQyMzM0NTYyODI0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 088fdb82704a9941adc7e458c7e65c5d930cd998f57c547eb077fc7c3bcab3b3 |
| hovercard-subject-tag | issue:4414149593 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/407/issue_layout |
| twitter:image | https://opengraph.githubassets.com/262b2a4c9f6ccda7a501d8a635d9e61361199b916dbc6b29241ba1ba0a936e85/JavaScriptSolidServer/JavaScriptSolidServer/issues/407 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/262b2a4c9f6ccda7a501d8a635d9e61361199b916dbc6b29241ba1ba0a936e85/JavaScriptSolidServer/JavaScriptSolidServer/issues/407 |
| og:image:alt | Today the "Sign in with Schnorr" button (#403/#405) requires the user to type their username because the IdP login URL has no resource owner to derive the WebID from. As discussed: the cleanest arc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width