Skip to main content

Create DID

DIDs (Decentralized Identifiers) are a type of globally unique identifier for a resource. The DID is similar to a URL and can be resolved to a DID document which offers metadata about the identified resource. Because a DID is created in association with a public/private key pair, the controller of the private key is able to prove control of the DID and thus authenticate themselves. See Decentralized identifiers for more information.

A DID is used to identify the wallet holder in agent-to-agent interaction and is required to accept and share credentials.

Function

createDid(didRequest: DidRequest): Promise<string>

Parameters

export interface DidRequest {
organisationId: string;
name: string;
didMethod: string;
keys: DidRequestKeys;
params: Record<string, string>;
}

Fields

  • organisationId - Value from create organization.

  • name - Assign the DID a name; must be unique amongst other DIDs.

  • didMethod - (from configuration*) See the DIDs guide. - JWK - did:jwk

  • keys - Specify the keys used as verification methods for the DID being created. Since did:key and did:jwk only allow for one key to be included in the resulting DID document, the same key must be used for all methods. See the Keys object in the API guide for more information.

    • authentication - Used to identify and authenticate the DID subject.

    • assertion - Used to express claims, such as in issuing a credential.

    • keyAgreement - Used to establish confidential communications with the DID subject.

    • capabilityInvocation - Used to invoke a capability the DID subject has, such as access to update the DID document.

    • capabilityDelegation - Used to delegate a capability to another party.

  • params - Parameters to pass with DID method creation. No parameters currently supported.

Return value

The didId is returned as a string. This is the value used in the Handle invitation function during wallet interaction.