Decentralized Identifiers, or DIDs, constitute a novel identifier class designed to facilitate verifiable, decentralized digital identities. Within the zCloak's SDK, the @zcloak/did module delivers an arsenal of tools designed for creating, managing, and resolving DIDs.

Integration steps

  1. Installation: yarn add @zcloak/did
  2. Import the necessary classes and functions.
import { helpers } from '@zcloak/did';
import { keys } from '@zcloak/did';
...

Key Classes and Functions

DidDetails Class

The DidDetails class, implementing the IDidDetails interface, represents the DID Document. It provides a collection of methods designed for handling the DID Document.

export abstract class DidDetails implements IDidDetails {
  public id: DidUrl;
  public identifier: string;
  public controller: Set<DidUrl>;
  public keyRelationship: Map<DidUrl, KeyRelationship>;
  public authentication?: Set<DidUrl>;
  public assertionMethod?: Set<DidUrl>;
  public keyAgreement?: Set<DidUrl>;
  public capabilityInvocation?: Set<DidUrl>;
  public capabilityDelegation?: Set<DidUrl>;
  public service?: Map<string, Service>;
  //...
 }

Key methods include:

getKeyUrl(params)

 public getKeyUrl(key: DidKeys): DidUrl {
  // ......
 }

get(params)

 public get(id: DidUrl): KeyRelationship {
  // ......
 }