Skip to main content

Truvity Verifiable Credentials Vocabulary

This document defines the Truvity Verifiable Credentials Vocabulary - an RDF Schema (RDFS) vocabulary used by verifiable credentials (VC) issued under the Verifiable Credentials Data Model (VCDM).

The document contains a list of terms (properties and classes from the VCDM) that extend semantics of credential data using capabilities provided by the Truvity platform.

The primary purpose of this document is to explain the semantics of values defined by these terms and guide developers on using them to ensure interoperability.

LinkedCredential

Description

A Linked Credential is a way for a credential to refer to another VC. Creating relationships between different credentials is often useful. For example, you might link a diploma credential to a professional license, or a national ID to a work visa. The Truvity SDK allows you to link credentials together to form a hierarchy of related data.

A value of type LinkedCredential, therefore, represents a reference to a previously issued VC. Having such a value as a claim on another VC establishes a link from that VC to the first one.

Semantics

A link to a VC issued according to VCDM, including an integrity check.

Values with this term in their type MUST contain two properties: id and digestMultibase. The id MUST be a URI of the linked VC. The digestMultibase must contain the SHA-256 hash of the linked VC encoded in multibase format. The hash must be calculated using the canonized form of the VC as specified by the RDF Dataset Canonicalization Algorithm (RDFC).

If the calculated hash of the dereferenced VC does not match the value in digestMultibase, the value MUST be considered invalid.

Example

The following is an example of a value of type LinkedCredential:

{
"type": "LinkedCredential", // resolved IRI: https://docs.truvity.com/vocab#LinkedCredential
"id": "https://ssi.truvity.com/tenants/1d3646a2-650a-41ff-81df-4744343533b6/credentials/0d35167d-8e1a-4806-8595-8fc3c3ec2191",
"digestMultibase": "uEiC1REFpQHY89iXN2DXCvcvVaCkFlBGgBtTJhupjv_Kvmw"
}

In the example below using the Truvity SDK, the ProfessionalLicense VC refers to the Diploma VC. This has two consequences:

  • In order to issue a ProfessionalLicense VC, one must provide a Diploma VC.
  • Having a ProfessionalLicense VC, one is able to retrieve the linked Diploma VC.
@VcContext({ name: "Diploma", namespace: "https://www.w3.org/ns/credentials/issuer-dependent" })
class Diploma {
@VcNotEmptyClaim
institution!: string;
}

@VcContext({ name: "ProfessionalCertificate", namespace: "https://www.w3.org/ns/credentials/issuer-dependent" })
class ProfessionalCertificate {
@VcNotEmptyClaim
name!: string;

@VcNotEmptyClaim
diploma!: LinkedCredential<Diploma>;
}

Further reading

SDK documentation on LinkedCredentials


LinkedFile

Description

In many cases, VCs need to include additional supporting documents, such as PDFs, images, or other file types. The Truvity SDK allows you to securely link external files to your credentials, enriching the data and providing further evidence to support the claims in the credential.

A value of type LinkedFile, therefore, represents a reference to that file. Having such a value as a claim on a VC establishes a link from that VC to the file. The Truvity SDK provides methods to upload, retrieve, and handle these files in a lightweight manner.

Semantics

A link to a file with an integrity check.

Values with this term in their type MUST contain two properties: id and digestMultibase. The id MUST be a URI of the linked file. The digestMultibase must contain the SHA-256 hash of the linked file blob encoded in multibase format.

If the calculated hash of the dereferenced file blob does not match the value in digestMultibase, the value MUST be considered invalid.

Example

The following is an example of a value of type LinkedFile:

{
"type": "LinkedFile", // resolved IRI: https://docs.truvity.com/vocab#LinkedFile
"id": "https://ssi.truvity.com/tenants/b17de333-4485-4716-986c-6ea549989e06/files/ccb8ba0d-5ed7-4f8d-b8d9-1f1e67bed461",
"digestMultibase": "uEiBE7LZKwrOIPYLL1cFqNhxSsReYRQunMEY1H0dARG_2Sw"
}

In the example below using the Truvity SDK, the ProfessionalCertificate VC has a diploma claim as a LinkedFile. This has two consequences:

  • In order to issue a ProfessionalCertificate VC, one must provide a diploma file.
  • Having a ProfessionalLicense VC, one is able to retrieve the linked diploma file.
@VcContext({ name: "ProfessionalCertificate", namespace: "https://www.w3.org/ns/credentials/issuer-dependent" })
class ProfessionalCertificate {
@VcNotEmptyClaim
name!: string;

@VcNotEmptyClaim
diploma!: LinkedFile;
}

Further reading

SDK documentation on LinkedFiles