Skip to content

Use CID v1.0 @context in served did:nostr docs so Multikey is defined#569

Merged
melvincarvalho merged 2 commits into
gh-pagesfrom
issue-568-cid-context
Jun 16, 2026
Merged

Use CID v1.0 @context in served did:nostr docs so Multikey is defined#569
melvincarvalho merged 2 commits into
gh-pagesfrom
issue-568-cid-context

Conversation

@melvincarvalho

Copy link
Copy Markdown
Contributor

Closes #568.

src/idp/well-known-did-nostr.js serves DID documents with "type": "Multikey" + publicKeyMultibase, but the @context (https://w3id.org/did + nostr/context) defines neither, and https://w3id.org/did returns text/html rather than a JSON-LD context.

-    '@context': ['https://w3id.org/did', 'https://w3id.org/nostr/context'],
+    '@context': ['https://www.w3.org/ns/cid/v1', 'https://w3id.org/nostr/context'],

Multikey / publicKeyMultibase are defined only in Controlled Identifiers v1.0 (https://www.w3.org/ns/cid/v1) — which jss already uses in src/keys/provision.js:141, so this also removes an internal inconsistency. Mirrors nostrcg/did-nostr#91. Safe: nothing asserts the literal @context; auth/resolution match on the verification method, not the context.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the served did:nostr DID document JSON-LD context to use the Controlled Identifiers v1.0 context so that Multikey / publicKeyMultibase are properly defined, aligning served documents with the project’s existing Multikey document shape.

Changes:

  • Switch DID document @context from https://w3id.org/did to https://www.w3.org/ns/cid/v1 in the did:nostr well-known handler.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 500 to 502
return {
'@context': ['https://w3id.org/did', 'https://w3id.org/nostr/context'],
'@context': ['https://www.w3.org/ns/cid/v1', 'https://w3id.org/nostr/context'],
'id': did,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 114d787.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ melvincarvalho
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

@melvincarvalho
melvincarvalho merged commit 3d4f947 into gh-pages Jun 16, 2026
1 check was pending
@melvincarvalho
melvincarvalho deleted the issue-568-cid-context branch June 16, 2026 08:33
melvincarvalho added a commit that referenced this pull request Jun 16, 2026
Bundles three fixes merged since 0.0.208:

- fix(nostr): NIP-98 payload hash verifies the raw request bytes instead
  of a re-serialization, so binary/whitespace-sensitive bodies validate
  (#573, closes #565)
- feat(idp): served did:nostr documents use the CID v1.0 @context so
  Multikey / publicKeyMultibase are actually defined (#569)
- feat(cli): `jss start` shifts off a busy port (Vite-style) instead of
  crashing on EADDRINUSE, and prints an openable banner URL
  (#574, closes #557)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

did did:nostr method spec + implementation alignment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Served did:nostr docs use Multikey but @context does not define it (use cid/v1)

4 participants