/** * DID Document types based on W3C DID Core specification * Reference: https://www.w3.org/TR/did-core/ * DID Method Web: https://w3c-ccg.github.io/did-method-web/ */ /** * JSON Web Key (JWK) representation for public keys */ export interface JsonWebKey { kty:string crv?:string x?:string y?:string e?:string n?:string [key:string]:unknown } /** * Verification Method - cryptographic public key used for authentication, assertion, etc. */ export interface VerificationMethod { id:string type:string controller:string publicKeyJwk?:JsonWebKey publicKeyMultibase?:string publicKeyBase58?:string publicKeyHex?:string blockchainAccountId?:string ethereumAddress?:string [key:string]:unknown } /** * Verification Relationship - can be a string reference or embedded verification method */ export type VerificationRelationship = string|VerificationMethod /** * Service endpoint for DID subject */ export interface Service { id:string type:string|string[] serviceEndpoint:string|string[]|Record [key:string]:unknown } /** * DID Document as defined by W3C DID Core specification */ export interface DidDocument { /** * JSON-LD context(s) - must include "https://www.w3.org/ns/did/v1" */ '@context'?:string|string[]|Record /** * The DID subject (required) */ id:string /** * Alternative identifiers for the DID subject */ alsoKnownAs?:string[] /** * DID controller(s) - entities authorized to make changes to this DID document */ controller?:string|string[] /** * Verification methods - public keys and their metadata */ verificationMethod?:VerificationMethod[] /** * Authentication verification relationships * Used to prove control of the DID */ authentication?:VerificationRelationship[] /** * Assertion method verification relationships * Used to express claims (e.g., issue Verifiable Credentials) */ assertionMethod?:VerificationRelationship[] /** * Key agreement verification relationships * Used for key exchange protocols (e.g., encryption) */ keyAgreement?:VerificationRelationship[] /** * Capability invocation verification relationships * Used to invoke capabilities or perform operations */ capabilityInvocation?:VerificationRelationship[] /** * Capability delegation verification relationships * Used to delegate capabilities */ capabilityDelegation?:VerificationRelationship[] /** * Services - endpoints for interacting with the DID subject */ service?:Service[] /** * Additional properties allowed by the DID specification */ [key:string]:unknown } /** * DID Resolution Metadata */ export interface DidResolutionMetadata { contentType?:string error?:'invalidDid'|'notFound'|'representationNotSupported'|string [key:string]:unknown } /** * DID Document Metadata */ export interface DidDocumentMetadata { created?:string updated?:string deactivated?:boolean nextUpdate?:string versionId?:string nextVersionId?:string equivalentId?:string[] canonicalId?:string [key: string]:unknown } /** * DID Resolution Result */ export interface DidResolutionResult { '@context'?:string|string[] didResolutionMetadata:DidResolutionMetadata didDocument:DidDocument|null didDocumentMetadata:DidDocumentMetadata }