Skip to content

Profile-to-key linking aligned with LWS 1.0 (FPWDs 2026-04-23) via W3C Controlled Identifiers v1.0 #386

Closed

Description

@melvincarvalho

Tracker for converging the existing profile/key-linking issues (#42, #6, #4, #39, #86, #319) onto the W3C Linked Web Storage 1.0 Authentication Suite FPWDs published 2026-04-23 — and on the substrate they delegate to, W3C Controlled Identifiers v1.0.

This issue does not propose a new design from scratch. It captures the design that fell out of reading the LWS FPWDs against JSS's current state, so future PRs can reference one place.


Key insight

LWS auth FPWDs delegate identity-document semantics to W3C Controlled Identifiers 1.0. A WebID becomes LWS-conformant for self-signed auth (LWS10-CID, LWS10-did:key) by being a valid CID document — i.e. by carrying verificationMethod, authentication, assertionMethod, controller, publicKeyJwk/publicKeyMultibase triples. No separate DID document needed for the WebID-controlled case.

This converges several historically separate JSS workstreams onto one mechanism.


Current JSS state

src/webid/profile.js already declares cid: and lws: prefixes (prep work landed) but writes zero verification material. The path to conformance is additive — no breaking changes to existing profiles.


Proposed profile shape

A WebID with three keys: a Nostr secp256k1 (NIP-98), a did:key Ed25519 (LWS10), and a passkey/WebAuthn credential.

{
  "@context": [
    "https://www.w3.org/ns/cid/v1",
    {
      "foaf": "http://xmlns.com/foaf/0.1/",
      "solid": "http://www.w3.org/ns/solid/terms#",
      "schema": "http://schema.org/",
      "pim": "http://www.w3.org/ns/pim/space#",
      "ldp": "http://www.w3.org/ns/ldp#",
      "owl": "http://www.w3.org/2002/07/owl#",
      "lws": "https://www.w3.org/ns/lws#",
      "nostr": "https://w3id.org/nostr/vocab#",
      "alsoKnownAs": { "@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs", "@type": "@id" },
      "sameAs":      { "@id": "owl:sameAs", "@type": "@id" }
    }
  ],
  "id": "https://alice.solid.social/profile/card.jsonld#me",
  "type": ["foaf:Person"],
  "controller": "https://alice.solid.social/profile/card.jsonld#me",

  "verificationMethod": [
    { "id": "...#nostr-key-1",  "type": "Multikey",   "controller": "...#me", "publicKeyMultibase": "fe70102…" },
    { "id": "...#did-key-1",    "type": "Multikey",   "controller": "...#me", "publicKeyMultibase": "z6MkpT…"  },
    { "id": "...#passkey-1",    "type": "JsonWebKey", "controller": "...#me", "publicKeyJwk": { "kty": "EC", "crv": "P-256", "x": "…", "y": "…" } }
  ],
  "authentication":   ["...#nostr-key-1", "...#did-key-1", "...#passkey-1"],
  "assertionMethod":  ["...#did-key-1"],

  "alsoKnownAs": ["did:nostr:124c0…", "did:key:z6Mk…"],
  "sameAs":      "did:nostr:124c0…"
}

Notes:

  • https://www.w3.org/ns/cid/v1 is the first @context entry. CID-aware verifiers process this directly; existing JSS predicates (oidcIssuer, pim:storage, ldp:inbox, service, …) live in the inline prefix object so JSON-LD output is byte-stable for everything else.
  • Nostr secp256k1 uses did:nostr's multikey recipe (parity byte + multicodec 0xe7,0x01 + base16-lower) so a NIP-98 verifier can decode straight to the 32-byte x-only key without dereferencing a DID document.
  • alsoKnownAs is the forward link to DID URIs (matches did:nostr's conventional binding); sameAs keeps the existing src/auth/did-nostr.js resolver working unchanged.

Verification flow (key K → WebID W)

  1. Identify subject from credential: sub (LWS-CID JWT), pubkey hex (NIP-98), DID URI (did:key), credential ID (WebAuthn)
  2. Fetch the WebID profile (which is the CID document)
  3. Find matching verificationMethod — by kid for JWT, by raw key match for NIP-98
  4. Confirm it appears in authentication (or assertionMethod for credential issuance)
  5. Verify the cryptographic proof using that key
  6. Confirm the verification method's controller is W (or W is its own controller)

This is profile-only for LWS-CID and WebAuthn; profile-or-DID-doc for did:nostr (existing two-way owl:sameAs ↔ alsoKnownAs from #42); DID-doc-only for did:key (the DID is the public key).


Migration path

Smallest delta — ~80–120 LOC:

Change Where
Switch @context to array form so cid/v1 is the imported context src/webid/profile.js:generateProfileJsonLd
Accept keys[] parameter; emit verificationMethod + authentication (+ optional assertionMethod) when supplied same
Pass keys through from signup (nostr pubkey, did:key, passkey credential) src/handlers/container.js:createPodStructure, src/idp/interactions.js registration paths
jss migrate add-keys admin command to upgrade existing pods (idempotent merge — only adds triples) new bin/jss.js subcommand

Back-compat: profiles created without keys are byte-identical to today. Existing JSS resolvers (did-nostr, webid-tls) continue to work; the new design generalises the WebID-TLS pattern (cert:key → verificationMethod).


Open spec choices (FPWDs don't bind us; we get to decide)

# Question Suggested default
1 Profile vs DID-doc primary WebID is canonical for LWS-CID; DID docs supplementary via alsoKnownAs
2 kid fragment shape #<purpose>-<n>, never reuse after revocation
3 Key rotation Append-only verificationMethod; revoked keys removed from authentication but stay with expirationDate
4 NIP-98 Schnorr inside CID's Multikey Use did:nostr's encoding verbatim; no NostrPublicKey extension
5 Passkey/WebAuthn vocabulary JsonWebKey (P-256 EC); credentialId stays in private account record, not profile
6 alsoKnownAs provenance Bidirectional check for did:nostr (existing); trust WebID-side for did:key (no DID doc)
7 controller self-reference vs delegation Self-control only for v1; delegation/recovery later
8 Recovery keys lws:recoveryMethod extension until standardised
9 assertionMethod membership Only did:key for now (Schnorr/passkey are auth-only in practice)
10 Profile MIME content negotiation Existing application/ld+json at profile/card.jsonld already conforms

Phasing

This tracker captures design. Concrete shippable phases:

Phase 1 — Profile emits keys (PR-shaped):

  • src/webid/profile.js accepts keys[]; emits CID triples
  • @context array form
  • New pods at signup get the keys they registered with
  • No verifier-side changes yet — purely additive
  • Tests for the JSON-LD structure

Phase 2 — Migration command:

  • jss migrate add-keys to upgrade existing pods
  • Idempotent; safe to re-run

Phase 3 — LWS10-CID verifier:

Phase 4 — Cross-protocol unification:


Refs

Converges these issues

Activity

  1. added
    nostr
    enhancement
    on May 9, 2026
  2. melvincarvalho commented on May 9, 2026

    @melvincarvalho
    ContributorAuthor

    Phase 3a now scoped: focused implementation issues filed for the LWS10-CID JWT path (the verifier this tracker's Phase 3 calls for):

    Strategy: same secp256k1 key, two signature schemes — Schnorr/BIP-340 stays for Nostr-native paths (NIP-98, did:nostr, future bip340-jcs-2025 VC signing), ECDSA/ES256K is the LWS10-CID HTTP auth path. Both VMs coexist in the profile (Multikey for the Schnorr side per the B.2 work, JsonWebKey for the ES256K side from B.3). No new key material; users keep their Nostr identity.

    Doctor and JSS verifier developed together so each validates real output from the other before merging. After this lands, JSS is a strict LWS10-CID server and the doctor is the first LWS10-CID client.

  3. melvincarvalho commented on May 9, 2026

    @melvincarvalho
    ContributorAuthor

    Phase 4 (cross-protocol unification) gets its first concrete instance: #399 — NIP-98 verifier upgrades did:nostr:<pubkey> to a WebID via the same VM lookup the LWS10-CID verifier (#397/#398) does. Once it lands, OIDC/DPoP, LWS-CID, NIP-98 all share one K→W primitive. Doctor B.2's f-form Multikey VM is what gets matched on, so any user who's already used B.2 gets WebID-based NIP-98 auth automatically.

  4. melvincarvalho commented on Oct 14, 2026

    @melvincarvalho
    ContributorAuthor

    Closing as shipped. Phases A (profile shape, #388 / v0.0.174), B (keys via the doctor), and 3 (LWS-CID JWT verifier, #398 / v0.0.177) all landed, plus the NIP-98 → WebID upgrade (#400 / v0.0.178) and --provision-keys (#437, #443). Current state is documented in docs/lws.md.

    Still open from this tracker's phasing: migration of existing on-disk profiles (#396) and the turtle-conneg blockers (#389, #390). Protocol-level LWS work continues in #621 — note that the auth model has since moved to subject-token exchange via an authorization server, so the verifier here becomes one subject-token verifier among several rather than the whole story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementnostr

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions