A credential subject is the entity about which claims are made in a verifiable credential. It represents the subject of the credential—the person, organization, device, or other entity that possesses specific attributes being attested to by the issuer. In the verifiable credentials ecosystem, the credential subject forms the core component around which the entire credential is structured.
Credential subjects are essential because they connect the claims in a credential to a specific entity, providing context for the assertions being made. Without a clear subject, a credential's claims would lack meaning and applicability.
Within the W3C Verifiable Credentials Data Model, the credential subject occupies a central position as one of the primary components of a verifiable credential.
A typical verifiable credential contains these key components:
The credential subject serves as the focal point for the credential's claims—all assertions within the credential are made about this subject.
In the JSON-LD representation of a verifiable credential, the credential subject appears as a property called credentialSubject
:
In this example, the credential subject includes an identifier and a property representing a degree.
The W3C Verifiable Credentials Data Model has evolved over time, with subtle differences in how credential subjects are handled:
A credential subject must have at least one property to be valid, but its specific structure is flexible and depends on the credential type. The Vidos implementation enforces this constraint through schema validation.
The only standard property defined in the W3C specification is id
, which is optional:
One of the key features of the credential subject structure is its extensibility. Beyond the optional id
property, a credential subject can include any number of additional properties that represent the claims being made about the subject.
This extensibility allows verifiable credentials to support countless use cases, from academic credentials to identity documents, professional certifications, and more.
While the credential subject is flexible, implementations typically enforce validation rules:
id
property is included, it must be a valid URL (typically a DID)The id
property provides a unique identifier for the credential subject. While optional, including an identifier offers several benefits:
Decentralized Identifiers (DIDs) are commonly used as identifiers for credential subjects:
DIDs are particularly well-suited for this purpose because they:
Other URL-based identifiers can also be used when appropriate for specific applications.
The id
property is technically optional in the W3C specification, but specific credential types or implementations may require it depending on the use case:
When designing credential subjects, include only the properties necessary for the credential's purpose:
To enhance privacy when working with credential subjects:
For robust credential subject implementation:
The issuer is the entity that creates the credential and makes claims about the credential subject. Issuers digitally sign credentials, establishing their authenticity and integrity.
Holders store and manage credentials about themselves or other subjects. They present credentials (or parts of them) to verifiers as needed.
Verifiers request and validate credentials. They check the credential's cryptographic proof, verify the issuer's authority, and evaluate whether the credential subject meets their requirements.
Claims are statements about attributes, properties, or qualifications of the credential subject. They represent the actual information being attested to by the issuer.
The credential subject is a fundamental component of the Verifiable Credentials Data Model, representing the entity about which claims are made. Its flexible structure enables a wide range of use cases while maintaining interoperability. Understanding how to properly implement and use credential subjects is essential for building effective verifiable credential ecosystems.
By following best practices for identification, data minimization, and privacy, developers can create credential subject implementations that balance functionality with user privacy and security.