w3c/did-extensions

Unable to understand the concept of `type` property in `service` object.

Vishwas1 opened this issue · 6 comments

Not-an-issue, query

Hi all,

I am trying to understand the W3C did spec as we are planning to register did-method for cosmos ecosystem with interoperable DID (WIP for ICS for DID). One thing which I could not properly understand in the did spec was, type filed in service object. As per spec:

In order to maximize interoperability, the service type and its associated properties SHOULD be registered in the DID Specification Registries

What does type means for a service end point and what needs to be registered in the VDR for service type? What all different types recommended?

Could any one please explain or point me to the right document for it?

Thanks In Advance

The concept was largely inherited from the JSON-LD spec and since we wanted lossless translation between different representations such as JSON-LD and JSON.

Realistically whether you're using JSON-LD or not the most common way I've seen the type property used is to be able to filter through the different service endpoints to find the correct one.

@kdenhartog

Thank you for your reply. Are the type field (circled in the img below) is same as what you pointed out (@type)?

image

Yup exactly. In the DID Core JSON-LD context we do a trick to map the @type property to type which allows the reserved term to still be used.

This is done with the "type": "@type" line in the context so that anytime the type property appears in the document a JSON-LD processor will automatically map it to the reserved @type property. This means that the logic to process a JSON representation and JSON-LD representation can be more closely aligned.

Understood. @kdenhartog one last question, sorry to bother you too much. From where the value (LinkedDomains) of field type is coming ?

Oh, got it, that will come form context, I guess.

Looks like you're looking at the .well-known spec in DIF. In that example they use the proper context URL which is https://identity.foundation/.well-known/did-configuration/v1/