In the world of decentralized identifiers, dereferencing is a fundamental process that enables resources to be retrieved using DIDs. This document explains the core concepts of DID URL dereferencing, how it differs from DID resolution, and why it matters within the Vidos ecosystem.
DID URL dereferencing is the process of retrieving a resource identified by a DID URL. While this might sound similar to DID resolution, there's an important distinction to understand.
These two processes serve different but complementary purposes in the DID ecosystem:
Process | Purpose | Input | Output |
---|---|---|---|
DID Resolution | Obtains a DID document for a given DID | A DID (did:example:123 ) | A complete DID document |
DID URL Dereferencing | Retrieves a specific resource identified by a DID URL | A DID URL (did:example:123/path?query#fragment ) | A specific resource (document fragment, verification method, service endpoint, or external resource) |
Think of the relationship like this:
The dereferencing process typically follows these steps:
Parse the DID URL: The system extracts the DID portion and any additional components (path, query parameters, fragment).
Resolve the DID: The base DID is resolved to obtain the corresponding DID document.
Identify the Target Resource: Based on the additional components (path, query, fragment), the system identifies which specific resource is being requested.
Return the Resource: The identified resource is returned to the requester.
A DID URL contains several components that determine what resource will be returned:
did:example:123
)/service/agent
)?versionTime=2023-06-01
)#key-1
)DID URL dereferencing enables several important capabilities:
Verification Method Access: Retrieving a specific cryptographic key from a DID document (did:example:123#key-1
).
Service Endpoint Retrieval: Accessing a service endpoint associated with a DID (did:example:123?service=messaging
).
External Resource Access: Obtaining resources hosted by the DID controller (did:example:123/resume.pdf
).
Historical Version Access: Retrieving a specific version of a DID document (did:example:123?versionTime=2023-01-01
).
Linked Resource Retrieval: Obtaining resources linked to a DID through its verifiable data registry.
When dereferencing a DID URL, one of three main outcomes can occur:
Success with Resource: The dereferencing succeeds and returns the requested resource.
Success with Redirection: The dereferencing succeeds but indicates the resource is located elsewhere.
Failure: The dereferencing fails due to various issues (invalid DID URL, resource not found, lack of access permissions).
Metadata plays a crucial role in the dereferencing process:
Dereferencing Options: Input metadata that affects how dereferencing occurs (e.g., specifying preferred content type).
Dereferencing Metadata: Output metadata about the dereferencing process (e.g., content type of the returned resource).
Content Metadata: Information about the retrieved resource (e.g., when it was created/updated).
DID URL parameters influence how dereferencing happens:
service
: Identifies a service endpoint in the DID documentrelativeRef
: Specifies a resource relative to a service endpointversionId
: Requests a specific version of a DID documentversionTime
: Requests the DID document as it existed at a specific timehl
: Provides integrity protection through resource hashingWhen dereferencing fails, the system returns specific error codes to help understand what went wrong:
invalidDidUrl
: The DID URL syntax is invalidnotFound
: The requested resource doesn't existcontentTypeNotSupported
: The requested content type isn't availableThe Vidos Universal Resolver implements DID URL dereferencing according to the W3C DID Core specification. It provides a standardized way to obtain resources across different DID methods, ensuring consistency and interoperability throughout the Vidos ecosystem.
When using DID URL dereferencing:
By understanding DID URL dereferencing, you gain insight into how Vidos enables precise, flexible interactions with decentralized identifiers and the resources they control.