Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DidResolver and UniversalResolver #137

Open
frankhinek opened this issue Mar 21, 2024 · 0 comments
Open

DidResolver and UniversalResolver #137

frankhinek opened this issue Mar 21, 2024 · 0 comments
Labels
did related to decentralized identifiers

Comments

@frankhinek
Copy link
Contributor

frankhinek commented Mar 21, 2024

Context

Currently DID resolution has been implemented as follows across the Web5 SDKs:

Kotlin

  • DidResolver type that has a single function resolve().
  • DidResolvers concrete implementation of a "universal resolver" that can resolve DIDs using multiple registered DID method implementations.
  • DidMethod type that has a methodName property and create(), resolve(), and load() functions. Each concrete DID method implementation (e.g., DidJwk, DidDht, etc.) implements DidMethod.

JS

  • Missing a type for DidResolver.
  • DidResolver is a concrete implementation of a "universal" DID Resolver & DID URL Dereferencer with both resolve() and dereference() functions.
  • DidMethod base class that each concrete DID method implementation (e.g., DidJwk, DidDht, etc.) implements. DidMethodApi type that has a methodName property and create() function and DidMethodResolver type that has a methodName property and resolve() function. Note: This approach is a consequence of TypeScript not having the same flexibility as Kotlin in being able to use types with classes that has static methods.

Go

  • Resolver implementation of a "universal resolver" that can resolve DIDs using multiple registered DID method implementations.
  • Each concrete DID implementation (e.g., DidJwk, etc.) implements the resolve function.

Proposed Change

Web5 JS dids package will introduce a DidResolver and DidUrlDereferencer type. The DidResolver type will mirror the type in Kotlin and will only have the resolve function like is the case in Web5 Go. Currently DID URL Dereferencing is only used in the Web5 JS and will remain optional in other SDKs. The current DidResolver in JS that resolves DIDs for multiple methods will be renamed UniversalResolver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
did related to decentralized identifiers
Projects
None yet
Development

No branches or pull requests

1 participant