identus-cloud-agent icon indicating copy to clipboard operation
identus-cloud-agent copied to clipboard

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

Open bsandmann opened this issue 1 year ago • 1 comments

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

bsandmann avatar Jul 02 '24 10:07 bsandmann

All OpenBadges 3.0-related issues are moved to the cloud-agent backlog. We cannot start working on this feature right now, as we have to add JSON-LD VC type and align the model with VCDM 2.0

yshyn-iohk avatar Jun 04 '25 07:06 yshyn-iohk