@cef-ebsi/vcdm2.0-presentation-schema
v3.0.0-next.0
Published
EBSI Verifiable Presentation (VCDM 2.0)
Downloads
59
Keywords
Readme
@cef-ebsi/vcdm2.0-presentation-schema
EBSI Verifiable Presentation
The schema defines a generic structure for any EBSI-related Verifiable Presentation according to the Verifiable Credentials Data Model v2.0
The schema is published to the Trusted Schemas Registry with the IDs:
0x07c73884559466753999055e50fdb02f5b8f7617e72e5704c79fee014df788f2(hexadecimal)zXN3esvptQp9Kt1dAg6LTnUS6eMvJSFB878tg32ZhxiD(multibase base58btc)
Table of Contents
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "EBSI Verifiable Presentation",
"description": "The schema defines a generic structure for any EBSI-related Verifiable Presentation according to the Verifiable Credentials Data Model v2.0",
"type": "object",
"properties": {
"@context": {
"description": "Defines semantic context of the Verifiable Presentation. First element MUST be https://www.w3.org/ns/credentials/v2",
"type": "array",
"items": {
"type": "string",
"format": "uri"
},
"prefixItems": [{ "const": "https://www.w3.org/ns/credentials/v2" }],
"minItems": 1,
"uniqueItems": true
},
"id": {
"description": "Globally unique identifier for the Verifiable Presentation. It can be a UUID or another globally unique identifier.",
"type": "string",
"format": "uri"
},
"type": {
"description": "Defines the Verifiable Presentation type",
"type": "array",
"items": {
"type": "string"
},
"contains": {
"const": "VerifiablePresentation"
},
"minItems": 1,
"uniqueItems": true
},
"holder": {
"oneOf": [
{
"description": "Defines unique identifier of the party who shares the Verifiable Presentation",
"type": "string",
"format": "uri"
},
{
"type": "object",
"required": ["id"],
"properties": {
"id": {
"description": "Defines unique identifier of the party who shares the Verifiable Presentation",
"type": "string",
"format": "uri"
}
}
}
]
},
"verifiableCredential": {
"description": "Contains the personal information intended to be shared",
"$comment": "Note: at the moment, only EnvelopedVerifiableCredential is supported",
"type": "array",
"items": {
"oneOf": [{ "$ref": "#/$defs/EnvelopedVerifiableCredential" }]
},
"minItems": 1
},
"relatedResource": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"description": "URL the integrity information is for",
"type": "string",
"format": "uri"
},
"mediaType": {
"description": "Expected media type for the indicated resource",
"type": "string"
},
"digestSRI": {
"description": "Digest value of Subresource Integrity",
"type": "string"
},
"digestMultibase": {
"description": "Digest value of multihash encoded in multibase.",
"type": "string"
}
},
"required": ["id"],
"anyOf": [
{
"properties": {
"digestSRI": {
"description": "Digest value of Subresource Integrity",
"type": "string"
}
},
"required": ["digestSRI"]
},
{
"properties": {
"digestMultibase": {
"description": "Digest value of multihash encoded in multibase.",
"type": "string"
}
},
"required": ["digestMultibase"]
}
]
}
}
},
"required": ["@context", "type"],
"$defs": {
"EnvelopedVerifiableCredential": {
"type": "object",
"properties": {
"@context": {
"description": "Semantic context for the enveloped Verifiable Credential. MUST be https://www.w3.org/ns/credentials/v2",
"type": "string",
"const": "https://www.w3.org/ns/credentials/v2"
},
"id": {
"description": "MUST be a data: URL that expresses a secured verifiable credential using an enveloping security scheme",
"type": "string",
"pattern": "^(data:)([\\w\/\\+-]*)(;charset=[\\w-]+|;base64){0,1},(.*)$"
},
"type": {
"description": "MUST be EnvelopedVerifiableCredential",
"type": "string",
"const": "EnvelopedVerifiableCredential"
}
},
"required": ["@context", "id", "type"]
}
}
}Installation
# with npm
npm add @cef-ebsi/[email protected]
# with Yarn
yarn add @cef-ebsi/[email protected]
# with pnpm
pnpm add @cef-ebsi/[email protected]Usage
The package exports the schema and its metadata as JavaScript objects:
import { schema, metadata } from "@cef-ebsi/vcdm2.0-presentation-schema";
// you can now use the schema and metadataIn addition, the package exports a TypeScript type corresponding to the schema:
import type { EBSIVerifiablePresentation } from "@cef-ebsi/vcdm2.0-presentation-schema";License
Copyright (C) 2026 European Union
This program is free software: you can redistribute it and/or modify it under the terms of the EUROPEAN UNION PUBLIC LICENCE v. 1.2 as published by the European Union.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the EUROPEAN UNION PUBLIC LICENCE v. 1.2 for further details.
You should have received a copy of the EUROPEAN UNION PUBLIC LICENCE v. 1.2. along with this program. If not, see https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12.
