hyperledger-identus / hyperledger-identus/cloud-agent
Additional type properties for VC issuance [OpenBadges 3.0]
- Dominant language
- Scala
- Stars
- 95
- Forks
- 34
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 14
Description
## Summary
This feature request is to modify the Hyperledger Identus agent to allow for a flexible `type` property in Verifiable Credentials (VCs). This change is necessary to achieve compatibility with OpenBadges 3.0 and to provide more versatility in credential types.
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]](https://github.com/hyperledger/identus/issues/7).
## Current Situation
Currently, the Identus agent uses a fixed value for the `type` property when creating a VC:
```json
"type": ["VerifiableCredential"]
```
## Proposed Changes
To align with the OpenBadges 3.0 specification, which requires an additional type, and to enhance the versatility of Identus-issued credentials, I propose to make the type 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`
```json
{
"type": ["VerifiableCredential", "OpenBadgeCredential"]
}
```
If the `type` property is not set, the default value should be `["VerifiableCredential"]` as it is now.
There should be some additional checks to verify that the provided types are aligned with the spec and e.g., `VerifiableCredential` is always the first in the list.
This is a very easy change and should not have any side effects: Good first issue.
## Additional resources from the VC 2.0 spec:
[Types spec](https://w3c.github.io/vc-data-model/#types)
[Difference between contexts and types](https://w3c.github.io/vc-data-model/#differences-between-contexts-types-and-credentialschemas)
Contributor guide
Assessment
This issue has not been assessed yet.