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

Contexts need updated to produce valid JSON-LD DID Documents #1144

Open
kdenhartog opened this issue Jul 14, 2021 · 5 comments
Open

Contexts need updated to produce valid JSON-LD DID Documents #1144

kdenhartog opened this issue Jul 14, 2021 · 5 comments
Labels
Milestone

Comments

@kdenhartog
Copy link
Contributor

kdenhartog commented Jul 14, 2021

Not sure if this should be filed here or in https://github.com/decentralized-identity/ion/ so going to post in both and cross link.

Due to recent changes in the DID Core context file, we now need to make sure that the key suite contexts are getting added to the outputted DID Document on resolution. In ION specifically, DID Documents are limited to JWKs so I believe we should be able to add the URL https://w3id.org/security/suites/jws-2020/v1 for LDS-JWS2020 which includes the context definition for JsonWebKey2020.

@OR13 do you know what the specific URL for that is? Found it inside the perma-id/w3id file

For service endpoints, we may need to allow the service endpoint to pass a context URL in as well in the internal sidetree data model so that the contexts are properly working. However, this introduces some difficulties on preventing garbage-in-garbage-out scenarios and more thought will be needed on it.

Cross post link: decentralized-identity/ion#217

@OR13
Copy link
Contributor

OR13 commented Jul 14, 2021

for each of the key types listed here: https://did.key.transmute.industries/

We have tested that both the JSON and JSON-LD DID Documents work with JSON-LD and VC-JWT.

In order to make the JSON work with JSON-LD https://w3id.org/security/suites/jws-2020/v1 is required for any case where you want to use publicKeyJwk + JsonWebKey2020.

...however, if you want to use other representations like publicKeyBase58 or publicKeyMultibase, you will need to register additional contexts....

it is possible to infer the correct context values based on a pure JSON data model, and inject the correct context, but only if your did method limits the verification method types (as did:key does).

See these 2 functions:

@decentralgabe
Copy link
Member

@kdenhartog @OR13 are either of you able to help make this work for v1.1?

@decentralgabe decentralgabe added this to the V1.1 milestone Feb 7, 2023
@OR13
Copy link
Contributor

OR13 commented Feb 7, 2023

Our implementation works. We inject vocab to protect users from carrying about sidetree's general lack of support for JSON-LD...

@decentralgabe
Copy link
Member

Ok, this is something we should improve for v1.1

@kdenhartog
Copy link
Contributor Author

When I was at MATTR and encountered this issue we ended up doing the same thing and injecting the context on the fly in our resolver. Was a hacky solution, but ended up resolving it for the time being.

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

No branches or pull requests

3 participants