...
This document is a Draft Deliverable of the ToIP Foundation Technical Stack Working Group.
The current version is Working Draft 0203.
Introduction
This is a specification for an extension to the W3C Decentralized Identifiers (DIDs) 1.0 specification to support the resource
parameter as listed in the W3C DID Specification Registries 1.0. It specifies the syntax and normative behavior for usage of the parameter and the requirements for DID methods that support the parameter.
...
However an exception to this normal 2-step resolution/dereferencing process is when the DID itself identifies a digital resource that can be returned directly from by the VDR of the associated DID method. This behavior may be desirable:
...
- The DID document is not retrieved by the resolver as part of the dereferencing process. Rather the resolver makes a call to the VDR with the DID URL including a
resource
parameter conformant with this specification. The VDR then follows the specification of the associated DID method to retrieve the identified digital resource and return that resource to the resolver directly. - The
resource
parameter serves a different purpose than thealsoKnownAs
parameter. The purpose of thealsoKnownAs
parameter is to map a DID to an alternative identifier for the same DID subject. This alternative identifier can be any other URI, e.g., a URL, or a URN, or another DID. When the DID is resolved, the value of thealsoKnownAs
parameter is returned as a property of the DID document. It is then up to the client to decide what action to take with this alternative identifier. For example, if the value is a URL, the client may choose to dereference this URL to retrieve the identified Web resource. In this case, the thealsoKnownAs
parameter essentially serves as a redirection mechanism managed by the DID controller. By contrast, theresource
parameter:- Does not involve an alternative identifier for the DID subject. The DID is the only identifier needed. (Although the DID document may still include an
alsoKnownAs
parameter if desired.) - Does not involve any redirection. The DID directly identifies the target digital resource.
- Does not require a separate dereferencing step. The DID URL is effectively resolved and dereferenced in one step.
- Does not involve a service endpoint in the associated DID document. In fact the use of any content in the DID document (other than the DID itself) is an anti-pattern because the purpose of the
resource
parameter is to enable a DID URL to resolve directly to the digital resource—including the ability to specify the requested media type of the resource—so that developers are completely abstracted from the mechanics of how the VDR actually returns the identified resource to the requesting DID resolver.
- Does not involve an alternative identifier for the DID subject. The DID is the only identifier needed. (Although the DID document may still include an
The Resource Parameter
To enable this combined resolution/dereferencing behavior, this specification defines a DID URL parameter named resource
. If a DID method specification supports this parameter, and if a DID URL using that method includes the parameter with a valid value (either true
or a valid media type name), then when a resolver calls the associated VDR using that DID URL, the VDR returns the identified digital resource, not the DID document.
IMPORTANT: A DID URL that includes the resource
parameter still has an associated parameter does still have an associated DID document like any other DID. However this if the DID URL includes the resource
parameter, the associated DID document is not involved in the combined resolution/dereferencing step. If the DID alone is resolved (without the resource parameter), it will still return the associated DID document. There is nothing special about this DID document. It still describes and controls interactions with the identified digital resource just like any other DID document. For example:
...
- A Boolean value of
true
. The parameter value oftrue
MUST be case-sensitive and MUST be spelled out exactly. No other renderings oftrue
, i.e.T
,TRUE
,1
,-1
, and so forth — are equivalent. - A valid media type name. If the VDR supports the storage of the resource in multiple media types, this option enables the client to request return of a specific media type.
Examples
Without a Path Component
Following are examples of DID URLs that use the resource
parameter but do not include a path component. These examples are based on the fictional did:example:
DID method that include supports the resource
parameter:
did:example:21tDAKCERh95uGgKbJNHYp?resource=true
...
did:example:21tDAKCERh95uGgKbJNHYp?resource=cbor
With a Path Component
The next set of examples are DID URLs that use the resource
parameter and include a path component. In this case the target resource identified by the path component is relative to the resource identified by the DID itself. This pattern supports the ability of a VDR to organize digital resources in structures such as directory trees, collections, databases, and so on.
did:example:21tDAKCERh95uGgKbJNHYp/some/path?resource=true
did:example:21tDAKCERh95uGgKbJNHYp/some/longer/path?resource=json
did:example:21tDAKCERh95uGgKbJNHYp/uuid:33ad7beb-1abc-4a26-b892-466df4379a51/?resource=ld+json
did:example:21tDAKCERh95uGgKbJNHYp/resources/uuid:33ad7beb-1abc-4a26-b892-466df4379a51/?resource=cbor
DID Resolver and Verifiable Data Registry (VDR) Requirements
- If a DID URL includes the
resource
parameter with a value oftrue
, a conforming DID resolver MUST return the default media type of the digital resource identified by the DID from the VDR specified by the associated DID method provided such resource is available.- If the DID resolver is unable to return the identified resource, the resolver MUST return the error "
Resource not found
".
- If the DID resolver is unable to return the identified resource, the resolver MUST return the error "
- If a DID URL includes the
resource
parameter with a value of a valid media type name, a conforming DID resolver MUST return the requested media type of the digital resource identified by the DID from the VDR specified by the associated DID method provided such resource is available.- If the DID resolver is unable to return the identified resource in the requested media type, the resolver MUST return the error "
Resource not found
".
- If the DID resolver is unable to return the identified resource in the requested media type, the resolver MUST return the error "
- If a DID URL includes the
resource
parameter with a value offalse
, a conforming DID resolver SHOULD ignore the parameter. - If the DID alone alone is resolved resolved without the
resource
parameter, it MUST return the authoritative DID authoritative DID document as defined in in W3C Decentralized Identifiers (DIDs) 1.0. This specification adds no additional requirements to a conforming DID document.
DID Method Requirements
A DID method specification conforming to this specification to include support for the resource
parameter:
- MUST define:
- How the associated VDR shall map the DID to the identified digital resource in and the identified media type.
- If the DID URL includes a path component, how the VDR shall process this path component in mapping to the identified resource.
- If the
resource
parameter has a value oftrue
, how the VDR shall determine the default media type. - How the VDR shall return the resource in response to a request from a conforming DID resolver.
- MUST define how this parameter will interact with the following additional DID parameters defined in section 3.2.1 of the DID Core Specification.
- versionId
- If the
versionId
parameter is included in the DID URL, the resolver MUST return the identified version of the identified digital resource. - If the identified version does not exist, the resolver MUST return the error: "
Version not found
".
- If the
- versionTime
- If the
versionTime
parameter is included in the DID URL, the resolver MUST return the identified version of the identified digital resource. - If the identified version does not exist, the resolver MUST return the error: "
Version not found
".
- If the
- versionId
- SHOULD include in the associated DID document an
alsoKnownAs
property containing at least one value that is a hashlink to the identified digital resource. This provides additional cryptographic verification of the binding between the DID and the identified digital resource. - SHOULD NOT define any additional DID document properties to properties—such as a special service endpoint—to enable dereferencing to the target digital resource. This is an anti-pattern. The best practice because it requires DID controllers to add custom properties to their DID documents in order to use the
resource
parameter. A much better solution is to store the mapping between the the DID and the identified digital resource within the VDR itself (and specify how this works in the DID method specification). This way the the VDR can evolve its internal storage mechanisms without requiring DID controllers to make any changes to their DID documents.
...
The authors wish to thank the editors and contributors to the W3C Decentralized Identifiers (DIDs) 1.0 specification and and in particular co-editor Amy Guy for her help. Also thanks to the cheqd team of Ankur Banerjee and Alex Tweeddale for their suggestions about including support for the DID path component.
Licensing
This is a publicly available specification published by the ToIP Foundation under the following licenses:
...