René's URL Explorer Experiment


Title: Spec: did:nostr to WebID Resolution · Issue #42 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub

Open Graph Title: Spec: did:nostr to WebID Resolution · Issue #42 · JavaScriptSolidServer/JavaScriptSolidServer

X Title: Spec: did:nostr to WebID Resolution · Issue #42 · JavaScriptSolidServer/JavaScriptSolidServer

Description: Overview This document specifies how JSS resolves did:nostr: identities to Solid WebIDs, enabling Nostr users to authenticate as their linked WebID. Specification Identity Linking A bidirectional link between Nostr and Solid iden...

Open Graph Description: Overview This document specifies how JSS resolves did:nostr: identities to Solid WebIDs, enabling Nostr users to authenticate as their linked WebID. Specification Identity Linking A bidirec...

X Description: Overview This document specifies how JSS resolves did:nostr:<pubkey> identities to Solid WebIDs, enabling Nostr users to authenticate as their linked WebID. Specification Identity Linking A b...

Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Spec: did:nostr to WebID Resolution","articleBody":"## Overview\n\nThis document specifies how JSS resolves `did:nostr:\u003cpubkey>` identities to Solid WebIDs, enabling Nostr users to authenticate as their linked WebID.\n\n## Specification\n\n### Identity Linking\n\nA bidirectional link between Nostr and Solid identities:\n\n```\n┌─────────────────┐         alsoKnownAs         ┌─────────────────┐\n│   Nostr Profile │ ──────────────────────────► │   Solid WebID   │\n│   (kind 0)      │                             │   (profile/card)│\n│                 │ ◄────────────────────────── │                 │\n└─────────────────┘         owl:sameAs          └─────────────────┘\n```\n\n### DID Document Structure\n\nThe DID resolver at `nostr.social/.well-known/did/nostr/\u003cpubkey>.json` returns:\n\n```json\n{\n  \"@context\": [\"https://www.w3.org/ns/did/v1\", \"...\"],\n  \"id\": \"did:nostr:\u003cpubkey>\",\n  \"alsoKnownAs\": [\"https://solid.social/alice/profile/card#me\"],\n  \"verificationMethod\": [...],\n  \"profile\": { \"name\": \"alice\", ... }\n}\n```\n\n### WebID Profile Structure\n\nThe WebID at `https://solid.social/alice/profile/card#me` contains:\n\n```json\n{\n  \"@context\": { \"owl\": \"http://www.w3.org/2002/07/owl#\", ... },\n  \"@id\": \"#me\",\n  \"@type\": \"foaf:Person\",\n  \"foaf:name\": \"alice\",\n  \"owl:sameAs\": \"did:nostr:\u003cpubkey>\"\n}\n```\n\n### Resolution Algorithm\n\n```\n1. Extract pubkey from NIP-98 event\n2. Verify Schnorr signature\n3. Fetch DID document:\n   GET https://nostr.social/.well-known/did/nostr/\u003cpubkey>.json\n4. Extract WebID from:\n   - alsoKnownAs[0] (preferred)\n   - profile.webid\n   - profile.sameAs\n5. Fetch WebID profile:\n   GET \u003cwebid> Accept: application/ld+json\n6. Check for backlink:\n   - owl:sameAs === did:nostr:\u003cpubkey>\n   - sameAs === did:nostr:\u003cpubkey>\n7. If bidirectional: return WebID\n   Else: return did:nostr:\u003cpubkey>\n```\n\n### Authentication Flow\n\n```\n┌────────┐     NIP-98      ┌────────┐    Fetch DID    ┌─────────────┐\n│ Client │ ──────────────► │  JSS   │ ──────────────► │ nostr.social│\n└────────┘                 └────────┘                 └─────────────┘\n                               │                            │\n                               │ ◄──────────────────────────┘\n                               │     DID Doc + alsoKnownAs\n                               ▼\n                          ┌────────┐\n                          │ Fetch  │\n                          │ WebID  │\n                          └────────┘\n                               │\n                               ▼\n                          ┌────────────────────┐\n                          │ Verify owl:sameAs  │\n                          │ matches did:nostr  │\n                          └────────────────────┘\n                               │\n                          ┌────┴────┐\n                          │ Match?  │\n                          └────┬────┘\n                         Yes   │   No\n                          ▼    │    ▼\n                    Return     │  Return\n                    WebID      │  did:nostr\n```\n\n---\n\n## Implementation Recipe\n\n### Step 1: Create Nostr Keypair\n\n```javascript\nimport { generateSecretKey, getPublicKey } from 'nostr-tools';\n\nconst sk = generateSecretKey();\nconst pubkey = getPublicKey(sk);\nconsole.log('Pubkey:', pubkey);\n// e.g., 3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d\n```\n\n### Step 2: Create Solid Pod\n\n```bash\ncurl -X POST https://solid.social/.pods \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"alice\", \"email\": \"alice@example.com\", \"password\": \"secret\"}'\n```\n\nResponse:\n```json\n{\n  \"webId\": \"https://alice.solid.social/profile/card#me\",\n  \"podUri\": \"https://alice.solid.social/\"\n}\n```\n\n### Step 3: Add alsoKnownAs to Nostr Profile\n\nPublish a kind 0 event with your WebID:\n\n```javascript\nimport { finalizeEvent, Relay } from 'nostr-tools';\n\nconst event = finalizeEvent({\n  kind: 0,\n  created_at: Math.floor(Date.now() / 1000),\n  tags: [],\n  content: JSON.stringify({\n    name: 'alice',\n    about: 'Solid + Nostr user',\n    alsoKnownAs: ['https://alice.solid.social/profile/card#me']\n  })\n}, sk);\n\n// Publish to relays\nconst relay = await Relay.connect('wss://relay.damus.io');\nawait relay.publish(event);\n```\n\n### Step 4: Add owl:sameAs to WebID Profile\n\nPATCH the WebID profile:\n\n```bash\ncurl -X PATCH https://alice.solid.social/profile/card \\\n  -H \"Authorization: Bearer \u003ctoken>\" \\\n  -H \"Content-Type: text/n3\" \\\n  -d '@prefix solid: \u003chttp://www.w3.org/ns/solid/terms#>.\n      @prefix owl: \u003chttp://www.w3.org/2002/07/owl#>.\n      _:patch a solid:InsertDeletePatch;\n        solid:inserts { \n          \u003c#me> owl:sameAs \u003cdid:nostr:YOUR_PUBKEY_HERE> .\n        }.'\n```\n\n### Step 5: Wait for DID Indexing\n\nnostr.social indexes Nostr profiles periodically. Check:\n\n```bash\ncurl https://nostr.social/.well-known/did/nostr/\u003cpubkey>.json | jq .alsoKnownAs\n```\n\n### Step 6: Authenticate with NIP-98\n\n```javascript\nimport { finalizeEvent } from 'nostr-tools';\n\n// Create NIP-98 auth event\nconst authEvent = finalizeEvent({\n  kind: 27235,\n  created_at: Math.floor(Date.now() / 1000),\n  tags: [\n    ['u', 'https://alice.solid.social/private/data.json'],\n    ['method', 'GET']\n  ],\n  content: ''\n}, sk);\n\n// Make authenticated request\nconst token = btoa(JSON.stringify(authEvent));\nconst res = await fetch('https://alice.solid.social/private/data.json', {\n  headers: { 'Authorization': `Nostr ${token}` }\n});\n\n// JSS resolves did:nostr → WebID automatically\n// You're now authenticated as https://alice.solid.social/profile/card#me\n```\n\n---\n\n## Caching\n\n- DID resolution results are cached for 5 minutes\n- Cache key: lowercase pubkey\n- Failed lookups are also cached to prevent hammering\n\n## Error Handling\n\n| Scenario | Result |\n|----------|--------|\n| Invalid pubkey | Return null |\n| DID doc not found | Return null, cache miss |\n| No alsoKnownAs | Return null |\n| WebID fetch fails | Return null |\n| No owl:sameAs backlink | Return null |\n| Bidirectional link valid | Return WebID |\n\nWhen resolution returns null, authentication falls back to `did:nostr:\u003cpubkey>`.\n\n## Security Considerations\n\n1. **Bidirectional proof required** - Prevents claiming arbitrary WebIDs\n2. **Signature verification first** - DID resolution only after valid NIP-98\n3. **HTTPS only** - WebID must be HTTPS\n4. **Cache prevents abuse** - Rate limits external fetches\n\n## Related\n\n- [NIP-98](https://github.com/nostr-protocol/nips/blob/master/98.md) - HTTP Auth\n- [nostr-beacon](https://github.com/nostr-labs/nostr-beacon) - DID resolver\n- [DID Core](https://www.w3.org/TR/did-core/) - W3C DID specification\n- `src/auth/did-nostr.js` - JSS implementation\n- `src/auth/nostr.js` - NIP-98 verification","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-01-03T23:52:07Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:336485f4-f6f6-87fa-d996-f78b607288f9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9288:3A1AD5:29C991C:37422A5:6B038BC7
html-safe-nonce23cb440c79771f5d5b5c38fa211c8eab8e9bde96675cf272892863e1e338a89c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Mjg4OjNBMUFENToyOUM5OTFDOjM3NDIyQTU6NkIwMzhCQzciLCJ2aXNpdG9yX2lkIjoiNDM0Mjc0ODU4MTMzMDEyNzgxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac481bda83ddc48a2c70a67dc52c2168d8205074aee49a2f7f77c63fdc09bb8bb3
hovercard-subject-tagissue:3778602930
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/42/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3237ebd8e6a7241368ae6cfd96f64e4cef828d2015891e7fac09c21120ef9cdf/JavaScriptSolidServer/JavaScriptSolidServer/issues/42
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3237ebd8e6a7241368ae6cfd96f64e4cef828d2015891e7fac09c21120ef9cdf/JavaScriptSolidServer/JavaScriptSolidServer/issues/42
og:image:altOverview This document specifies how JSS resolves did:nostr: identities to Solid WebIDs, enabling Nostr users to authenticate as their linked WebID. Specification Identity Linking A bidirec...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemelvincarvalho
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git
octolytics-dimension-user_id205442424
octolytics-dimension-user_loginJavaScriptSolidServer
octolytics-dimension-repository_id958025407
octolytics-dimension-repository_nwoJavaScriptSolidServer/JavaScriptSolidServer
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id958025407
octolytics-dimension-repository_network_root_nwoJavaScriptSolidServer/JavaScriptSolidServer
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJavaScriptSolidServer%2FJavaScriptSolidServer%2Fissues%2F42
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJavaScriptSolidServer%2FJavaScriptSolidServer%2Fissues%2F42
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=JavaScriptSolidServer%2FJavaScriptSolidServer
Reloadhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42
Reloadhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42
Reloadhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42
JavaScriptSolidServerhttps://github.com/JavaScriptSolidServer
JavaScriptSolidServerhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer
Codehttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer
Issues165 (165)https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues
Pull requests14 (14)https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/pulls
Actionshttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/actions
Projectshttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/projects
Security and qualityhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/security
Insightshttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/insights
https://github.com/JavaScriptSolidServer/JavaScriptSolidServer
New issuehttps://github.com/login?return_to=https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42
New issuehttps://github.com/login?return_to=https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42
Spec: did:nostr to WebID Resolutionhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42#top
documentationImprovements or additions to documentationhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues?q=state%3Aopen%20label%3A%22documentation%22
nostrNostr relay, did:nostr auth, NIP-relatedhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues?q=state%3Aopen%20label%3A%22nostr%22
https://github.com/melvincarvalho
melvincarvalhohttps://github.com/melvincarvalho
on Jan 3, 2026https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42#issue-3778602930
NIP-98https://github.com/nostr-protocol/nips/blob/master/98.md
nostr-beaconhttps://github.com/nostr-labs/nostr-beacon
DID Corehttps://www.w3.org/TR/did-core/
melvincarvalhohttps://github.com/melvincarvalho
nostrNostr relay, did:nostr auth, NIP-relatedhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues?q=state%3Aopen%20label%3A%22nostr%22
on May 9, 2026https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42#event-25331329204
https://github.com/melvincarvalho
melvincarvalhohttps://github.com/melvincarvalho
on May 9, 2026https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42#issuecomment-4411362589
#386https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/386
melvincarvalhohttps://github.com/melvincarvalho
documentationImprovements or additions to documentationhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues?q=state%3Aopen%20label%3A%22documentation%22
on May 12, 2026https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42#event-25413567375
Sign up for freehttps://github.com/signup?return_to=https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42
Sign in to commenthttps://github.com/login?return_to=https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/42
documentationImprovements or additions to documentationhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues?q=state%3Aopen%20label%3A%22documentation%22
nostrNostr relay, did:nostr auth, NIP-relatedhttps://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues?q=state%3Aopen%20label%3A%22nostr%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.