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

Spec raises invalidDid on valid dids #60

Open
aljones15 opened this issue Aug 1, 2022 · 1 comment
Open

Spec raises invalidDid on valid dids #60

aljones15 opened this issue Aug 1, 2022 · 1 comment

Comments

@aljones15
Copy link
Contributor

aljones15 commented Aug 1, 2022

The following normative statement causes issues with the definition of invalidDid from did-core

Check the validity of the input identifier. The scheme MUST be the value did. The method MUST be the value key. The version MUST be convertible to a positive integer value. The multibaseValue MUST be a string and begin with the letter z. If any of these requirements fail, an invalidDid error MUST be raised.

The definition of invalidDid is:

invalidDid
The DID supplied to the DID resolution function does not conform to valid syntax. (See 3.1 DID Syntax.)

The following statements should not raise invalidDid

  • The method MUST be the value key.
  • The multibaseValue MUST be a string and begin with the letter z.
  • The version MUST be convertible to a positive integer value.

The following is a valid did that breaks these rules: did:sov:staging:PiEVD2uU2qKEQ5oxx1BJ6A

I suggest adding a new error invalidDidKey for when something is a valid did, but not a valid did:key.
We could make these more specific such as:

  • The method MUST be the value key -> methodNotSupported
  • The multibaseValue MUST be a string and begin with the letter z. -> invalidDidKeyMultibasePrefix
  • The version MUST be convertible to a positive integer value. -> invalidDidKeyVersion

Also of note: the normative statement The method MUST be the value key conflicts with the did-resolver spec
We could solve this issue by using the error code from did resolution methodNotSupported

@peacekeeper
Copy link
Member

I agree with most of what you're saying here, but I'm not sure if introducing too many DID method-specific errors (such as invalidDidKeyVersion) is very smart. This can become complicated for both resolvers and clients if you want to support multiple DID methods.

We could also make use of other metadata properties. E.g. a resolver could return a generic invalidDid or notFound error that every client understand, but in the metadata we could include additional information WHY it was invalid or not found, etc.

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

No branches or pull requests

2 participants