Skip to main content

DID Resolver

Interactive example​

Resolve DID documents from EBSI Decentralized Identifiers (DIDs) using our libraries.

Paste a DID or .

info

The DID document is loaded from the DID Registry service of the Core API. Read DID Method for Legal Entities for more information.


Library​

The resolver is built on the open-source did-resolver library (v6) and two EBSI drivers:

PackageDID methodUsage
@europeum-ebsi/ebsi-did-resolverdid:ebsigetResolver({ registry }), where registry is the URL of the DID Registry identifiers endpoint
@europeum-ebsi/key-did-resolverdid:keygetResolver(), which takes no options

Both packages also export a util object:

  • util.createDid(...) creates a DID from a subject identifier (did:ebsi) or from a public key JWK (did:key).
  • util.validateDid(did) checks that a DID is well formed.
import { Resolver } from "did-resolver";
import { getResolver as getEbsiResolver } from "@europeum-ebsi/ebsi-did-resolver";
import { getResolver as getKeyResolver } from "@europeum-ebsi/key-did-resolver";

const didResolver = new Resolver({
...getEbsiResolver({
registry: "https://api-test.testnode02.ebsi.eu/v1/did-registry/identifiers",
}),
...getKeyResolver(),
});

const { didDocument } = await didResolver.resolve(
"did:ebsi:zvHWX359A3CvfJnCYaAiAde",
);

DID URL parameters​

The did:ebsi resolver supports two query parameters on the DID:

  • versionTime: resolve the DID document as it was at the given time (for example did:ebsi:z...?versionTime=2025-01-01T00:00:00Z).
  • contractAddress: resolve the DID from a specific DID Registry contract instance. It takes precedence over the contractAddress resolution option.

Errors​

Resolution failures are returned in didResolutionMetadata.error (for example invalidDid, notFound, or configurationError). When the registry answers with an RFC 9457 problem document, the message lists each entry of its errors member as pointer: detail.

For local development, a registry on localhost or 127.0.0.1 is reached over http:// instead of https://.