Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Remove 'name' from service description #72

Closed
msporny opened this issue Apr 22, 2018 · 10 comments
Closed

Remove 'name' from service description #72

msporny opened this issue Apr 22, 2018 · 10 comments
Assignees

Comments

@msporny
Copy link
Contributor

msporny commented Apr 22, 2018

The current consensus in the group seems to be that service descriptions looks something like this:

{
  "id": "did:v1:1234567",
  ... // DID Document goes here ...
  "service": [{
    "type": "urn:foobar:MessagingService",
    "name": "messaging",
    "serviceEndpoint": "https://example.com/messages/398tuo"
  }]
}

... which could result in the following URL that uses the service above:

did:v1:1234567;messaging/somepath#somefrag3

I suggest that we remove name and move to a less error prone format:

{
  "id": "did:v1:1234567",
  ... // DID Document goes here ...
  "service": [{
    "id": "did:v1:1234567;messaging",
    "type": "urn:foobar:MessagingService",
    "serviceEndpoint": "https://example.com/messages/398tuo"
  }]
}

Note that we get rid of the name field and use id instead. This approach has the following benefits:

  1. It fits with the JSON-LD model more cleanly,
  2. doesn't require implementations to destructure a URL and look for specific properties (opaque identifiers),
  3. avoids the creation of a scenario where the id and the constructed service URL can differ, and
  4. enables us to use the semicolon syntax to address things that are not just service endpoints in the document.
@msporny
Copy link
Contributor Author

msporny commented Apr 22, 2018

I'll work on a PR that updates the service description and DID syntax parts of the spec to match this proposal so that the group has something to have a conversation around.

@peacekeeper
Copy link
Member

How is this error prone? Also, my understanding is that in the DID resolution process, no URL is ever "constructed", only parsed. What else would you use the semicon for?

(Yes we can move this discussion to a PR when there is one).

@talltree
Copy link
Contributor

talltree commented Apr 22, 2018 via email

@msporny
Copy link
Contributor Author

msporny commented Apr 22, 2018

How is this error prone?

If you set id to did:v1:1234567;messaging and name to messages, then what would be the appropriate thing to do when someone writes did:v1:1234567;messaging/foo/bar#frag? You have several options, and all of them result in more complicated processing rules.

The suggestion is to reduce the complicated processing rules by reusing id for the purpose for which it was intended (identifying graph nodes -- in this case, service descriptions).

Also, my understanding is that in the DID resolution process, no URL is ever "constructed", only parsed.

Software that builds DID-based paths may use services to construct URLs that are then passed to the DID resolution process in another system. It's the first part that may be concerning if the id and name didn't match. Rather than depend on two properties for constructing and destructuring service-based URLs, we gain simplicity by just using id, which meets all of our requirements, IIUC.

What else would you use the semicon for?

We may want to build other sorts of opaque strings from DID-based URLs in the future. While we don't have a very strong use case to do that right now, if we use name, we are painting ourselves into a corner. If we just use id, we don't paint ourselves into a corner AND meet all of our current requirements.

@msporny
Copy link
Contributor Author

msporny commented Apr 22, 2018

at least one downside, which is that the ID of the service description block changes if/when you change the name of the service

I'm not following why that's a downside, can you elaborate? For example, if the name of the service changes, wouldn't you expect folks to use the new name for service-based URLs? If we use id, we can still have two different "names" point to the same service endpoint (which enables a smooth upgrade path from old to new).

To put it another way, what's the advantage/use case for being able to use a name that is independent of id?

@talltree
Copy link
Contributor

talltree commented Apr 22, 2018 via email

@msporny
Copy link
Contributor Author

msporny commented May 4, 2018

Surface this with the group once a PR is in place.

@msporny
Copy link
Contributor Author

msporny commented May 12, 2018

PR #75 is in place... community should discuss.

@kimdhamilton
Copy link
Contributor

The semicolon syntax is not mentioned in this section: https://w3c-ccg.github.io/did-spec/#decentralized-identifiers-dids

Do we need to call that out, or is that not needed (due to DID schemes being a RFC3986-conformant URI scheme)?

@msporny
Copy link
Contributor Author

msporny commented May 12, 2018

The semicolon syntax is not mentioned in this section: https://w3c-ccg.github.io/did-spec/#decentralized-identifiers-dids

You're correct... that fix is waiting on an issue to be raised from @talltree to add services to the DID syntax and then a PR from @talltree to add it.

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

No branches or pull requests

4 participants