w3c / did-core

W3C Decentralized Identifier Specification v1.0
https://www.w3.org/TR/did-core/
Other
407 stars 95 forks source link

DID Parameters: Service - only fragment or complete id? #847

Open mschmidm opened 10 months ago

mschmidm commented 10 months ago

I think I have found an unclear, possibly incorrect, specification. It is not clear how the DID service parameter should be used.

How exactly should the "service" parameter be used? Should it be the whole service id URI (and then presumably use percent-encoding)? Or should it just be a URL fragment (but then the service id specification would have to be more precisely defined)?

Thank you for working on this great specification! :)

Best regards mschmidm

peacekeeper commented 10 months ago

Hello @mschmidm , good question, and nice summary of sources related to this topic! My understanding has always been that the value of the service DID parameter is not the full DID URL, but rather the value of the fragment of the id property of a service endpoint, i.e. like in Example 8 that you mention.

So for example service=files would refer to a service with id did:example:1234#files.

Regarding the language in 3.2.1: "Identifies a service from the DID document by service ID"

I would agree that this language isn't very clear, but I don't think it necessarily implies that the value of the service must be the full DID URL that is the value of the id property of a service.

A future DID WG will have the opportunity to clarify this topic more in the DID Resolution specification, and standardize the exact steps for dereferencing a DID URL with a service parameter.

mschmidm commented 10 months ago

Hi @peacekeeper , thank you for your answer!

I agree, this is most likely the intended meaning. The phrasing im 3.2.1. is unclear, but it does not contradict this interpretation.

This interpretation could have two different implications.

  1. Service ids must always be the corresponding DID plus some fragment identifier like #files. -> In this case, the service id is way too loosely specified as only "MUST be a URI".
  2. Service ids can be any URI as specified. However, the DID service parameter can only be used with services having an id as defined in 1.

In both cases, the DID service parameter should always work if you refer to a service with the according format. Fortunately, this assumption should be sufficient for most use cases, including mine. This makes the parametee definitely a handy feature.

Thanks again!