The Universal Resolver enables the resolution of many different types ("methods") of Decentralized Identifiers (DIDs), using a common interface.
It offers an HTTP(S) binding to the DID Resolution function, which is defined in the W3C CCG's DID Resolution specification.
The Universal Resolver can return DID documents in various representations (JSON, JSON-LD, CBOR), as well as full DID resolution results (DID documents plus metadata).
Besides resolving DIDs, another supported function is dereferencing DID URLs, including support for various parameters and fragments.
See https://api.godiddy.com/#tag/Universal-Resolver
When resolving DIDs, the input is a DID plus resolution options, and the output is the DID document plus metadata.
A request without Accept
header (default value) will return the full DID resolution result (DID document plus metadata):
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-X GET "https://api.godiddy.com/1.0.0/universal-resolver/identifiers/did:indy:sovrin:WRfXPg8dantKVubE3HX8pw"
A request with an Accept
header set to application/ld+json;profile="https://w3id.org/did-resolution"
will also return the full DID resolution result (DID document plus metadata):
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Accept: application/ld+json;profile=\"https://w3id.org/did-resolution\"" \
-X GET "https://api.godiddy.com/1.0.0/universal-resolver/identifiers/did:indy:sovrin:WRfXPg8dantKVubE3HX8pw"
A request with an Accept
header set to application/did+ld+json
will return only the DID document in the JSON-LD representation:
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Accept: application/did+ld+json" \
-X GET "https://api.godiddy.com/1.0.0/universal-resolver/identifiers/did:indy:sovrin:WRfXPg8dantKVubE3HX8pw"
A request with an Accept
header set to application/did+cbor
will return only the DID document in the CBOR representation:
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Accept: application/did+cbor" \
-X GET "https://api.godiddy.com/1.0.0/universal-resolver/identifiers/did:indy:sovrin:WRfXPg8dantKVubE3HX8pw"
When dereferencing, the input is a DID URL plus dereferencing options, and the output is the DID document, or part of a DID document, or other resource.
A request for a URL-encoded DID URL with a fragment will return only the part of the DID document that is identified by the fragment, e.g. a verification method:
did:indy:sovrin:WRfXPg8dantKVubE3HX8pw#verkey
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Accept: application/did+ld+json" \
-X GET "https://api.godiddy.com/1.0.0/universal-resolver/identifiers/did%3Aindy%3Asovrin%3AWRfXPg8dantKVubE3HX8pw%23verkey"
Note that DID URLs with fragments are supported for all DID methods.
service
and relativeRef
parametersA request for a DID URL with these parameters will select one or more service(s) from the DID document and then construct a service endpoint URL using a relative URI reference:
did:web:danubetech.com?service=github&relativeRef=did-method-dns
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Accept: text/uri-list" \
-X GET "https://api.godiddy.com/1.0.0/universal-resolver/identifiers/did:web:danubetech.com?service=github&relativeRef=did-method-dns"
Note that the service
and relativeRef
parameters are supported for all DID methods, and the format and meaning of their values are independent of the DID method.
→ See the DID Core specification for additional information about these parameters.
transformKeys
parameterA request for a DID URL with this parameter that will transform the verification methods in the DID document to the requested format:
did:indy:sovrin:WRfXPg8dantKVubE3HX8pw?transformKeys=JsonWebKey2020
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Accept: application/did+ld+json" \
-X GET "https://api.godiddy.com/1.0.0/universal-resolver/identifiers/did:indy:sovrin:WRfXPg8dantKVubE3HX8pw?transformKeys=JsonWebKey2020"
Similar to the previous example, but adding a fragment #verkey
to the DID URL:
did:indy:sovrin:WRfXPg8dantKVubE3HX8pw?transformKeys=JsonWebKey2020#verkey
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Accept: application/did+ld+json" \
-X GET "https://api.godiddy.com/1.0.0/universal-resolver/identifiers/did%3Aindy%3Asovrin%3AWRfXPg8dantKVubE3HX8pw%3FtransformKeys%3DJsonWebKey2020%23verkey"
Another example of a DID URL with this parameter that will transform the verification methods in the DID document to the requested format:
did:ebsi:zwkqocXfSsfokNFcrSng8cM?transformKeys=jwks
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Accept: application/jwk-set+json" \
-X GET "https://api.godiddy.com/1.0.0/universal-resolver/identifiers/did:ebsi:zeq8HUiJfnbvEKyum5XYscv?transformKeys=jwks"
Note that the transformKeys
parameter is supported for all DID methods, and the format and meaning of its values are independent of the DID method.
→ See the transformKeys specification for additional information about this parameter.
versionId
parameterA request for a DID URL with this parameter will retrieve the specific version 105
of the DID document:
did:indy:sovrin:DjxRxnL4gXsncbH8jM8ySM?versionId=105
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Accept: application/did+ld+json" \
-X GET "https://api.godiddy.com/1.0.0/universal-resolver/identifiers/did:indy:sovrin:DjxRxnL4gXsncbH8jM8ySM?versionId=105"
A request for a DID URL with this parameter will retrieve the specific version 1984
of the DID document:
did:indy:sovrin:DjxRxnL4gXsncbH8jM8ySM?versionId=1984
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Accept: application/did+ld+json" \
-X GET "https://api.godiddy.com/1.0.0/universal-resolver/identifiers/did:indy:sovrin:DjxRxnL4gXsncbH8jM8ySM?versionId=1984"
Note that the versionId
parameter is not supported for all DID methods, and the format and meaning of its values are specific to the DID method.
→ See the DID Core specification for additional information about this parameter.
versionTime
parameterA request for a DID URL with this parameter will retrieve the version at the time 2018-12-10T02:22:49Z
of the DID document:
did:indy:sovrin:DjxRxnL4gXsncbH8jM8ySM?versionTime=2018-12-10T02:22:49Z
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Accept: application/did+ld+json" \
-X GET "https://api.godiddy.com/1.0.0/universal-resolver/identifiers/did:indy:sovrin:DjxRxnL4gXsncbH8jM8ySM?versionTime=2018-12-10T02:22:49Z"
A request for a DID URL with this parameter will retrieve the version at the time 2018-12-15T23:20:28Z
of the DID document:
did:indy:sovrin:DjxRxnL4gXsncbH8jM8ySM?versionTime=2018-12-15T23:20:28Z
curl -H "Authorization: Bearer b082c420-df67-4b06-899c-b7c51d75fba0" \
-H "Accept: application/did+ld+json" \
-X GET "https://api.godiddy.com/1.0.0/universal-resolver/identifiers/did:indy:sovrin:DjxRxnL4gXsncbH8jM8ySM?versionTime=2018-12-15T23:20:28Z"
Note that the versionTime
parameter is not supported for all DID methods, but if it is supported, then the format and meaning of its values are independent of the DID method.
→ See the DID Core specification for additional information about this parameter.