decentralized-identity / sidetree

Sidetree Specification and Reference Implementation
https://identity.foundation/sidetree/spec
Apache License 2.0
438 stars 112 forks source link

Add option to output DID Doc in different formats #778

Closed csuwildcat closed 3 years ago

csuwildcat commented 4 years ago

We should probably make it possible to output any supported DID Document format (JSON, JSON-LD, etc.) from the resolution call.

OR13 commented 4 years ago

can we define the actual interface for what this is proposing?

OR13 commented 4 years ago

@kdenhartog @tplooker we need to cite the did core spec sections as the related to "requesting a did document in a specific representation"

and we then need to update the reference implementation to use that approach.

tplooker commented 4 years ago

A concrete way to realised this over an HTTP interface is using the Accept header for the client to request the mime-type of the returned did document.

OR13 commented 4 years ago

@csuwildcat per our call, we should propose the following language in sidetree spec:

Sidetree did methods MUST support the following representations: [JSON, JSON-LD]. (maybe CBOR later).

Sidetree did methods MUST return the did document in the representation requested.

This prevents Sidetree method implementers from choosing to throw errors when people request JSON/JSON-LD ... and from a practical standpoint, there is a simple transformation between both representations (deleting @context / @base) for JSON only...

However, on the JSON-LD side this also means that Sidetree methods should not return malformed JSON-LD, as has been the case in the past, with the reference implementation....given that the reference implementation supports a limited subset of DID Core functionality, this seems like a very easy property to ensure.