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

Extendable JSON-LD Context for VC issuance [OpenBadges 3.0] #1243

Open
bsandmann opened this issue Jul 2, 2024 · 0 comments
Open

Extendable JSON-LD Context for VC issuance [OpenBadges 3.0] #1243

bsandmann opened this issue Jul 2, 2024 · 0 comments

Comments

@bsandmann
Copy link

bsandmann commented Jul 2, 2024

Summary

This feature request is to modify the Hyperledger Identus agent to allow for a flexible @context property in Verifiable Credentials (VCs). This change is necessary to achieve full compatibility with OpenBadges 3.0 and to provide more versatility in credential contexts.
For further discussion on what OpenBadges 3.0 is and why to achieve compatibility with it, please refer to the Achieve compatibility with OpenBadges 3.0 [Summary].

Current Situation

Currently, the Identus agent uses a fixed value for the @context property when creating a VC:

"@context": ["https://www.w3.org/2018/credentials/v1"]

Proposed Changes

To align with the OpenBadges 3.0 specification, which should have additional contexts, and to enhance the versatility of Identus-issued credentials, I propose to make the @context property settable to an array of strings within the current API.
Add an optional property to the existing endpoint for offering credentials: /issue-credentials/credentials-offers

    "@context": [
        "https://www.w3.org/2018/credentials/v1",
        "https://purl.imsglobal.org/spec/ob/v3p0/context.json"
    ]

If the @context property is not set, the default value should be ["https://www.w3.org/2018/credentials/v1"] as it is now (Note: when updating to VC 2.0, the W3C context should be updated to https://www.w3.org/ns/credentials/v2)

There should be some additional checks to verify that the provided contexts are valid set of URIs and that the W3C VC context is always the first in the list.
This is a relatively simple change and should not have any significant side effects. It's a good candidate for a "Good First Issue" for contributors.

Further note, that @context could theoretically also contain objects. I think for the first iteration it would be easier to reject those and just focus on valid URIs.
Here is an example which I would propose to reject for now: https://www.w3.org/TR/vc-data-model-2.0/#example-usage-of-the-termsofuse-property-by-a-holder

Additional resources:

Context explanation from the VC 2.0 spec
Difference between contexts and types
Json-LD reference inside of the OB 3.0 spec

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

No branches or pull requests

1 participant