Skip to main content

Module did

Module did 

Source
Expand description

did:web4 — the W3C DID interop face of an LCT.

Projects an LCT into a conformant DID Document (identifier + keys + endpoints) so the existing DID / VC / EUDI ecosystem can resolve a Web4 entity. The DID Document is a lossy view — the identifier-and-keys slice; Web4’s trust/relationship layer (T3/V3, MRH, witnessing, ATP) has no DID representation by design and is reached only via the Web4Hub service.

Design note: docs/designs/did-web4-mapping.md. This module is generic and public-eligible — it exposes only what DID standardizes; no novel mechanism.

Identifier syntax: did:web4:<authority>:<lct-uuid>, where <authority> is the resolving hub host. Resolution returns a hub-signed pubkey binding, making did:web4 resolution attested (vs did:web’s TLS-only trust).

Structs§

DidDocument
A W3C DID Core 1.0 conformant DID Document — the public projection of an LCT.
DidDocumentMetadata
DID document metadata — carries deactivation, per the DID Resolution spec.
Service
ServiceEndpoints
Optional service endpoints to advertise in the DID Document.
VerificationMethod

Functions§

did_web4
Build a did:web4 identifier string.
ed25519_multikey
Encode a 32-byte Ed25519 public key as a Multikey publicKeyMultibase string: multicodec ed25519-pub (0xed 0x01) + key, base58btc, ‘z’ prefix. Yields the standard z6Mk... form.
parse_did_web4
Parse a did:web4:<authority>:<uuid> identifier into its parts.