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

Support DIDs as serviceEndpoint? #7

Open
peacekeeper opened this issue Jul 31, 2018 · 27 comments
Open

Support DIDs as serviceEndpoint? #7

peacekeeper opened this issue Jul 31, 2018 · 27 comments
Labels
enhancement New feature or request

Comments

@peacekeeper
Copy link
Collaborator

One of DID Resolution's main purposes is to discover a serviceEndpoint URL for a DID, e.g.:

{
   "id": "did:example:123456789abcdefghi;hub1",
   "type": "HubService",
   "serviceEndpoint": "https://hub.myhost.com/1234"
 }

We could also support DIDs as the value for serviceEndpoint, e.g.:

{
   "id": "did:example:123456789abcdefghi;hub1",
   "type": "HubService",
   "serviceEndpoint": "did:example:xyz"
 }

This could serve as a "redirect", i.e. a resolver would execute a second ("child"?) resolution process to now resolve did:example:xyz in order to find an actual serviceEndpoint URL.

One advantage of this pattern would be that many DIDs could be updated effectively by updating a single DID Document.

@msporny
Copy link
Member

msporny commented Jul 31, 2018

Agreed that this would be a good feature. I don't think the did-spec prevents this at present... serviceEndpoint is syntactically any URL (where a DID is a type of URL). That said, we should detail this feature in the spec so that people know about it.

@csuwildcat
Copy link

The pattern we are thinking is that users add IdentityHub type descriptors to their DID Doc that specify a Host DID as the serviceEndpoint value, which, when resolved, leads to the Host's DID Doc, wherein there is an IdentityHubHost service descriptor with whatever actual endpoint the Host's instance resides at.

@peacekeeper
Copy link
Collaborator Author

Okay.. I'm wondering if this "DID redirect" pattern should be handled internally by a resolver, i.e. would an application invoke the resolver once and it would automatically start a child resolution cycle to follow the DID to the final result, or would an application invoke the resolver twice to find what it's looking for. I could see it both ways, or maybe configurable as resolver parameters.

@msporny
Copy link
Member

msporny commented Aug 1, 2018

would an application invoke the resolver once and it would automatically start a child resolution cycle to follow the DID to the final result, or would an application invoke the resolver twice to find what it's looking for.

I suggest we follow the pattern that curl uses for HTTP 301 Redirects. By default it doesn't redirect, but if you pass it the -L --location flag, it will follow the redirect. I'll also note that doing this will require clients to determine when they're in an endless redirect loop (e.g. through a simple redirect counter).

@talltree
Copy link

talltree commented Aug 1, 2018 via email

@TomCJones
Copy link

TomCJones commented Jan 22, 2019

calling a did a service endpoint creates some conflict with the existing use of the term on the web. Service endpoints in all standards of which i am familiar require use of https:// scheme. I know that there is general disdain here for existing standards, but am just trying to avoid unnecessary confusion.

@dmitrizagidulin
Copy link
Contributor

@TomCJones - can you say more about that? How does calling a service endpoint create conflict with existing standards?

@msporny
Copy link
Member

msporny commented Jan 23, 2019

I know that there is general disdain

That's a strange thing to say since a LOT of the work we're doing is built on top of existing standards (both W3C, ISO, and IETF). Can you elaborate?

@dmitrizagidulin
Copy link
Contributor

I agree with @msporny that a) this is good feature (though not super urgent, I think?), and b) that it should follow existing redirect conventions (like curl).

Except that I think it should actually follow WHATWG fetch redirect convention, that is - default behavior is for the resolver to transparently redirect, unless disabled. (And count redirects so as to prevent loop, etc.)

@dlongley
Copy link

We're also interested in a similar proxy/redirect feature that would help offload potential GDPR issues. A service with a type of SomeProxyThing (TBD) and a service endpoint with an opaque address could redirect to another document with service descriptions that are not on an immutable ledger.

@TomCJones
Copy link

@dmitrizagidulin I must have been unclear in my comment which was meant to help direct the evolution of the use of a service endpoint. I know how to process and secure a service endpoint that uses the scheme https://. I would not understand the meaning or (or know how to process) a service endpoint with scheme did:

@TomCJones
Copy link

TomCJones commented Jan 25, 2019

Your statement is not part of the spec. My suggestion was that if end points are defined that the scheme MUST be https://. I am trying to add rigor to the spec.

@jandrieu
Copy link
Contributor

A service endpoint should be able to be any valid URL. Which would include DIDs. Which allows a fairly useful trick for forwarding an endpoint from one DID to an endpoint in another.

@TomCJones
Copy link

I disagree with that statement for the reasons I gave above.

@ChristopherA
Copy link

I believe there will be a lot more schemes in the future besides https (and I am a co-author of https). Just because browsers today focus on that, it is not the long-term — Mozilla in new dev builds allows new schemes to be supported specifically so they can support web3 ideas.

Thus any resolvable URL could be an endpoint, and since a DID is a resolvable URL, it could be too. Not something I plan to support in near future, but should not be prohibited.

@peacekeeper
Copy link
Collaborator Author

@csuwildcat Wasn't it you who originally suggested this feature? So that e.g. many users of a shared hub service provider could just point to the hub service provider's DID in their DID document, instead of pointing to the actual HTTPS endpoint. And then the hub service provider's DID document would have the final HTTPS endpoint. This way the hub service provider could change their service endpoint, without having to update the DID documents of every single user?

@csuwildcat
Copy link

@peacekeeper yeah, good point, there is a double resolution from user DID to Hub DID and its related http (and possibly non-http) endpoints. Not sure how I forgot that 🤦‍♂️

I definitely don't understand/agree with Tom's "HTTP must be the one and only" argument, given new protocols like IPFS are already becoming prevalent.

@msporny
Copy link
Member

msporny commented Jan 25, 2019

"HTTP must be the one and only"

Strong -1 to HTTP-only for all the reasons mentioned by @csuwildcat and @ChristopherA ... services should be protocol agnostic.

@TomCJones
Copy link

I am strongly supporting only secure connections for service end points. The one that is well known and well supported today is TLS. Roll your own security is a known vulnerability. Let's avoid known vulnerabilities.

@csuwildcat
Copy link

@TomCJones please note we have one of the co-author's of the TLS spec working in this group, who has already commented on this thread.

Also realize DIDs provide a new means of highly secure connections between peers: the ability to do standards-based cryptographic connections/exchanges using keys that are provably backed by the party you intend to communicate with. This is a much more secure means of connection than schemes based on trusting a set of central authorities who are constantly competing with each other to see who can be featured in more "You had one job" memes.

@ChristopherA
Copy link

ChristopherA commented Jan 25, 2019 via email

@TomCJones
Copy link

I don't need the lectures, I owned crypto for windows at one time. The security around dids only applies to messages from the key owner, not to any other messages. That security will not apply to any redirects or other messages. I have no way to know what is required by the spec, there is no indication of which parts are normative. If the spec does not come with a security section, it will not get accepted. I suspect when you get to writing the security section all of these issues will arise again. Since security is not a concern of the group, this will be my last message.

@jandrieu
Copy link
Contributor

Restricting a service endpoint to a single, current URL scheme would not only make the spec future-brittle, requiring https would tie us to the very certificate infrastructure we are working to fix. Why refuse the decentralized cryptographic foundation of DIDs for service endpoints? Any valid URL, by definition, describes how to resolve it. It's up to DID controllers to decide which protocols best meet their service requirements.

@peacekeeper
Copy link
Collaborator Author

@TomCJones Nobody ever proposed to encourage or support non-secure connections for service end points. This is not what this Issue is about. Having a DID as a service endpoint in a DID Document doesn't mean that there would be any insecure messaging. I agree with you that a Security section of the spec should address this case in detail.

I think you have valuable input on this and other Issues, and I hope with your help and experience we can make the specs better and more secure. But at the same time you need to stop provoking us with (false) statements about a "general disdain here for existing standards" or that "security is not a concern of the group".

@wip-abramson
Copy link
Contributor

I would like to see this enhancement added to the spec.

I agree that technically a DID as a serviceEndpoint is currently supported in DID core, but we document how resolution on DID serviceEndpoints is handled. And possibly add an example to DID core that shows a DID as a serviceEndpoint.

@w3cbot
Copy link

w3cbot commented Jan 30, 2025

This was discussed during the #did meeting on 30 January 2025.

View the transcript

w3c/did-resolution#7

Wip: this is about supporting DIDs on service endpoints
… DIDs can be used as service endpoints currently
… endpoints are URLS, so they can be set to a DID
… do we need a parameter in the resolution spec that supports redirection?
… so that you can get to the final destination for that service?

markus_sabadello: I remeber that the idea is really useful
… maybe using a parameter resolver would find the final service endpoint
… I don't think anyone has actually explored this, however
… it sounds interesting and useful
… but no one has used it
… so I'm not sure it needs to be in the core specification

Wip: so, maybe the redirection piece is an extension?
… should we be changing any of the specs to show a service endpoint that is a DID?
… that might be an action here

markus_sabadello: but if we do an example, we also need to explain what it means and what is possible

swcurran: my two cents would be to close it and say you can do it, nothing says you can't, but we don't need an example

Wip: good perspective
… let's move on then


@peacekeeper
Copy link
Collaborator Author

peacekeeper commented Jan 30, 2025

After some years of implementation and adoption experience, I'm not aware of anyone who has implemented or used this feature. So I propose to not specify this for now, and leave it up to a potential future extension to support this.

The behavior of such an extension could be that by default, a resolver doesn't do anything with a DID-as-a-service-endpoint, i.e. it is just returned like any other service endpoint, but an extension parameter (e.g. followServiceRedirect) could instruct a resolver to follow the service endpoint DID via a nested/recursive DID resolution process.

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

No branches or pull requests