decentralized-identity / decentralized-identity/web5-spec

DID Resolution Result in case of upstream issues

Open
#102 4 comments 0 reactions 0 assignees View on GitHub
did question
Dominant language
JavaScript
Stars
8
Forks
6
PR merge metrics
No merged PRs in 30d

Description

Seeking commentary on what the `resolve()` function in our DID method/resolver implementations should do when there is either a network failure or upstream gateway failure. Examples include:
- for `did:web`, when attempting a GET to the server specified by the DID URI the network call might return a failure or the remote server could respond with status codes 404, 500, 503, etc.
- for `did:dht`, there are multiple steps in the resolution process where network calls or upstream gateways might return an error status

> [!NOTE]
> This only pertains to DID methods in which resolution relies on an external service. In other words, we need to consider for `did:dht` and `did:web` but not `did:jwk` or `did:key`.

We haven't yet added test vectors for DID DHT but there is [one test](https://github.com/TBD54566975/sdk-development/blob/a4f9fe01ea50d125450a27c0fb72d4d8f2390ff4/web5-test-vectors/did_web/resolve.json#L72-L85) for DID Web checks for `didResolutionMetadata` containing an error value of `notFound` given an invalid domain.

Do we want to mirror this pattern for other DID test vectors? Should implementations raise an exception? (Kotlin/JS) or return an error result (Go, Rust). Is it up to the implementation and all of the Web5 SDKs will do it differently?

### Additional Reference Information

- List of [DID Resolution Errors](https://w3c-ccg.github.io/did-resolution/#errors) in draft community group report
- [§ 8.3 notFound](https://w3c-ccg.github.io/did-resolution/#notfound)
> If during [DID Resolution](https://w3c-ccg.github.io/did-resolution/#dfn-did-resolution) or [DID URL dereferencing](https://w3c-ccg.github.io/did-resolution/#dfn-did-url-dereferencing) a DID or DID URL doesn't exist, the value of the DID Resolution or DID URL dereferencing Metadata error property MUST be notFound as defined in sections [DID Resolution Metadata](https://www.w3.org/TR/did-core/#did-resolution-metadata) and [DID URL Dereferencing Metadata](https://www.w3.org/TR/did-core/#did-url-dereferencing-metadata) in [[DID-CORE](https://w3c-ccg.github.io/did-resolution/#bib-did-core)].

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.