Interface DidUrlDereferencer

Represents the interface for dereferencing a DID URL to a specific resource within a DID document.

The DidUrlDereferencer interface defines a single method, dereference, which takes a DID URL as input and returns a Promise that resolves to a DidDereferencingResult. This result includes the dereferenced resource (if found) and metadata about the dereferencing process.

Dereferencing a DID URL involves parsing the URL to identify the specific part of the DID document being referenced, which could be a verification method, a service endpoint, or the entire document itself.

Implementations of this interface must adhere to the dereferencing mechanisms defined in the DID Core specifications, handling various components of the DID URL including the DID itself, path, query, and fragment.

More information on DID URL dereferencing can be found in the DID Core specification.

Example

const dereferenceResult = await didUrlDereferencer.dereference('did:example:123456789abcdefghi#keys-1');
interface DidUrlDereferencer {
    dereference(didUrl, options?): Promise<DidDereferencingResult>;
}

Implemented by

Methods

Methods

  • Dereferences a DID (Decentralized Identifier) URL to a corresponding DID resource.

    This method interprets the DID URL's components, which include the DID method, method-specific identifier, path, query, and fragment, and retrieves the related resource as per the DID Core specifications.

    Parameters

    • didUrl: string

      The DID URL string to dereference.

    • Optional options: DidDereferencingOptions

      Input options to the dereference function. Optional.

    Returns Promise<DidDereferencingResult>

    a DidDereferencingResult