w3c / vc-data-model

W3C Verifiable Credentials v2.0 Specification
https://w3c.github.io/vc-data-model/
Other
299 stars 106 forks source link

VC Identifier clarification #1568

Closed isaackps closed 1 month ago

isaackps commented 1 month ago

Hi,

I have a question regarding the Identifier, in the draft it states: the id property is OPTIONAL. If present, id property's value MUST be a single URL, which MAY be dereferenceable. Is it suppose to be a controller document that it should resolve to? is it possible to give an example?

Additionally, i see there was an issue #1432 with PR #1466 that seems to change this URL to an URN, but somehow was gone in the later version of the draft, maybe i miss it. Can I clarify this? is it still relevant to use a URN, urn:uuid:<uuid-value>, as the id for the VC?

msporny commented 1 month ago

I have a question regarding the Identifier, in the draft it states: the id property is OPTIONAL. If present, id property's value MUST be a single URL, which MAY be dereferenceable. Is it suppose to be a controller document that it should resolve to? is it possible to give an example?

It could be a any resource located at any URL, per the definition of URL in the WHATWG URL specification:

https://url.spec.whatwg.org/#concept-url

... which defines a URL as:

A URL is a struct that represents a universal identifier.

... which includes any URI, URN, IRI, HTTP-based URL, or IRL. In the late 2000s, the WHATWG URL specification redefined URL to be any one of these things because many developers didn't seem to know the difference between the different classes and types of URI/IRI schemes.

The resource returned when dereferencing these URLs could be nothing, or any resource, including documents expressed in HTML, XML, JSON, YAML, or any other format. They could be a home page, a social media page, a DID document, a video, or anything, really. The resource could also be a controller document for things like issuer.id or holder or credentialSubject.id.

Additionally, i see there was an issue #1432 with PR #1466 that seems to change this URL to an URN, but somehow was gone in the later version of the draft, maybe i miss it. Can I clarify this? is it still relevant to use a URN, urn:uuid:<uuid-value>, as the id for the VC?

Yes, you can use a URN in the id value for a VC. We state that the value used in id can be a URN in the first paragraph of this section: https://www.w3.org/TR/vc-data-model-2.0/#identifiers

I hope the above answers your question.

With specifics to this request:

is it possible to give an example?

I'm presuming that was a request to add an example to the specification on what resource might be at the end of an id URL. We had discussed this before in previous iterations of the Working Group and putting a DID Document in for the example for "what resource could live at the end of an id URL" was rejected (because some didn't want to tightly bind DIDs to VCs). I would expect putting a Controller Document as an example would be rejected for slightly different reasons. Namely, since the id can point to ANY resource, or no resource at all, using one or two examples might create more questions than it answers like: "Do they have to have that form? What things need to be similar? Could it be a video? An image? A sound file?" ... and the answer to all of those questions is "yes, it could be any resource", which the specification already says.

Perhaps we could split the difference and say something like:

"Examples of machine-readable documents include DID Documents [DID-CORE], Controller Documents [CONTROLLER-DOCUMENTS], Verifiable Credentials, and social web profiles [ACTIVITYPUB]."

Would that address your concern? ^

isaackps commented 1 month ago

Thank you @msporny for the clarification, this addressed my concerns.