Represents a Decentralized Web Node (DWN) service in a DID Document.

A DWN DID service is a specialized type of DID service with the type set to DecentralizedWebNode. It includes specific properties enc and sig that are used to identify the public keys that can be used to interact with the DID Subject. The values of these properties are strings or arrays of strings containing one or more verification method id values present in the same DID document. If the enc and/or sig properties are an array of strings, an entity interacting with the DID subject is expected to use the verification methods in the order they are listed.

Example

const service: DwnDidService = {
id: 'did:example:123#dwn',
type: 'DecentralizedWebNode',
serviceEndpoint: 'https://dwn.tbddev.org/dwn0',
enc: 'did:example:123#key-1',
sig: 'did:example:123#key-2'
}

See

DIF Decentralized Web Node (DWN) Specification

interface DwnDidService {
    enc?: string | string[];
    id: string;
    serviceEndpoint: DidServiceEndpoint | DidServiceEndpoint[];
    sig: string | string[];
    type: string;
}

Hierarchy (view full)

Properties

enc?: string | string[]

One or more verification method id values that can be used to encrypt information intended for the DID subject.

id: string

Identifier of the service.

The id property is REQUIRED. It MUST be a URI conforming to RFC3986 and MUST be unique within the DID document.

A URI that can be used to interact with the DID service.

The value of the serviceEndpoint property MUST be a string, an object containing key/value pairs, or an array composed of strings or objects. All string values MUST be valid URIs conforming to RFC3986.

sig: string | string[]

One or more verification method id values that will be used by the DID subject to sign data or by another entity to verify signatures created by the DID subject.

type: string

The type of service being described.

The type property is REQUIRED. It MUST be a string. To maximize interoperability, the value SHOULD be registered in the DID Specification Registries. Examples of service types can be found in § Service Types.