Interface DidIonCreateOptions<TKms>

Options for creating a Decentralized Identifier (DID) using the DID ION method.

interface DidIonCreateOptions<TKms> {
    gatewayUri?: string;
    publish?: boolean;
    services?: DidService[];
    verificationMethods?: DidCreateVerificationMethod<TKms>[];
}

Type Parameters

  • TKms

Hierarchy (view full)

Properties

gatewayUri?: string

Optional. The URI of a server involved in executing DID method operations. In the context of DID creation, the endpoint is expected to be a Sidetree node. If not specified, a default gateway node is used.

publish?: boolean

Optional. Determines whether the created DID should be published to a Sidetree node.

If set to true or omitted, the DID is publicly discoverable. If false, the DID is not published and cannot be resolved by others. By default, newly created DIDs are published.

See

Sidetree Protocol Specification, § Create

Example

const did = await DidIon.create({
options: {
publish: false
};
services?: DidService[]

Optional. An array of service endpoints associated with the DID.

Services are used in DID documents to express ways of communicating with the DID subject or associated entities. A service can be any type of service the DID subject wants to advertise, including decentralized identity management services for further discovery, authentication, authorization, or interaction.

See

DID Core Specification, § Services

Example

const did = await DidIon.create({
options: {
services: [
{
id: 'dwn',
type: 'DecentralizedWebNode',
serviceEndpoint: ['https://example.com/dwn1', 'https://example/dwn2']
}
]
};
verificationMethods?: DidCreateVerificationMethod<TKms>[]

Optional. An array of verification methods to be included in the DID document.

By default, a newly created DID ION document will contain a single Ed25519 verification method. Additional verification methods can be added to the DID document using the verificationMethods property.

See

DID Core Specification, § Verification Methods

Example

const did = await DidIon.create({
options: {
verificationMethods: [
{
algorithm: 'Ed25519',
purposes: ['authentication', 'assertionMethod']
},
{
algorithm: 'Ed25519',
id: 'dwn-sig',
purposes: ['authentication', 'assertionMethod']
}
]
};