Open mjfelis opened 2 months ago
thanks @mjfelis for the issue.
Today we can...
JsonSchema
or JsonSchemaCredential
typesid
reference to a JsonSchema
could be a schema or reference to a JSON Schema (using $ref
).id
reference to a JsonSchemaCredential
could be a VC that contains a reference to another JSON Schema (using $ref
) without re-defining the JSON Schema.I am happy to expand on any/all of those depending on the functionality you're looking for, in addition to improving spec language/examples to illustrate these possibilities.
I think you are looking for (3) -- amending your example it could work with something like...
{
"@context": [
"https://www.w3.org/ns/credentials/v2",
"https://www.w3.org/ns/credentials/examples/v2"
],
"id": "https://example.com/credentials/3734",
"type": [
"VerifiableCredential",
"JsonSchemaCredential"
],
"issuer": "https://example.com/issuers/14",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSchema": {
"id": "https://www.w3.org/2022/credentials/v2/json-schema-credential-schema.json",
"type": "JsonSchema",
"digestSRI": "sha384-S57yQDg1MTzF56Oi9DbSQ14u7jBy0RDdx0YbeV7shwhCS88G8SCXeFq82PafhCrW"
},
"credentialSubject": {
"id": "https://example.com/schemas/favorite-color-schema.json",
"type": "JsonSchema",
"jsonSchema": {
"$ref": "https://example.com/schemas/email-credential-schema.json"
},
"digestSRI": "sha384-ABCSGyugst67rs67rdbugsy0RDdx0YbeV7shwhCS88G8SCXeFq82PafhCrW"
}
}
If that is what you're looking for we would need to update guidance on how to provide digestSRI
for JsonSchemaCredentials
with external references.
Hi @decentralgabe,
Yes, that's exactly what we need. That would be an optimal solution for referencing json schemas stored in a Trust Registry.
great - I'll assign myself to add spec text around this.
separately -- does your organization or an organization you're working with belong to the W3C or have an interest in joining? we are looking for more editors and implementers for this spec.
I think it could be interesting to have a third option for using Json Schema in credentials.
The third option would be, in the
JsonSchemaCredential
, instead of providing the full Json Schema (property"jsonSchema"
), provide a"jsonSchemaReference"
that would include the id of the Json Schema and a"digestSRI"
property. That would be handy to verify several issuers are conforming to the same json schema without having to manually compare the content of thejsonSchema
property.