@blockcerts/schemas
Version:
One source of truth for Blockcerts schemas
140 lines (139 loc) • 5.08 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Blockcerts Credential schema",
"description": "Blockcerts 3.0 Credential schema. Implements Verifiable Credential v1.1 schema: https://www.w3.org/TR/vc-data-model/",
"type": "object",
"definitions": {
"JsonLdContext": {
"description": "A link to a valid JSON-LD context, or array of JSON-LD contexts",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "object"
},
{
"type": "array"
}
]
}
}
]
},
"JsonLdType": {
"description": "A type or an array of types defined in a referenced JSON-LD context.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"DateTime": {
"description": "Verifiable Credentials must express timestamps as strings compatible with ISO 8601 guidelines, including the time and a time zone indicator. It is recommended to publish all timestamps in UTC. Previous versions of Open Badges allowed Unix timestamps as integers. Open Badges v2.0 requires string ISO 8601 values with time zone indicators. For example, 2016-12-31T23:59:59+00:00 is a valid ISO 8601 timestamp. It contains the year, month, day, T separator, hour number 0-23, minute, optional seconds and decimal microsecond, and a time zone indicator (+/- an offset from UTC or the Z designator for UTC).",
"type": "string"
},
"Issuer": {
"description": "The value of the issuer property MUST be either a URI or an object containing an id property. It is RECOMMENDED that the URI in the issuer or its id be one which, if dereferenced, results in a document containing machine-readable information about the issuer that can be used to verify the information expressed in the credential.",
"oneOf": [
{
"type": "string"
},
{
"type": "object"
}
]
},
"CredentialSubject": {
"$ref": "https://w3id.org/blockcerts/schema/3.0/credentialSubjectSchema.json",
"description": "As defined by `credentialSubject` property of https://www.w3.org/TR/vc-data-model/#credential-subject, and quickly described more precisely in Blockcerts context."
},
"MerkleProof2019": {
"$ref": "https://w3id.org/blockcerts/schema/3.0/merkleProof2019Schema.json",
"description": "Defined by https://w3c-ccg.github.io/lds-merkle-proof-2019/"
},
"Display": {
"$ref": "https://w3id.org/blockcerts/schema/3.0/displaySchema.json",
"description": "An optional object that sets a display for the Blockcerts document."
},
"Metadata": {
"description": "A set of extra information about the credential that the issuer deems fit to add to the document, but cannot be predefined as too custom.",
"type": "string"
},
"Nonce": {
"description": "A piece of unique data to avoid hash collusion and replay attacks",
"type": "string"
}
},
"properties": {
"id": {
"description": "Defined by `id` property in https://www.w3.org/TR/vc-data-model/#identifiers.",
"type": "string",
"anyOf": [
{
"type": "string",
"pattern": "^urn:uuid:"
},
{
"type": "string",
"format": "uri"
}
]
},
"type": {
"$ref": "#/definitions/JsonLdType",
"description": "Defined by `type` property of https://www.w3.org/TR/vc-data-model/#types"
},
"issuer": {
"$ref": "#/definitions/Issuer",
"description": "Defined by `issuer` property of https://www.w3.org/TR/vc-data-model/#issuer."
},
"issuanceDate": {
"$ref": "#/definitions/DateTime",
"description": "Defined by `issuanceDate` property of https://www.w3.org/TR/vc-data-model/#issuance-date."
},
"credentialSubject": {
"$ref": "#/definitions/CredentialSubject",
"description": "Defined by `credentialSubject` property of https://www.w3.org/TR/vc-data-model/#credential-subject."
},
"display": {
"$ref": "#/definitions/Display",
"description": "Blockcerts extension for content display."
},
"metadata": {
"$ref": "#/definitions/Metadata",
"description": "Blockcerts extension for optional metadata."
},
"nonce": {
"$ref": "#/definitions/Nonce",
"description": "Security feature against replay attacks."
},
"proof": {
"$ref": "#/definitions/MerkleProof2019",
"description": "Defined by `proof` property of https://www.w3.org/TR/vc-data-model/#proofs-signatures."
}
},
"required": [
"id",
"type",
"issuer",
"issuanceDate",
"credentialSubject",
"nonce",
"proof"
],
"additionalProperties": true
}