Format that documents the key material and metadata of a Decentralized Identifier (DID) to enable usage of the DID in different contexts.

This format is useful for exporting, saving to a file, or importing a DID across process boundaries or between different DID method implementations.

Example

// Generate a new DID.
const did = await DidExample.create();

// Export to a PortableDid.
const portableDid = await did.export();

// Instantiate a BearerDid object from a PortableDid.
const importedDid = await DidExample.import(portableDid);
// The `importedDid` object should be equivalent to the original `did` object.
interface PortableDid {
    document: DidDocument;
    metadata: DidMetadata;
    privateKeys?: Jwk[];
    uri: string;
}

Hierarchy (view full)

Properties

document: DidDocument

The DID document associated with this DID.

metadata: DidMetadata

Represents metadata about a DID resulting from create, update, or deactivate operations.

privateKeys?: Jwk[]

An optional array of private keys associated with the DID document's verification methods.

uri: string

A string representation of the DID.

A DID is a URI composed of three parts: the scheme did:, a method identifier, and a unique, method-specific identifier specified by the DID method.