Copyright © 2019 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and permissive document license rules apply.
Credentials are a part of our daily lives; driver's licenses are used to assert that we are capable of operating a motor vehicle, university degrees can be used to assert our level of education, and government-issued passports enable us to travel between countries. This specification provides a mechanism to express these sorts of credentials on the Web in a way that is cryptographically secure, privacy respecting, and machine-verifiable.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.
Comments regarding this document are welcome, but readers should be aware that the Candidate Recommendation comment period has ended and the Working Group is unlikley to make substantive modifications to the specification at this stage. Please file issues directly on GitHub, or send them to public-vc-comments@w3.org (subscribe, archives).
The Working Group seeks implementation feedback, having set the requirement of at least two implementations of each feature as the exit criteria for the Candidate Recommendation phase. The group aims to obtain reports from two producers and two consumers for each feature if possible. For details, see the test suite and sample implementation report.
The following features are considered at risk of removal due to
potentially insufficient implementation experience (reports):
credentialSchema
property, refreshService
property, evidence
property, zero-knowledge proof
support, disputedClaim
property, JWT support,
nonTransferable
property.
Changes since the last publication of this document include:
This document was published by the Verifiable Claims Working Group as a Candidate Recommendation. This document is intended to become a W3C Recommendation.
GitHub Issues are preferred for discussion of this specification. Alternatively, you can send comments to our mailing list. Please send them to public-vc-comments@w3.org (archives).
W3C publishes a Candidate Recommendation to indicate that the document is believed to be stable and to encourage implementation by the developer community. This Candidate Recommendation is expected to advance to Proposed Recommendation no earlier than 23 April 2019.
Please see the Working Group's implementation report.
Publication as a Candidate Recommendation does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
This document is governed by the 1 March 2019 W3C Process Document.
This section is non-normative.
Credentials are a part of our daily lives; driver's licenses are used to assert that we are capable of operating a motor vehicle, university degrees can be used to assert our level of education, and government-issued passports enable us to travel between countries. These credentials provide benefits to us when used in the physical world, but their use on the Web continues to be elusive.
Currently it is difficult to express education qualifications, healthcare data, financial account details, and other sorts of third-party verified machine-readable personal information on the Web. The difficulty of expressing digital credentials on the Web makes it challenging to receive the same benefits through the Web that physical credentials provide us in the physical world.
This specification provides a standard way to express credentials on the Web in a way that is cryptographically secure, privacy respecting, and machine-verifiable.
For those unfamiliar with the concepts related to verifiable credentials, the following sections provide an overview of:
This section is non-normative.
In the physical world, a credential might consist of:
A verifiable credential can represent all of the same information that a physical credential represents. The addition of technologies, such as digital signatures, makes verifiable credentials more tamper-evident and more trustworthy than their physical counterparts.
Holders of verifiable credentials can generate verifiable presentations and then share these verifiable presentations with verifiers to prove they possess verifiable credentials with certain characteristics.
Both verifiable credentials and verifiable presentations can be transmitted rapidly, making them more convenient than their physical counterparts when trying to establish trust at a distance.
While this specification attempts to improve the ease of expressing digital credentials, it also attempts to balance this goal with a number of privacy-preserving goals. The persistence of digital information, and the ease with which disparate sources of digital data can be collected and correlated, comprise a privacy concern that the use of verifiable and easily machine-readable credentials threatens to make worse. This document outlines and attempts to address a number of these issues in Section § 7. Privacy Considerations. Examples of how to use this data model using privacy-enhancing technologies, such as zero-knowledge proofs, are also provided throughout this document.
This section is non-normative.
This section describes the roles of the core actors and the relationships between them in an ecosystem where verifiable credentials are expected to be useful. A role is an abstraction that might be implemented in many different ways. The separation of roles suggests likely interfaces and protocols for standardization. The following roles are introduced in this specification:
Figure 1 above provides an example ecosystem in which to ground the rest of the concepts in this specification. Other ecosystems exist, such as protected environments or proprietary systems, where verifiable credentials also provide benefit.
This section is non-normative.
The Verifiable Credentials Use Cases document [VC-USECASES] outlines a number of key topics that readers might find useful, including:
As a result of documenting and analyzing the use cases document, the following desirable ecosystem characteristics were identified for this specification:
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
The key words MAY, MUST, MUST NOT, RECOMMENDED, SHOULD, and SHOULD NOT in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
A conforming document is any concrete expression of the data model that complies with the normative statements in this specification. Specifically, all relevant normative statements in Sections § 4. Basic Concepts, § 5. Advanced Concepts, and § 6. Syntaxes of this document MUST be enforced. A serialization format for the conforming document MUST be deterministic, bi-directional, and lossless as described in § 6. Syntaxes. The conforming document MAY be transmitted or stored in any such serialization format.
A conforming processor is any algorithm realized as software and/or hardware that generates or consumes a conforming document. Conforming processors MUST produce errors when non-conforming documents are consumed.
This specification makes no normative statements with regard to the conformance of roles in the ecosystem, such as issuers, holders, or verifiers, because the conformance of ecosystem roles are highly application, use case, and market vertical specific.
Digital proof mechanisms, a subset of which are digital signatures, are required to ensure the protection of a verifiable credential. Having and validating proofs, which may be dependent on the syntax of the proof (for example, using the JWS of a JWT for proofing a key holder), are an essential part of processing a verifiable credential. At the time of publication, Working Group members had implemented verifiable credentials using at least three proof mechanisms: JSON Web Tokens [RFC7519], Linked Data Signatures [LD-SIGNATURES], and Camenisch-Lysyanskaya Zero-Knowledge Proofs [CL-SIGNATURES]. The group expects some of these mechanisms, as well as new ones, to mature independently and become standardized in time. Given that there are multiple valid proof mechanisms, this specification does not standardize on any single digital signature mechanism. One of the goals of this specification is to provide a data model that can be protected by a variety of current and future digital proof mechanisms. Conformance to this specification does not depend on the details of a particular proof mechanism; it requires clearly identifying the mechanism a verifiable credential uses.
This section is non-normative.
The following terms are used to describe concepts in this specification.
did:example:123456abcdef
.
This section is non-normative.
The following sections outline core data model concepts, such as claims, credentials, and presentations, which form the foundation of this specification.
This section is non-normative.
A claim is a statement about a subject. A subject is a thing about which claims can be made. Claims are expressed using subject-property-value relationships.
The data model for claims, described in Figure 2 above, is powerful and can be used to express a large variety of statements. For example, whether someone graduated from a particular university can be expressed as shown in Figure 3 below.
Individual claims can be merged together to express a graph of information about a subject. The example shown in Figure 4 below extends the previous claim by adding the claims that Pat knows Sam and that Sam is employed as a professor.
To this point, the concepts of a claim and a graph of information are introduced. To be able to trust claims, more information must be added.
This section is non-normative.
A credential is a set of one or more claims made by the same entity. Credentials might also include an identifier and metadata to describe properties of the credential, such as the issuer, the expiry date and time, a representative image, a public key to use for verification purposes, the revocation mechanism, and so on. The metadata might be signed by the issuer. A verifiable credential is a set of tamper-evident claims and metadata that cryptographically prove who issued it.
Examples of verifiable credentials include digital employee identification cards, digital birth certificates, and digital educational certificates.
Credential identifiers are often used to identify specific instances of a credential. These identifiers can also be used for correlation. A holder wanting to minimize correlation is advised to use a selective disclosure scheme that does not reveal the credential identifier.
Figure 5 above shows the basic components of a verifiable credential, but abstracts the details about how claims are organized into information graphs, which are then organized into verifiable credentials. Figure 6 below shows a more complete depiction of a verifiable credential, which is normally composed of at least two information graphs. The first graph expresses the verifiable credential itself, which contains credential metadata and claims. The second graph expresses the digital proof, which is usually a digital signature.
It is possible to have a credential, such as a marriage certificate, containing multiple claims about different subjects that are not required to be related.
It is possible to have a credential that does not contain any claims about the entity to which the credential was issued. An example is a credential that only contains claims about a specific dog, but is issued to its owner.
This section is non-normative.
Enhancing privacy is a key design feature of this specification. Therefore, it is important for entities using this technology to be able to express only the portions of their persona that are appropriate for a given situation. The expression of a subset of one's persona is called a verifiable presentation. Examples of different personas include a person's professional persona, their online gaming persona, their family persona, or an incognito persona.
A verifiable presentation expresses data from one or more verifiable credentials, and is packaged in such a way that the authorship of the data is verifiable. If verifiable credentials are presented directly, they become a verifiable presentation. Data formats derived from verifiable credentials that are cryptographically verifiable, but do not of themselves contain verifiable credentials, might also be verifiable presentations.
The data in a presentation is often about the same subject, but was issued by multiple issuers. The aggregation of this information typically expresses an aspect of a person, organization, or entity.
Figure 7 above shows the components of a
verifiable presentation, but abstracts the details about how
verifiable credentials are organized into information graphs,
which are then organized into verifiable presentations.
Figure 8 below shows a more complete depiction of a
verifiable presentation, which is normally composed of at least four
information graphs. The first graph expresses the
verifiable presentation itself, which contains
presentation metadata.
The verifiablePresentation
property in the graph refers to
one or more verifiable credentials (each a self-contained graph),
which in turn contains
credential metadata and
claims.
The third graph expresses the
credential graph proof,
which is usually a digital signature. The fourth graph expresses the
presentation graph proof,
which is usually a digital signature.
It is possible to have a presentation, such as a business persona, which draws on multiple credentials about different subjects that are often, but not required to be, related.
This section is non-normative.
The previous sections introduced the concepts of claims, verifiable credentials, and verifiable presentations using graphical depictions. This section provides a concrete set of simple but complete lifecycle examples of the data model expressed in one of the concrete syntaxes supported by this specification. The lifecycle of credentials and presentations in the Verifiable Credentials Ecosystem often take a common path:
We will use concrete examples to illustrate the lifecycle above by demonstrating how to redeem an alumni discount from a university. In the example below, Pat receives an alumni verifiable credential from a university that will be stored in Pat's digital wallet.
{ // set the context, which establishes the special terms we will be using // such as 'issuer' and 'alumniOf'. "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], // specify the identifier for the credential "id": "http://example.edu/credentials/1872", // the credential types, which declare what data to expect in the credential "type": ["VerifiableCredential", "AlumniCredential"], // the entity that issued the credential "issuer": "https://example.edu/issuers/565049", // when the credential was issued "issuanceDate": "2010-01-01T19:73:24Z", // claims about the subjects of the credential "credentialSubject": { // identifier for the only subject of the credential "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", // assertion about the only subject of the credential "alumniOf": { "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", "name": [{ "value": "Example University", "lang": "en" }, { "value": "Exemple d'Université", "lang": "fr" }] } }, // digital proof that makes the credential tamper-evident // see the NOTE at end of this section for more detail "proof": { // the cryptographic signature suite that was used to generate the signature "type": "RsaSignature2018", // the date the signature was created "created": "2017-06-18T21:19:10Z", // purpose of this proof "proofPurpose": "assertionMethod", // the identifier of the public key that can verify the signature "verificationMethod": "https://example.edu/issuers/keys/1", // the digital signature value "jws": "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..TCYt5X sITJX1CxPCT8yAV-TVkIEq_PbChOMqsLfRoPsnsgw5WEuts01mq-pQy7UJiN5mgRxD-WUc X16dUEMGlv50aqzpqh4Qktb3rk-BuQy72IFLOqV0G_zS245-kronKb78cPN25DGlcTwLtj PAYuNzVBAh4vGHSrQyHUdBBPM" } }
Pat then presents the alumni verifiable credential shown above to receive a discount. The verifier, a ticket sales system, states that any alumni of "Example University" receives a discount on season tickets to sporting events. Using a mobile device, Pat starts the process of purchasing a season ticket. A step in the process requests an alumni verifiable credential and the request is routed to Pat's digital wallet. The digital wallet asks Pat if they would like to provide the previously issued verifiable credential. Pat selects the verifiable credential, which is then composed into a verifiable presentation. The verifiable presentation is then sent to the verifier and verified.
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "type": ["VerifiablePresentation", "CredentialManagerPresentation"], // the verifiable credential issued in the previous example "verifiableCredential": [{ "id": "http://example.edu/credentials/1872", "type": ["VerifiableCredential", "AlumniCredential"], "issuer": "https://example.edu/issuers/565049", "issuanceDate": "2010-01-01T19:73:24Z", "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "alumniOf": { "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", "name": [{ "value": "Example University", "lang": "en" }, { "value": "Exemple d'Université", "lang": "fr" }] } }, "proof": { "type": "RsaSignature2018", "created": "2017-06-18T21:19:10Z", "proofPurpose": "assertionMethod", "verificationMethod": "https://example.edu/issuers/keys/1", "jws": "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..TCYt5X sITJX1CxPCT8yAV-TVkIEq_PbChOMqsLfRoPsnsgw5WEuts01mq-pQy7UJiN5mgRxD-WUc X16dUEMGlv50aqzpqh4Qktb3rk-BuQy72IFLOqV0G_zS245-kronKb78cPN25DGlcTwLtj PAYuNzVBAh4vGHSrQyHUdBBPM" } }], // digital signature by Pat on the presentation // protects against replay attacks "proof": { "type": "RsaSignature2018", "created": "2018-09-14T21:19:10Z", "proofPurpose": "authentication", "verificationMethod": "did:example:ebfeb1f712ebc6f1c276e12ec21#keys-1", // 'challenge' and 'domain' protect against replay attacks "challenge": "1f44d55f-f161-4938-a659-f8026467f126", "domain": "4jt78h47fh47", "jws": "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..kTCYt5 XsITJX1CxPCT8yAV-TVIw5WEuts01mq-pQy7UJiN5mgREEMGlv50aqzpqh4Qq_PbChOMqs LfRoPsnsgxD-WUcX16dUOqV0G_zS245-kronKb78cPktb3rk-BuQy72IFLN25DYuNzVBAh 4vGHSrQyHUGlcTwLtjPAnKb78" } }
Implementers that are interested in understanding more about the
proof
mechanism used above can learn more in
Section § 4.7 Proofs (Signatures) and by reading the
following specifications: Linked Data Proofs [LD-PROOFS], Linked Data
Signatures [LD-SIGNATURES], 2018 RSA Signature Suite [LDS-RSA2018], and
JSON Web Signature (JWS) Unencoded Payload Option [RFC7797]. A list
of proof mechanisms is available in the Verifiable Credentials
Extension Registry [VC-EXTENSION-REGISTRY].
This section introduces some basic concepts for the specification, in preparation for Section § 5. Advanced Concepts later in the document.
When two software systems need to exchange data, they need to use terminology that both systems understand. As an analogy, consider how two people communicate. Both people must use the same language and the words they use must mean the same thing to each other. This may be referred to as "the context of a conversation".
Verifiable credentials and verifiable presentations have many
attributes and values which are identified by URIs. However, those URIs
can be long and not very human-friendly. In such cases, short-form human-friendly
aliases can be more helpful. This specification uses
the @context
property to map such short-form aliases to the URIs
required by specific verifiable credentials and verifiable presentations.
In JSON-LD, the @context
property can also be used
to communicate various other details (datatype information, language
information, transformation rules, etc.) which are beyond the needs of
this specification, but may be useful in the future or to related work.
Interested readers may wish to review
Section 3.1: The Context
of the [JSON-LD] specification.
Verifiable credentials and verifiable presentations MUST include a
@context
property.
@context
property MUST be an ordered set
where the first item is a URI with the value
https://www.w3.org/2018/credentials/v1
. Subsequent items in the
array MUST express context information and be composed of any combination
of URIs and/or objects. It is RECOMMENDED that each URI in the
@context
be one which, if dereferenced, results in a document
containing machine-readable information about the @context
.
Though this specification requires that a @context
property
be present, there is no requirement that the value of the @context
property be processed using JSON-LD. This is to support processing using plain
JSON libraries such as those that may be used when the
verifiable credential is encoded as a JWT.
All libraries or processors MUST ensure that the order of the values in the
@context
property is what is expected for the particular
application. Libraries or processors that support JSON-LD can process
the @context
property using full JSON-LD processing
as expected.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/58473",
"type": ["VerifiableCredential", "AlumniCredential"],
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"alumniOf": {
"id": "did:example:c276e12ec21ebfeb1f712ebc6f1",
"name": [{
"value": "Example University",
"lang": "en"
}, {
"value": "Exemple d'Université",
"lang": "fr"
}]
}
},
"proof": { ... }
}
The example above uses the base context URI
(https://www.w3.org/2018/credentials/v1
) to establish that the
conversation is about a verifiable credential. The second URI
(https://www.w3.org/2018/credentials/examples/v1
) establishes that
the conversation is about examples.
This document uses the example context URI
(https://www.w3.org/2018/credentials/examples/v1
) for the purposes
of demonstrating examples. As with any such example document or data, the
example context URI SHOULD NOT be used for any other purpose, such
as in pilot or production systems.
The data available at https://www.w3.org/2018/credentials/v1
is a
static document that is never updated and SHOULD be downloaded and cached. The
associated human-readable vocabulary document for the Verifiable Credentials
Data Model is available at
https://www.w3.org/2018/credentials.
This concept is further expanded on in Section § 5.3 Extensibility.
The specific location and content in the JSON-LD Context URLs used throughout this document may change during the W3C Candidate Recommendation phase based on implementer feedback. The test suite will reflect any changes to the URLs or content located at the URLs.
When expressing statements about a specific thing, such as a person, product,
or organization, it is often useful to use some kind of identifier so that
others can express statements about the same thing. This specification defines
the optional id
property for such identifiers. The id
property is intended to unambiguously refer to an object such as a person,
product, or organization. This allows for the expression of statements about
specific things in the verifiable credential. If the id
property is present:
id
property MUST express an identifier that
others are expected to use when expressing statements about specific
thing identified by that identifier
id
property MUST NOT have more than one value
id
property MUST be a URI
Developers should remember that identifiers might be harmful in scenarios
where pseudonymity is required. Developers are encouraged to read
Section § 7. Privacy Considerations carefully when considering
such scenarios. Where privacy is a strong consideration, the id
property MAY be omitted.
id
property MUST be a single URI.
It is RECOMMENDED that the URI in the id
be one which, if
dereferenced, results in a document containing machine-readable information
about the id
.
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "id": "http://example.edu/credentials/3732", "type": ["VerifiableCredential", "UniversityDegreeCredential"], "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "degree": { "type": "BachelorDegree", "name": "Bachelor of Science and Arts" } }, "proof": { ... } }
The example above uses two types of identifiers. The first identifier is for the verifiable credential and uses an HTTP-based URL. The second identifier is for the subject of the verifiable credential (the thing the claims are about) and uses a decentralized identifier, also known as a DID.
As of this publication, DIDs are a new type of identifier that are not necessary for verifiable credentials to be useful. Specifically, verifiable credentials do not depend on DIDs and DIDs do not depend on verifiable credentials. However, it is expected that many verifiable credentials will use DIDs and that software libraries implementing this specification will probably need to resolve DIDs. DID-based URLs are used for expressing identifiers associated with subjects, issuers, holders, credential status lists, cryptographic keys, and other machine-readable information that is associated with a verifiable credential.
Software systems that process the kinds of objects specified in this document
use type information to determine whether or not a provided
verifiable credential or verifiable presentation is appropriate.
This specification defines a type
property for the
expression of type information.
Verifiable credentials and verifiable presentations MUST have a
type
property; in other words, any credential or
presentation that lacks a type
property is not
verifiable, so is not a verifiable credential nor a
verifiable presentation.
type
property MUST be, or map to (via
interpretation of the @context
property), one or more URIs.
If more than one URI is provided, the URIs MUST be interpreted
as an unordered set. Syntactic conveniences SHOULD be used to ease developer usage;
such conveniences may include JSON-LD terms. It is RECOMMENDED that each URI
in the type
be one which, if dereferenced, results in a document
containing machine-readable information about the type
.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { ... }
}
With respect to this specification, the following table lists the objects that MUST have a type specified.
Object | Type |
---|---|
verifiable credential object (a subclass of Credential object) |
VerifiableCredential and, optionally, a more specific
verifiable credential type. For example,"type": ["VerifiableCredential", "UniversityDegreeCredential"]
|
Credential object |
VerifiableCredential and a more specific
verifiable credential type. For example,"type": ["VerifiableCredential", "UniversityDegreeCredential"]
|
verifiable presentation object (a subclass of Presentation object) |
VerifiablePresentation and, optionally, a more specific
verifiable presentation type. For example,"type": ["VerifiablePresentation", "CredentialManagerPresentation"]
|
Presentation object |
VerifiablePresentation and a more specific
verifiable presentation type. For example,"type": ["VerifiablePresentation", "CredentialManagerPresentation"]
|
proof object |
A valid proof type. For example,"type": "RsaSignature2018"
|
credentialStatus object |
A valid credential status type. For example,"type": "CredentialStatusList2017"
|
termsOfUse object |
A valid terms of use type. For example,"type": "OdrlPolicy2017" )
|
evidence object |
A valid evidence type. For example,"type": "DocumentVerification2018"
|
The type system for the Verifiable Credentials Data Model is the same as
for [JSON-LD] and is detailed in
Section 5.4:
Specifying the Type and
Section 8: JSON-LD
Grammar. When using a JSON-LD context (see Section
§ 5.3 Extensibility), this specification aliases the
@type
keyword to type
to make the JSON-LD documents
more easily understood. While application developers and document authors do
not need to understand the specifics of the JSON-LD type system, implementers
of this specification who want to support interoperable extensibility, do.
All credentials, presentations, and encapsulated objects MUST
specify, or be associated with, additional more narrow types (like
UniversityDegreeCredential
, for example) so software systems can
process this additional information.
When processing encapsulated objects defined in this specification, (for
example, objects associated with the credentialSubject
object or
deeply nested therein), software systems SHOULD use the type information
specified in encapsulating objects higher in the hierarchy. Specifically, an
encapsulating object, such as a credential, SHOULD convey the associated
object types so that verifiers can quickly determine the contents
of an associated object based on the encapsulating object type.
For example, a credential object with the type
of
UniversityDegreeCredential
, signals to a verifier that the
object associated with the credentialSubject
property contains the
identifier for the:
id
property.
type
property.
name
property.
This enables implementers to rely on values associated with the
type
property for verification purposes. The expectation of
types and their associated properties should be documented in at least a
human-readable specification, and preferably, in an additional machine-readable
representation.
A verifiable credential contains claims about one or
more subjects. This specification defines a
credentialSubject
property for the expression of
claims about one or more subjects.
A verifiable credential MUST have a credentialSubject
property.
credentialSubject
property is defined as
a set of objects that contain one or more properties that are each related to a
subject of the verifiable credential. Each object MAY contain an
id
as described in Section § 4.2 Identifiers.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { ... }
}
This specification defines a property for expressing the issuer of a verifiable credential. A verifiable credential MUST contain the following property:
issuer
property MUST be either a
URI or an object containing a 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.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "https://example.edu/issuers/14",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { ... }
}
The value of the issuer
property may also be a JWK, e.g.,
"https://example.com/keys/foo.jwk"
, or a DID, e.g.,
"did:example:abfe13f712120431c276e12ecab"
This specification defines the following property for expressing the date and time when the credential becomes valid:
issuanceDate
property. The
value of the issuanceDate
property MUST be a string value of
an [RFC3339] combined date and time string representing the date and time
the credential becomes valid, which could be a date and time in the future.
Note that this value represents the earliest point in time at which the information
associated with the credentialSubject
property becomes valid.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "https://example.edu/issuers/14",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { ... }
}
At least one proof mechanism, and the details necessary to evaluate that proof, MUST be expressed for a credential or presentation to be a verifiable credential or verifiable presentation, i.e., to be verifiable. This specification identifies two classes of proof mechanisms: external proofs and embedded proofs. An external proof is one that wraps an expression of this data model, such as a JSON Web Token, which is elaborated upon in Section § 6.3.1 JSON Web Token. An embedded proof is a mechanism where the proof is included in the data, such as a Linked Data Signature, which is elaborated upon in Section § 6.3.2 Linked Data Proofs. When embedding a proof, the following property MUST be used:
type
property.
Because the method used for a mathematical proof varies by representation
language and the technology used, the set of name-value pairs that is expected
as the value of the proof
property will vary accordingly.
For example, if digital signatures are used for the proof mechanism, the
proof
property is expected to have name-value pairs that
include a signature, a reference to the signing entity, and a representation of
the signing date. The example below uses RSA digital signatures.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.gov/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "https://example.edu",
"issuanceDate": "2010-01-01T19:73:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": {
"type": "RsaSignature2018",
"created": "2018-06-18T21:19:10Z",
"proofPurpose": "assertionMethod",
"verificationMethod": "https://example.com/jdoe/keys/1",
"jws": "eyJhbGciOiJQUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19
..DJBMvvFAIC00nSGB6Tn0XKbbF9XrsaJZREWvR2aONYTQQxnyXirtXnlewJMB
Bn2h9hfcGZrvnC1b6PgWmukzFJ1IiH1dWgnDIS81BH-IxXnPkbuYDeySorc4
QU9MJxdVkY5EL4HYbcIfwKj6X4LBQ2_ZHZIu1jdqLcRZqHcsDF5KKylKc1TH
n5VRWy5WhYg_gBnyWny8E6Qkrze53MR7OuAmmNJ1m1nN8SxDrG6a08L78J0-
Fbas5OjAQz3c17GY8mVuDPOBIOVjMEghBlgl3nOi1ysxbRGhHLEK4s0KKbeR
ogZdgt1DkQxDFxxn41QWDw_mmMCjs9qxg0zcZzqEJw"
}
}
As discussed in Section § 1.4 Conformance, there are multiple viable
proof mechanisms, and this specification does not standardize nor recommend any
single proof mechanism for use with verifiable credentials. Implementers
that are interested in understanding more about the proof
mechanism can learn more by reading the following specifications:
Linked Data Proofs [LD-PROOFS], Linked Data Signatures [LD-SIGNATURES],
2018 RSA Signature Suite [LDS-RSA2018], and JSON Web Signature (JWS)
Unencoded Payload Option [RFC7797]. A list of proof mechanisms is available
in the Verifiable Credentials Extension Registry [VC-EXTENSION-REGISTRY].
This specification defines the following optional property for the expression of credential expiration information:
expirationDate
property MUST be
a string value of an [RFC3339] combined date and time string representing the
date and time the credential ceases to be valid.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "https://example.edu/issuers/14",
"issuanceDate": "2010-01-01T19:23:24Z",
"expirationDate": "2020-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { ... }
}
This specification defines the following property for the discovery of information about the current status of a verifiable credential, such as whether it is suspended or revoked:
credentialStatus
property MUST include the:
id
property, which MUST be a URL.
type
property, which expresses the credential status
type (also referred to as the credential status method). It is expected
that the value will provide enough information to determine the current status
of the credential. For example, the object could contain a link to an
external document noting whether or not the credential is suspended or
revoked.
The precise contents of the credential status information is determined
by the specific credentialStatus
type definition, and varies
depending on factors such as whether it is simple to implement or if it is
privacy-enhancing.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "https://example.edu/issuers/14",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"credentialStatus": {
"id": "https://example.edu/status/24",
"type": "CredentialStatusList2017"
},
"proof": { ... }
}
Defining the data model, formats, and protocols for status schemes are out of scope for this specification. A Verifiable Credential Extension Registry [VC-EXTENSION-REGISTRY] exists that contains available status schemes for implementers who want to implement verifiable credential status checking.
Presentations MAY be used to combine and present credentials. They can be packaged in such a way that the authorship of the data is verifiable. The data in a presentation is often all about the same subject, but there is no limit to the number of subjects or issuers in the data. The aggregation of information from multiple verifiable credentials is a typical use of verifiable presentations.
A verifiable presentation is typically composed of the following properties:
id
property is optional and MAY be used to provide a
unique identifier for the presentation.
See Section § 4.2 Identifiers for details related to the use of this
property.
type
property is required and expresses the
type of presentation, such as VerifiablePresentation
.
See Section § 4.3 Types for details related to the use of this
property.
verifiableCredential
property
MUST be constructed from one or more verifiable credentials, or of data
derived from verifiable credentials in a cryptographically
verifiable format.
proof
property ensures that
the presentation is verifiable. See Section
§ 4.7 Proofs (Signatures) for details related to the use of this
property.
The example below shows a verifiable presentation that embeds verifiable credentials.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "urn:uuid:3978344f-8596-4c3a-a978-8fcaba3903c5",
"type": ["VerifiablePresentation", "CredentialManagerPresentation"],
"verifiableCredential": [{ ... }],
"proof": [{ ... }]
}
The contents of the verifiableCredential
property shown
above are verifiable credentials, as described by this specification. The
contents of the proof
property are proofs, as described by
the Linked Data Proofs [LD-PROOFS] specification. An example of a
verifiable presentation using the JWT proof mechanism is given in section
§ 6.3.1 JSON Web Token.
Some zero-knowledge cryptography schemes might enable holders to indirectly prove they hold claims from a verifiable credential without revealing the verifiable credential itself. In these schemes, a claim from a verifiable credential might be used to derive a presented value, which is cryptographically asserted such that a verifier can trust the value if they trust the issuer.
For example, a verifiable credential containing the claim
date of birth
might be used to derive the presented value
over the age of 15
in a manner that is cryptographically
verifiable. That is, a verifier can still trust the derived value if
they trust the issuer.
For an example of a ZKP-style verifiable presentation containing derived data instead of directly embedded verifiable credentials, see Section § 5.8 Zero-Knowledge Proofs.
Selective disclosure schemes using zero-knowledge proofs can use claims expressed in this model to prove additional statements about those claims. For example, a claim specifying a subject's date of birth can be used as a predicate to prove the subject's age is within a given range, and therefore prove the subject qualifies for age-related discounts, without actually revealing the subject's birthdate. The holder has the flexibility to use the claim in any way that is applicable to the desired verifiable presentation.
Building on the concepts introduced in Section § 4. Basic Concepts, this section explores more complex topics about verifiable credentials.
This section is non-normative.
Section § 1.2 Ecosystem Overview provided an overview of the verifiable credential ecosystem. This section provides more detail about how the ecosystem is envisaged to operate:
The order of the actions above is not fixed, and some actions might be taken more than once. Such action-recurrence may be immediate or at any later point.
The most comon sequence of actions is envisioned to be issuer issues to subject, subject presents to verifier, and verifier verifies.
This specification does not define any protocol for transfering verifiable credentials or verifiable presentations, but assuming other specifications do specify how they are transferred between entities, then this Verifiable Credential Data Model is directly applicable.
This specification does not define an authorization framework nor the decisions that a verifier might make after verifying a verifiable credential or verifiable presentation, taking into account the holder, the issuers of the verifiable credentials, the contents of the verifiable credentials, and its own policies.
In particular, Sections § 5.6 Terms of Use and § B. Subject-Holder Relationships specify how a verifier can determine:
This section is non-normative.
The verifiable credentials trust model is as follows:
This trust model differentiates itself from other trust models by ensuring the:
By decoupling the trust between the identity provider and the relying party a more flexible and dynamic trust model is created such that market competition and customer choice is increased.
For more information about how this trust model interacts with various threat models studied by the Working Group, see the Verifiable Credentials Use Cases document [VC-USECASES].
The data model detailed in this specification does not imply a transitive trust model, such as that provided by more traditional Certificate Authority trust models. In the Verifiable Credentials Data Model, a verifier either directly trusts or does not trust an issuer. While it is possible to build transitive trust models using the Verifiable Credentials Data Model, implementers are urged to learn about the security weaknesses introduced by broadly delegating trust in the manner adopted by Certificate Authority systems.
One of the goals of the Verifiable Credentials Data Model is to enable permissionless innovation. To achieve this, the data model needs to be extensible in a number of different ways. The data model is required to:
This approach to data modelling is often called an open world assumption, meaning that any entity can say anything about any other entity. While this approach seems to conflict with building simple and predictable software systems, balancing extensibility with program correctness is always more challenging with an open world assumption than with closed software systems.
The rest of this section describes, through a series of examples, how both extensibility and program correctness are achieved.
Let us assume we start with the verifiable credential shown below.
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "id": "http://example.com/credentials/4643", "type": ["VerifiableCredential"], "issuer": "https://example.com/issuers/14", "issuanceDate": "2018-02-24T05:28:04Z", "credentialSubject": { "id": "did:example:abcdef1234567", "name": "Jane Doe" }, "proof": { ... } }
This verifiable credential states that the entity associated with
did:example:abcdef1234567
has a name
with a value of
Jane Doe
.
Now let us assume a developer wants to extend the verifiable credential to store two additional pieces of information: an internal corporate reference number, and Jane's favorite food.
The first thing to do is to create a JSON-LD context containing two new terms, as shown below.
{ "@context": { "referenceNumber": "https://example.com/vocab#referenceNumber", "favoriteFood": "https://example.com/vocab#favoriteFood" } }
After this JSON-LD context is created, the developer publishes it somewhere
so it is accessible to verifiers who will be processing the
verifiable credential. Assuming the above JSON-LD context is published
at https://example.com/contexts/mycontext.jsonld
, we can extend
this example by including the context and adding the new properties and
credential type to the verifiable credential.
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://example.com/contexts/mycontext.jsonld" ], "id": "http://example.com/credentials/4643", "type": ["VerifiableCredential", "CustomExt12"], "issuer": "https://example.com/issuers/14", "issuanceDate": "2018-02-24T05:28:04Z", "referenceNumber": 83294847, "credentialSubject": { "id": "did:example:abcdef1234567", "name": "Jane Doe", "favoriteFood": "Papaya" }, "proof": { ... } }
This example demonstrates extending the Verifiable Credentials Data Model in a permissionless and decentralized way. The mechanism shown also ensures that verifiable credentials created in this way provide a mechanism to prevent namespace conflicts and semantic ambiguity.
A dynamic extensibility model such as this does increase the implementation burden. Software written for such a system has to determine whether verifiable credentials with extensions are acceptable based on the risk profile of the application. Some applications might accept only certain extensions while highly secure environments might not accept any extensions. These decisions are up to the developers of these applications and are specifically not the domain of this specification.
Developers are urged to ensure that extension JSON-LD contexts are highly available. Implementations that cannot fetch a context will produce an error. Strategies for ensuring that extension JSON-LD contexts are always available include using content-addressed URLs for contexts, bundling context documents with implementations, or enabling aggressive caching of contexts.
Implementers are advised to pay particular attention to the extension points in this specification such as Section § 4.7 Proofs (Signatures), Section § 4.9 Status, Section § 5.4 Data Schemas, Section § 5.5 Refreshing, Section § 5.6 Terms of Use, and Section § 5.7 Evidence. While this specification does not define concrete implementations for those extension points, the Verifiable Credentials Extension Registry [VC-EXTENSION-REGISTRY] provides an unofficial, curated list of extensions that developers can use to utilize these extension points.
This specification ensures that "plain" JSON and JSON-LD syntaxes are semantically compatible without requiring JSON implementations to use a JSON-LD processor. To achieve this, the specification imposes the following additional requirements on both syntaxes:
@context
key,
ensuring the expected values exist in the expected order for the
credential type being processed. The order is important because
keys used in a credential, which are defined via the
values associated with @context
, are defined using a
"first defined wins" mechanism and changing the order might result in a
different key definition "winning".
@protected
feature in the JSON-LD 1.1 specification.
A human-readable document describing the expected order of values for the
@context
property is expected to be published by any
implementer seeking interoperability. A machine-readable description
(i.e., a normal JSON-LD Context document) is expected to be published
at the URL specified in the @context
property by
JSON-LD implementers seeking interoperability.
The requirements above guarantee semantic interoperability between JSON and
JSON-LD for terms defined by the @context
mechanism. While JSON-LD
processors will use the specific mechanism provided and can verify that all
terms are correctly specified, JSON-based processors implicitly accept the same
set of terms without testing that they are correct. In other words, the context
in which the data exchange happens is explicitly stated for both JSON and
JSON-LD by using the same mechanism. With respect to JSON-based processors,
this is achieved in a lightweight manner, without having to use JSON-LD
processing libraries.
Data schemas are useful when enforcing a specific structure on a given collection of data. There are at least two types of data schemas that this specification considers:
It is important to understand that data schemas serve a different purpose from
the @context
property, which neither enforces data structure or
data syntax, nor enables the definition of arbitrary encodings to
alternate representation formats.
This specification defines the following property for the expression of a data schema:
credentialSchema
property MUST be one or
more data schemas that provide verifiers with enough information to
determine if the provided data conforms to the provided schema. Each
credentialSchema
MUST specify its
type
(for example, JsonSchemaValidator2018
), and an
id
property that MUST be a URI identifying the
schema file. The precise contents of each data schema is determined by the
specific type definition.
The credentialSchema
provides an opportunity to annotate type
definitions or lock them to specific versions of the vocabulary. Authors of VCs
can include a static version of their vocabulary via credentialSchema that is
locked to some content integrity protection mechanism.
The credentialSchema
property also makes it possible to
perform syntactic checking on the credential and use verification mechanisms
such as JSON Schema validation.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "https://example.edu/issuers/14",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"credentialSchema": {
"id": "https://example.org/examples/degree.json",
"type": "JsonSchemaValidator2018"
},
"proof": { ... }
}
In the example above, the issuer is specifying a
credentialSchema
, which points to a [JSON-SCHEMA] file that can
be used by a verifier to determine if the verifiable credential is
well formed.
For information about linkages to JSON Schema or other optional verification mechanisms, see the [VC-IMP-GUIDE].
Data schemas can also be used to specify mappings to other binary formats, such
as those used to perform zero-knowledge proofs. For more information on using
the credentialSchema
property with zero-knowledge proofs,
see Section § 5.8 Zero-Knowledge Proofs.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "https://example.edu/issuers/14",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"credentialSchema": {
"id": "https://example.org/examples/degree.zkp",
"type": "ZkpExampleSchema2018"
},
"proof": { ... }
}
In the example above, the issuer is specifying a
credentialSchema
pointing to a zero-knowledge packed binary
data format that is capable of transforming the input data into a format,
which can then be used by a verifier to determine if the proof provided
with the verifiable credential is valid.
The usage of the Data Schemas property may change during the W3C Candidate Recommendation process based on implementer feedback. Specifically, the location of its usage may be expanded. It may also be removed if there is not enough implementation support.
It is useful for systems to enable the manual or automatic refresh of an expired verifiable credential. This specification enables an issuer to include a link to a refresh service.
The issuer can include the refresh service as an element inside the verifiable credential if it is intended for either the verifier or the holder (or both), or inside the verifiable presentation if it is intended for the holder only. In the latter case, this enables the holder to refresh the verifiable credential before creating a verifiable presentation to share with a verifier. In the former case, including the refresh service inside the verifiable credential enables both the holder and the verifier to perform future updates of the credential.
The refresh service is only expected to be used when either 1) the credential
has expired, or 2) the issuer does not publish credential status
information. Issuers are advised not to put the refreshService
in a verifiable credential that does not contain public information, or
whose refresh service is not protected in some way.
Placing a refreshService
in a verifiable credential so that
it is available to verifiers can remove control and consent from the
holder and allow the verifiable credential to be issued directly
to the verifier, thereby bypassing the holder.
This specification defines the following property for expressing a refresh service:
refreshService
property MUST be one or
more refresh services that provides enough information to the recipient's
software such that the recipient can refresh the verifiable credential.
Each refreshService
value MUST specify its type
(for
example, ManualRefreshService2018
) and its
id
, which is the URL of the service. The precise content of each
refresh service is determined by the specific refreshService
type definition.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "https://example.edu/issuers/14",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"refreshService": {
"id": "https://example.edu/refresh/3732"
"type": "ManualRefreshService2018",
},
"proof": { ... }
}
In the example above, the issuer specifies a manual
refreshService
that can be used by directing the holder or
the verifier to https://example.edu/refresh/3732
.
The refresh service may change based on implementer feedback, including being removed from the specification if there is not enough implementer support for the feature.
Terms of use can be utilized by an issuer or a holder to communicate the terms under which a verifiable credential or verifiable presentation was issued. The issuer places their terms of use inside the verifiable credential. The holder places their terms of use inside a verifiable presentation. The value of this property tells the verifier what actions it is required to perform (an obligation), not allowed to perform (a prohibition), or allowed perform (a permission) if it is to accept the verifiable credential or verifiable presentation.
Further study is required to determine how a subject who is not a holder places terms of use on their verifiable credentials. One way could be for the subject to request the issuer to place the terms of use inside the issued verifiable credentials. Another way could be for the subject to delegate a verifiable credential to a holder and placing terms of use restrictions on the delegated verifiable credential.
This specification defines the following property for expressing terms of use:
termsOfUse
property MUST
specify one or more terms of use policies under which the creator issued the
credential or presentation. If the recipient (a holder or
verifier) is not willing to adhere to the specified terms of use, then
they do so on their own responsibility and might incur legal liability if they
violate the stated terms of use. Each termsOfUse
value MUST specify
its type, for example, IssuerPolicy
, and MAY specify its
instance id
. The precise contents of each term of use is determined
by the specific termsOfUse
type definition.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "https://example.edu/issuers/14",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"termsOfUse": [{
"type": "IssuerPolicy",
"id": "http://example.com/policies/credential/4",
"profile": "http://example.com/profiles/credential",
"prohibition": [{
"assigner": "https://example.edu/issuers/14",
"assignee": "AllVerifiers",
"target": "http://example.edu/credentials/3732",
"action": ["Archival"]
}]
},
"proof": { ... }
}
In the example above, the issuer (the assigner
) is
prohibiting verifiers (the assignee
) from storing the data
in an archive.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"type": ["VerifiablePresentation", "CredentialManagerPresentation"],
"verifiableCredential": [{
"id": "http://example.edu/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "https://example.edu/issuers/14",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { ... }
}],
"termsOfUse": [{
"type": "HolderPolicy",
"id": "http://example.com/policies/credential/6",
"profile": "http://example.com/profiles/credential",
"prohibition": [{
"assigner": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"assignee": "https://wineonline.example.org/",
"target": "http://example.edu/credentials/3732",
"action": ["3rdPartyCorrelation"]
}]
},
"proof": [ ... ]
}
In the example above, the holder (the assigner
), who is
also the subject, expressed a term of use prohibiting the verifier
(the assignee
, https://wineonline.example.org
) from
using the information provided to correlate the holder or subject
using a third-party service. If the verifier were to use a third-party
service for correlation, they would violate the terms under which the
holder created the presentation.
The terms of use feature may change during the W3C Candidate Recommendation phase including being removed entirely if there is not enough implementer support for the feature.
Evidence can be included by an issuer to provide the verifier with additional supporting information in a verifiable credential. This could be used by the verifier to establish the confidence with which it relies on the claims in the verifiable credential.
For example, an issuer could check physical documentation provided by the subject or perform a set of background checks before issuing the credential. In certain scenarios, this information is useful to the verifier when determining the risk associated with relying on a given credential.
This specification defines the following property for expressing evidence information:
evidence
property MUST be one or more
evidence schemes providing enough information for a verifier to determine
whether the evidence gathered by the issuer meets its confidence
requirements for relying on the credential. Each evidence scheme is
identified by its type. The id
property is optional, but if
present, SHOULD contain a URL that points to where more information about this
instance of evidence can be found. The precise content of each evidence scheme
is determined by the specific evidence
type definition.
For information on how attachments and references to credentials and non-credential data might be supported by the specification, the [VC-IMP-GUIDE].
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "https://example.edu/issuers/14",
"issuanceDate": "2010-01-01T19:23:24Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"evidence": [{
"id": "https://example.edu/evidence/f2aeec97-fc0d-42bf-8ca7-0548192d4231",
"type": ["DocumentVerification"],
"verifier": "https://example.edu/issuers/14",
"evidenceDocument": "DriversLicense",
"subjectPresence": "Physical",
"documentPresence": "Physical"
},{
"id": "https://example.edu/evidence/f2aeec97-fc0d-42bf-8ca7-0548192dxyzab",
"type": ["SupportingActivity"],
"verifier": "https://example.edu/issuers/14",
"evidenceDocument": "Fluid Dynamics Focus",
"subjectPresence": "Digital",
"documentPresence": "Digital"
}],
"proof": { ... }
}
The evidence
property provides different and complementary
information to the proof
property. The evidence
property is used to express
supporting information, such as documentary evidence, related to the integrity
of the verifiable credential. In contrast, the proof
property is used to express machine-verifiable mathematical proofs
related to the authenticity of the issuer and integrity of the
verifiable credential.
The evidence feature may change during the W3C Candidate Recommendation phase based on implementer feedback, or be removed entirely due to lack of support by implementers.
A zero-knowledge proof is a cryptographic method where an entity can prove to another entity that they know a certain value without disclosing the actual value. A real-world example is proving that an accredited university has granted a degree to you without revealing your identity or any other personally identifiable information contained on the degree.
The key capabilities introduced by zero-knowledge proof mechanisms are the ability of a holder to:
This specification describes a data model that supports zero-knowledge proof mechanisms. The examples below highlight how the data model can be used to issue, present, and verify zero-knowledge verifiable credentials.
To use zero-knowledge verifiable credentials the issuer must issue a verifiable credential in a manner that enables the holder to present the information to a verifier in a privacy-enhancing manner. This implies that the holder can prove the validity of the issuer's signature without revealing the values that were signed, or when only revealing certain selected values. The standard practice is to do so by proving knowledge of the signature, without revealing the signature itself. There are two requirements for verifiable credentials when they are to be used in zero-knowledge proof systems. The verifiable credential MUST contain a:
credentialSchema
property,
that can be used by all parties to perform various cryptographic operations in
zero-knowledge.
proof
property, that can be used to derive
verifiable presentations that present information contained in the
original verifiable credential in zero-knowledge. The zero-knowledge
verifiable presentation must not reveal any information not intended to
be revealed by the holder.
The following example shows one method of using verifiable credentials in zero-knowledge. It makes use of a CL Signature, which allows the presentation of the verifiable credential in a way that supports the privacy of the holder and subject through the use of selective disclosure of the verifiable credential values.
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "type": ["VerifiableCredential", "UniversityDegreeCredential"], "credentialSchema": { "id": "did:example:cdf:35LB7w9ueWbagPL94T9bMLtyXDj9pX5o", "type": "did:example:schema:22KpkXgecryx9k7N6XN1QoN3gXwBkSU8SfyyYQG" }, "issuer": "did:example:Wz4eUg7SetGfaUVCn8U9d62oDYrUJLuUtcy619", "credentialSubject": { "givenName": "Jane", "familyName": "Doe", "degree": { "type": "BachelorDegree", "name": "Bachelor of Science and Arts", "college": "College of Engineering" } }, "proof": { "type": "CLSignature2019", "issuerData": "5NQ4TgzNfSQxoLzf2d5AV3JNiCdMaTgm...BXiX5UggB381QU7ZCgqWivUmy4D", "attributes": "pPYmqDvwwWBDPNykXVrBtKdsJDeZUGFA...tTERiLqsZ5oxCoCSodPQaggkDJy", "signature": "8eGWSiTiWtEA8WnBwX4T259STpxpRKuk...kpFnikqqSP3GMW7mVxC4chxFhVs", "signatureCorrectnessProof": "SNQbW3u1QV5q89qhxA1xyVqFa6jCrKwv...dsRypyuGGK3RhhBUvH1tPEL8orH" } }
The example above provides the verifiable credential definition by using
the credentialSchema
property and a specific proof that is
usable in the Camenisch-Lysyanskaya Zero-Knowledge Proof system.
The next example utilizes the verifiable credential above to generate a new derived verifiable credential with a privacy-preserving proof. The derived verifiable credential is then placed in a verifiable presentation, which further proves that the entire assertion is valid. There are three requirements of most verifiable presentations when they are to be used in zero-knowledge systems:
credentialSchema
property. This allows the derived verifiable credential reference
the credential definition used to generate the derived proof.
proof
property to enable the verifier to ascertain that all derived
verifiable credentials in the verifiable presentation were issued
to the same holder without leaking personally identifiable information
that the holder did not intend to share.
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "type": ["VerifiablePresentation", "CredentialManagerPresentation"], "verifiableCredential": [ { "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "type": ["VerifiableCredential", "UniversityDegreeCredential"], "credentialSchema": { "id": "did:example:cdf:35LB7w9ueWbagPL94T9bMLtyXDj9pX5o", "type": "did:example:schema:22KpkXgecryx9k7N6XN1QoN3gXwBkSU8SfyyYQG" }, "issuer": "did:example:Wz4eUg7SetGfaUVCn8U9d62oDYrUJLuUtcy619", "credentialSubject": { "degreeType": "BachelorDegree", "degreeSchool": "College of Engineering" }, "proof": { "type": "AnonCredDerivedCredentialv1", "primaryProof": "cg7wLNSi48K5qNyAVMwdYqVHSMv1Ur8i...Fg2ZvWF6zGvcSAsym2sgSk737", "nonRevocationProof": "mu6fg24MfJPU1HvSXsf3ybzKARib4WxG...RSce53M6UwQCxYshCuS3d2h" } }], "proof": { "type": "AnonCredPresentationProofv1", "proofValue": "DgYdYMUYHURJLD7xdnWRinqWCEY5u5fK...j915Lt3hMzLHoPiPQ9sSVfRrs1D" } }
Important details regarding the format for the credential definition and of the proofs are omitted on purpose because they are outside of the scope of this document. The purpose of this section is to guide implementers who want to extend verifiable credentials and verifiable presentations to support zero-knowledge proof systems.
Zero Knowledge Proofs are a feature at risk. The Working Group is looking for multiple implementers to support the feature during the W3C Candidate Recommendation phase.
There are at least two different cases to consider for an entity wanting to dispute a credential issued by an issuer:
address
property is incorrect or out of date.
The mechanism for issuing a DisputeCredential
is the same as
for a regular credential except that the credentialSubject
identifier in the DisputeCredential
property is the identifier of
the disputed credential.
For example, if a credential with an identifier of
https://example.org/credentials/245
is disputed, the subject
can issue the credential shown below and present it to the verifier
along with the disputed credential.
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.com/credentials/123",
"type": ["VerifiableCredential", "DisputeCredential"],
"credentialSubject": {
"id": "http://example.com/credentials/245",
"currentStatus": "Disputed",
"statusReason": {
"value": "Address is out of date.",
"lang": "en"
},
},
"issuer": "https://example.com/people#me",
"issuanceDate": "2017-12-05T14:27:42Z",
"proof": { ... }
}
In the above verifiable credential the issuer is claiming that the address in the disputed verifiable credential is wrong.
If a credential does not have an identifier, a content-addressed identifier can be used to identify the disputed credential. Similarly, content-addressed identifiers can be used to uniquely identify individual claims.
This particular area of study is rapidly evolving and developers that are interested in publishing credentials that dispute the veracity of other credentials are urged to read the section related to disputes in the Verifiable Credentials Implementation Guidance [VC-IMP-GUIDE].
The dispute feature may change significantly during the W3C Candidate Recommendation process including possibly being removed if there is not enough support from implementations for the feature.
This section is non-normative.
Verifiable credentials are intended as a means of reliably identifying subjects. While it is recognized that Role Based Access Controls (RBACs) and Attribute Based Access Controls (ABACs) rely on this identification as a means of authorizing subjects to access resources, this specification does not provide a complete solution for RBAC or ABAC. Authorization is not an appropriate use for this specification without an accompanying authorization framework.
The Working Group did consider authorization use cases during the creation of this specification and is pursuing that work as an architectural layer built on top of this specification.
The data model as described in Sections § 3. Core Data Model, § 4. Basic Concepts, and § 5. Advanced Concepts is the canonical structural representation of a verifiable credential or verifiable presentation. All serializations are representations of that data model in a specific format. This section specifies how the data model is realized in JSON-LD and plain JSON. Although syntactic mappings are provided for only these two syntaxes, applications and services can use any other data representation syntax (such as XML, YAML, or CBOR) that is capable of expressing the data model. As the verification and validation requirements are defined in terms of the data model, all serialization syntaxes have to be deterministically translated to the data model for processing, validation, or comparison. This specification makes no requirements for support of any specific serialization format.
The data model, as described in Section § 3. Core Data Model, can be encoded in Javascript Object Notation (JSON) [RFC8259] by mapping property values to JSON types as follows:
As the transformations listed herein have potentially incompatible interpretations, additional profiling of the JSON format is required to provide a deterministic transformation to the data model.
[JSON-LD] is a JSON-based format used to serialize Linked Data. The syntax is designed to easily integrate into deployed systems already using JSON, and provides a smooth upgrade path from JSON to [JSON-LD]. It is primarily intended to be a way to use Linked Data in Web-based programming environments, to build interoperable Web services, and to store Linked Data in JSON-based storage engines.
[JSON-LD] is useful when extending the data model described in this
specification. Instances of the data model are encoded in [JSON-LD] in the
same way they are encoded in JSON (Section § 6.1 JSON), with the
addition of the @context
property. The
JSON-LD context
is described in detail in the [JSON-LD] specification and its use is
elaborated on in Section § 5.3 Extensibility.
Multiple contexts MAY be used or combined to express any arbitrary information
about verifiable credentials in idiomatic JSON. The
JSON-LD context,
available at https://www.w3.org/2018/credentials/v1
, is a static
document that is never updated and can therefore be downloaded and cached client
side. The associated vocabulary document for the Verifiable Credentials Data
Model is available at https://www.w3.org/2018/credentials
.
In general, the data model and syntaxes described in this document are designed such that developers can copy and paste examples to incorporate verifiable credentials into their software systems. The design goal of this approach is to provide a low barrier to entry while still ensuring global interoperability between a heterogeneous set of software systems. This section describes some of these approaches, which will likely go unnoticed by most developers, but whose details will be of interest to implementers. The most noteworthy syntactic sugars provided by [JSON-LD] are:
@id
and @type
keywords are aliased to
id
and type
respectively, enabling developers to use
this specification as idiomatic JSON.
verifiableCredential
and proof
properties
are treated as graph containers. That is, mechanisms used to isolate
sets of data asserted by different entities. This ensures, for example, proper
cryptographic separation between the data graph provided by each issuer
and the one provided by the holder presenting the
verifiable credential to ensure the provenance of the information for
each graph is preserved.
@protected
properties feature of [JSON-LD] 1.1 is used to
ensure that terms defined by this specification cannot be overridden. This means
that as long as the same @context
declaration is made at the top of
a verifiable credential or verifiable presentation,
interoperability is guaranteed for all terms understood by users of the data
model whether or not they use a [JSON-LD] processor.
The data model described in this specification is designed to be proof format agnostic. This specification does not normatively require any particular digital proof or signature format. While the data model is the canonical representation of a verifiable credential or verifiable presentation, the proofing mechanisms for these are often tied to the syntax used in the transmission of the document between parties. As such, each proofing mechanism has to specify whether the validation of the proof is calculated against the state of the document as transmitted, against the transformed data model, or another form. At the time of publication, at least two proof formats are being actively utilized by implementers and the Working Group felt that documenting what these proof formats are and how they are being used would be beneficial to implementers. The sections detailing the current proof formats being actively utilized to issue verifiable credentials are:
JSON Web Token (JWT) [RFC7519] is still a widely used means to express claims to be transferred between two parties. Providing a representation of the Verifiable Credentials Data Model for JWT allows existing systems and libraries to participate in the ecosystem described in Section § 1.2 Ecosystem Overview. A JWT encodes a set of claims as a JSON object that is contained in a JSON Web Signature (JWS) [RFC7515] or JWE [RFC7516]. For this specification, the use of JWE is out of scope.
JWT support is a feature at risk and may be removed during the W3C Candidate Recommendation phase if there is not enough implementer support for the feature.
This specification defines encoding rules of the Verifiable Credential Data Model onto JWT and JWS. It further defines processing rules how and when to make use of specific JWT-registered claim names and specific JWS-registered header parameter names to allow systems based on JWT to comply with this specification. If these specific claim names and header parameters are present, their respective counterpart in the standard verifiable credential and verifiable presentation MAY be omitted to avoid duplication.
This specification introduces two new registered claim names, which contain those parts of the standard verifiable credentials and verifiable presentations where no explicit encoding rules for JWT exist. These objects are enclosed in the JWT payload as follows:
vc
: JSON object, which MUST be present in a JWT
verifiable credential. The object contains the
verifiable credential according to this specification.
vp
: JSON object, which MUST be present in a JWT
verifiable presentation. The object contains the
verifiable presentation according to this specification.
To encode a verifiable credential as a JWT, specific properties
introduced by this specification MUST be either 1) encoded as standard JOSE
header parameters, 2) encoded as registered JWT claim names, or 3)
contained in the JWS signature part. If no explicit rule is specified,
properties are encoded in the same way as with a standard
verifiable credential, and are added to the vc
property of the JWT. As with all JWTs, the JWS-based signature of
a verifiable credential represented in the JWT syntax is calculated
against the literal JWT string value as presented across the wire, before
any decoding or transformation rules are applied. The following paragraphs
describe these encoding rules.
If a JWS is present, the digital signature either refers to the issuer
of the verifiable credential, or in the case of a
verifiable presentation, the holder of the
verifiable credential. The JWS proves that the issuer of the JWT
signed the contained JWT payload and therefore, the proof
property can be omitted.
If no JWS is present, a proof
property MUST be provided.
The proof
property can be used to represent a more complex
proof, as may be necessary if the creator is different from the issuer, or a
proof not based on digital signatures, such as Proof of Work. The issuer
MAY include both a JWS and a proof
property. For backward
compatibility reasons, the issuer MUST use JWS to represent proofs based on a
digital signature.
The following rules apply to JOSE headers in the context of this specification:
alg
MUST be used for RSA and ECDSA-based digital signatures. If
only the proof
attribute is used, the alg
header MUST
be set to none
.
kid
MAY be used if there are multiple keys associated with the
issuer of the JWT. The key discovery is out of the scope of this
specification. For example, the kid
can refer to a key in a
DID document, or can be the identifier of a key inside a JWKS.
typ
, if present, MUST be set to JWT
.
For backward compatibility with JWT processors, the following JWT-registered claim names MUST be used instead of, or in addition to, their respective standard verifiable credential counterparts:
exp
MUST represent expirationDate
, encoded as a UNIX
timestamp (NumericDate
).
iss
MUST represent the issuer
property.
iat
MUST represent issuanceDate
, encoded as a UNIX
timestamp (NumericDate
).
jti
MUST represent the id
property of the
verifiable credential, or verifiable presentation.
sub
MUST represent the id
property contained
in the verifiable credential subject.
aud
MUST represent the subject
of the consumer of the
verifiable presentation.
Other JOSE header parameters and claim names not specified herein can be
used if their use is not explicitly discouraged. Additional claims MUST
be added to the credentialSubject
property of the JWT.
This version of the specification defines no JWT-specific encoding rules for
the concepts outlined in Section
Advanced Concepts (for example,
refreshService
, termsOfUse
, and
evidence
). These concepts can be encoded as they are without any
transformation, and can be added to the vc
property of the
JWT.
Implementers are warned that JWTs are not capable of encoding multiple subjects and are thus not capable of encoding a verifiable credential with more than one subject. JWTs might support multiple subjects in the future and implementers are advised to refer to the JSON Web Token Claim Registry for multi-subject JWT claim names or the Nested JSON Web Token specification.
To decode a JWT to a standard verifiable credential, the following transformation MUST be performed:
vc
property to the new JSON object.
To transform the JWT specific headers and claims, the following MUST be done:
exp
is present, the UNIX timestamp MUST be converted to an
[RFC3339] date-time
, and MUST be used to set the value
of the expirationDate
property of
credentialSubject
of the new JSON object.
iss
is present, the value MUST be used to set the
issuer
property of the new JSON object.
iat
is present, the UNIX timestamp MUST be converted to an
[RFC3339] date-time
, and MUST be used to set the value
of the issuanceDate
property of the new JSON object.
sub
is present, the value MUST be used to set the value of the
id
property of credentialSubject
of the new
JSON object.
jti
is present, the value MUST be used to set the value of the
id
property of the new JSON object.
{ "alg": "RS256", "typ": "JWT", "kid": "did:example:abfe13f712120431c276e12ecab#keys-1" }
In the example above, the verifiable credential uses a
proof
based on JWS
digital signatures, and the
corresponding verification key can be obtained using the kid
header parameter.
{ "sub": "did:example:ebfeb1f712ebc6f1c276e12ec21", "jti": "http://example.edu/credentials/3732", "iss": "https://example.com/keys/foo.jwk", "iat": 1541493724, "exp": 1573029723, "nonce": "660!6345FSer", "vc": { "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "type": ["VerifiableCredential", "UniversityDegreeCredential"], "credentialSubject": { "degree": { "type": "BachelorDegree", "name": "Bachelor of Science and Arts" } } } }
In the example above, vc
does not contain the id
property because the JWT
encoding uses the jti
attribute to represent a unique identifier. The sub
attribute
encodes the information represented by the id
property of
credentialSubject
.
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImRpZDpleGFtcGxlOmFiZmUxM2Y3MTIxMjA0
MzFjMjc2ZTEyZWNhYiNrZXlzLTEifQ.eyJzdWIiOiJkaWQ6ZXhhbXBsZTplYmZlYjFmNzEyZWJjNmYxY
zI3NmUxMmVjMjEiLCJqdGkiOiJodHRwOi8vZXhhbXBsZS5lZHUvY3JlZGVudGlhbHMvMzczMiIsImlzc
yI6ImRpZDpleGFtcGxlOmFiZmUxM2Y3MTIxMjA0MzFjMjc2ZTEyZWNhYiIsImlhdCI6MTU0MTQ5MzcyN
CwiZXhwIjoxNTczMDI5NzIzLCJub25jZSI6IjY2MCE2MzQ1RlNlciIsInZjIjp7IkBjb250ZXh0IjpbI
mh0dHBzOi8vdzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL2V4YW1wbGUuY29tL2V4Y
W1wbGVzL3YxIl0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJVbml2ZXJzaXR5RGVncmVlQ
3JlZGVudGlhbCJdLCJjcmVkZW50aWFsU3ViamVjdCI6eyJkZWdyZWUiOnsidHlwZSI6IkJhY2hlbG9yR
GVncmVlIiwibmFtZSI6IkJhY2hlbG9yIG9mIFNjaWVuY2UgaW4gTWVjaGFuaWNhbCBFbmdpbmVlcmluZ
yJ9fX19.Ss6IAqImQ5ldlkIPiZufckRBncminOHS0TDUuU6jRTGzYZzDZH-ZFyJF3Hy-OB5JqfiBgRwh
68tvXu3Aol529lAqRKN8fqfbm909GmBYq4DUdOy0lNzzm-WShr0wpqXkd13sRfRat7X0sv5cwDkt4BjF
GsFOSvwUO6Zti4i1bBI44HHOptdhExSmsDaAWUu8IxOp_KCBCAL89hHMpZCE9D0TUFBuNjb0lAn0VvIU
hRxfoekoFj4w2kVv6YJbB9KTKvS3SlcjSLKYw_vPWTFJBrn5uLxgruj4tynKKQLsBJXzsyZhnQojzrOO
Cs8qg9GcI5BqhX9AodxU-TSYIpSHOu2NrwbBFpaVVVALL1mDnSgD35zc_CuZuH_db7SEruTMyRc8r8Cb
e_E_mWmFHSE_wswC0W9o7U1vIDyocUxOOTFTBOISy48WnA5OS1LzRNeZb1ZPb1EFFnHhj0AQOBtj_trS
k7VQSPI8ueNqnQ-LelEOFEeDRfpNgLK09VVhsN5C14-SuUczP1n-H-lUlGrviA8eSDQSj77MQhChhQ0u
kCz2Ga6ojgNJPKkj6HkSWEZXOZf3tJFEvwkFuWUrYiZVQ1jvZVXlAw0Q-cs7XLE2G33mlf8-DXEbp7QB
680oVZapXCUkYuXYb_L3muVIpFQolzv9pBAv5Vop2-3dOdktKGA
{ "alg": "RS256", "typ": "JWT", "kid": "did:example:ebfeb1f712ebc6f1c276e12ec21#keys-1" }
In the example above, the verifiable presentation uses a
proof
based on JWS
digital signatures, and the
corresponding verification key can be obtained using the kid
header parameter.
{
"iss": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"jti": "urn:uuid:3978344f-8596-4c3a-a978-8fcaba3903c5",
"aud": "did:example:4a57546973436f6f6c4a4a57573",
"iat": 1541493724,
"exp": 1573029723,
"nonce": "343s$FSFDa-",
"vp": {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"type": ["VerifiablePresentation", "CredentialManagerPresentation"],
// base64url-encoded JWT as string
"verifiableCredential": ["..."]
}
}
In the example above, vp
does not contain the id
property because the JWT
encoding uses the jti
attribute to represent a unique identifier. verifiableCredential
contains an string array of verifiable credentials using
JWT
compact serialization.
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImRpZDpleGFtcGxlOmViZmViMWY3MTJlYmM2
ZjFjMjc2ZTEyZWMyMSNrZXlzLTEifQ.eyJpc3MiOiJkaWQ6ZXhhbXBsZTplYmZlYjFmNzEyZWJjNmYxY
zI3NmUxMmVjMjEiLCJqdGkiOiJ1cm46dXVpZDozOTc4MzQ0Zi04NTk2LTRjM2EtYTk3OC04ZmNhYmEzO
TAzYzUiLCJhdWQiOiJkaWQ6ZXhhbXBsZTo0YTU3NTQ2OTczNDM2ZjZmNmM0YTRhNTc1NzMiLCJpYXQiO
jE1NDE0OTM3MjQsImV4cCI6MTU3MzAyOTcyMywibm9uY2UiOiIzNDNzJEZTRkRhLSIsInZwIjp7IkBjb
250ZXh0IjpbImh0dHBzOi8vdzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL2V4YW1wb
GUuY29tL2V4YW1wbGVzL3YxIl0sInR5cGUiOlsiVmVyaWZpYWJsZVByZXNlbnRhdGlvbiJdLCJ2ZXJpZ
mlhYmxlQ3JlZGVudGlhbCI6WyJleUpoYkdjaU9pSlNVekkxTmlJc0luUjVjQ0k2SWtwWFZDSXNJbXRwW
kNJNkltUnBaRHBsZUdGdGNHeGxPbUZpWm1VeE0yWTNNVEl4TWpBME16RmpNamMyWlRFeVpXTmhZaU5yW
lhsekxURWlmUS5leUp6ZFdJaU9pSmthV1E2WlhoaGJYQnNaVHBsWW1abFlqRm1OekV5WldKak5tWXhZe
kkzTm1VeE1tVmpNakVpTENKcWRHa2lPaUpvZEhSd09pOHZaWGhoYlhCc1pTNWxaSFV2WTNKbFpHVnVkR
2xoYkhNdk16Y3pNaUlzSW1semN5STZJbVJwWkRwbGVHRnRjR3hsT21GaVptVXhNMlkzTVRJeE1qQTBNe
kZqTWpjMlpURXlaV05oWWlJc0ltbGhkQ0k2TVRVME1UUTVNemN5TkN3aVpYaHdJam94TlRjek1ESTVOe
kl6TENKdWIyNWpaU0k2SWpZMk1DRTJNelExUmxObGNpSXNJblpqSWpwN0lrQmpiMjUwWlhoMElqcGJJb
WgwZEhCek9pOHZkek11YjNKbkx6SXdNVGd2WTNKbFpHVnVkR2xoYkhNdmRqRWlMQ0pvZEhSd2N6b3ZMM
lY0WVcxd2JHVXVZMjl0TDJWNFlXMXdiR1Z6TDNZeElsMHNJblI1Y0dVaU9sc2lWbVZ5YVdacFlXSnNaV
U55WldSbGJuUnBZV3dpTENKVmJtbDJaWEp6YVhSNVJHVm5jbVZsUTNKbFpHVnVkR2xoYkNKZExDSmpjb
VZrWlc1MGFXRnNVM1ZpYW1WamRDSTZleUprWldkeVpXVWlPbnNpZEhsd1pTSTZJa0poWTJobGJHOXlSR
1ZuY21WbElpd2libUZ0WlNJNklrSmhZMmhsYkc5eUlHOW1JRk5qYVdWdVkyVWdhVzRnVFdWamFHRnVhV
05oYkNCRmJtZHBibVZsY21sdVp5SjlmWDE5LlNzNklBcUltUTVsZGxrSVBpWnVmY2tSQm5jbWluT0hTM
FREVXVVNmpSVEd6WVp6RFpILVpGeUpGM0h5LU9CNUpxZmlCZ1J3aDY4dHZYdTNBb2w1MjlsQXFSS044Z
nFmYm05MDlHbUJZcTREVWRPeTBsTnp6bS1XU2hyMHdwcVhrZDEzc1JmUmF0N1gwc3Y1Y3dEa3Q0QmpGR
3NGT1N2d1VPNlp0aTRpMWJCSTQ0SEhPcHRkaEV4U21zRGFBV1V1OEl4T3BfS0NCQ0FMODloSE1wWkNFO
UQwVFVGQnVOamIwbEFuMFZ2SVVoUnhmb2Vrb0ZqNHcya1Z2NllKYkI5S1RLdlMzU2xjalNMS1l3X3ZQV
1RGSkJybjV1THhncnVqNHR5bktLUUxzQkpYenN5WmhuUW9qenJPT0NzOHFnOUdjSTVCcWhYOUFvZHhVL
VRTWUlwU0hPdTJOcndiQkZwYVZWVkFMTDFtRG5TZ0QzNXpjX0N1WnVIX2RiN1NFcnVUTXlSYzhyOENiZ
V9FX21XbUZIU0Vfd3N3QzBXOW83VTF2SUR5b2NVeE9PVEZUQk9JU3k0OFduQTVPUzFMelJOZVpiMVpQY
jFFRkZuSGhqMEFRT0J0al90clNrN1ZRU1BJOHVlTnFuUS1MZWxFT0ZFZURSZnBOZ0xLMDlWVmhzTjVDM
TQtU3VVY3pQMW4tSC1sVWxHcnZpQThlU0RRU2o3N01RaENoaFEwdWtDejJHYTZvamdOSlBLa2o2SGtTV
0VaWE9aZjN0SkZFdndrRnVXVXJZaVpWUTFqdlpWWGxBdzBRLWNzN1hMRTJHMzNtbGY4LURYRWJwN1FCN
jgwb1ZaYXBYQ1VrWXVYWWJfTDNtdVZJcEZRb2x6djlwQkF2NVZvcDItM2RPZGt0S0dBIl19fQ.kUt2kb
Ktc01b-vjvGmJ7HNcB5u29ImJ8H529puzk8v2ByO1nKcJJ2nTbRrgZFFycSSPYF3O0NTpxTFZ5EnfBR_
kodODbYZwadfpYBYheMIWsOBPgJ8I-RdWnPAdroRE4nIgDCvAKsrowdN1rb1bNwB0LGcR8SnXPEXZNZC
eulsdg8XPk9mw1oL_w-xml_CsN0DxyOdauJ2C1_xbU19-GcIqjBbIgRXlDVh8DkLxgbUIIDg3jShoRSh
Tliaj0wpOsvPb34gobMorsJ2oYzXTrjOis7-qT0V7g0trAWDvSKTdU_pHEKGaOZe1QZkTsIvkdsoLZGj
qyQZD4Tx6ILDUbyaLaeGqkzHdKznILCje7HHugOFmiMRGsnCEpoC8j9pCbgKW4F4Xo0AfG8tYTb-rkDQ
VJCstaBLZncouC5KS8PEwZSevoGdCaoEwWQfNIKUbriMcGn7l2gBLnvO_xaRycmKq6CDSiW0xoHcuCLJ
sBTERaUQZLoVpS2HjvBOM_bS49LiOFMmbzlKqxHZBhK00dSlG5FASAq3aCaRGhuLOpSOadXhrjksdkXa
XFaTEqihLNqbg6HQ8kYLJgm82UTqs4ofKM3E35_Mx_H8hIiwJPfoiNgiJxTTA4dgRkVjtJ1RvNg4NNkD
suVIM8wtqOw0CIzdvrhMgJgfqFjhPJCuM7Vds
This specification utilizes Linked Data to publish information on the Web using standards, such as URLs and JSON-LD, to identify subjects and their associated properties. When information is presented in this manner, other related information can be easily discovered and new information can be easily merged into the existing graph of knowledge. Linked Data is extensible in a decentralized way, greatly reducing barriers to large scale integration. The data model in this specification works well with the Linked Data Proofs, Linked Data Signatures, and the associated Linked Data Cryptographic Suites, which are designed to protect the data model as described by this specification.
Unlike the use of JSON Web Token, no extra pre- or post-processing is necessary. The Linked Data Proofs format was designed to simply and easily protect verifiable credentials and verifiable presentations. Protecting a verifiable credential or verifiable presentation is as simple as passing a valid example in this specification to a Linked Data Signatures implementation and generating a digital signature.
Information on the different qualities of the various syntax formats, e.g., JSON+JWT, JSON-LD+JWT, and JSON-LD+LD-Proofs may be found in the [VC-IMP-GUIDE].
This section is non-normative.
This section details the general privacy considerations and specific privacy implications of deploying the Verifiable Credentials Data Model into production environments.
This section is non-normative.
It is important to recognize there is a spectrum of privacy ranging from pseudonymous to strongly identified. Depending on the use case, people have different comfort levels about what information they are willing to provide and what information can be derived from what is provided.
For example, most people probably want to remain anonymous when purchasing alcohol because the regulatory check required is solely based on whether a person is above a specific age. Alternatively, for medical prescriptions written by a doctor for a patient, the pharmacy fulfilling the prescription is required to more strongly identify the medical professional and the patient. Therefore there is not one approach to privacy that works for all use cases. Privacy solutions are use case specific.
Even for those wanting to remain anonymous when purchasing alcohol, photo identification might still be required to provide appropriate assurance to the merchant. The merchant might not need to know your name or other details (other than that you are over a specific age), but in many cases just proof of age might still be insufficient to meet regulations.
The Verifiable Credentials Data Model strives to support the full privacy spectrum and does not take philosophical positions on the correct level of anonymity for any specific transaction. The following sections provide guidance for implementers who want to avoid specific scenarios that are hostile to privacy.
This section is non-normative.
Data associated with verifiable credentials stored in the
credential.credentialSubject
field is susceptible to privacy
violations when shared with verifiers. Personally identifying data, such
as a government-issued identifier, shipping address, and full name, can be
easily used to determine, track, and correlate an entity. Even
information that does not seem personally identifiable, such as the
combination of a birthdate and a postal code, has very powerful correlation
and de-anonymizing capabilities.
Implementers are strongly advised to warn holders when they share data
with these kinds of characteristics. Issuers are strongly advised to
provide privacy-protecting verifiable credentials when possible. For
example, issuing ageOver
verifiable credentials instead of
date of birth verifiable credentials when a verifier wants to
determine if an entity is over the age of 18.
Because a verifiable credential often contains PII, implementers are strongly advised to use mechanisms while storing and transporting verifiable credentials that protect the data from those who should not access it. Mechanisms that could be considered include TLS or other means of encrypting the data while it is being transported, as well as encryption or data access control mechanisms to protect the data in a verifiable credential while at rest.
This section is non-normative.
Subjects of verifiable credentials are identified using the
credential.credentialSubject.id
field. The identifiers used to
identify a subject create a greater risk of correlation when the
identifiers are long-lived or used across more than one web domain.
Similarly, disclosing the credential identifier
(credential.id
) leads to situations where multiple
verifiers, or an issuer and a verifier, can collude to
correlate the holder. If holders want to reduce correlation, they
should use verifiable credential schemes that allow hiding the
identifier during verifiable presentation. Such schemes expect the
holder to generate the identifier and might even allow hiding the
identifier from the issuer, while still keeping the identifier embedded
and signed in the verifiable credential.
If strong anti-correlation properties are a requirement in a verifiable credentials system, it is strongly advised that identifiers are either:
This section is non-normative.
The contents of verifiable credentials are secured using the
credential.proof
field. The properties in this field
create a greater risk of correlation when the same values are used across more
than one session or domain and the value does not change. Examples include the
verificationMethod
, created
,
proofPurpose
, and jws
fields.
If strong anti-correlation properties are required, it is advised that signature values and metadata are regenerated each time using technologies like third-party pairwise signatures, zero-knowledge proofs, or group signatures.
Even when using anti-correlation signatures, information might still be contained in a verifiable credential that defeats the anti-correlation properties of the cryptography used.
This section is non-normative.
Verifiable credentials might contain long-lived identifiers that could be used to correlate individuals. These types of identifiers include subject identifiers, email addresses, government-issued identifiers, organization-issued identifiers, addresses, healthcare vitals, verifiable credential-specific JSON-LD contexts, and many other sorts of long-lived identifiers.
Organizations providing software to holders should strive to identify fields in verifiable credentials containing information that could be used to correlate individuals and warn holders when this information is shared.
This section is non-normative.
There are mechanisms external to verifiable credentials that are used to track and correlate individuals on the Internet and the Web. Some of these mechanisms include Internet protocol (IP) address tracking, web browser fingerprinting, evercookies, advertising network trackers, mobile network position information, and in-application Global Positioning System (GPS) APIs. Using verifiable credentials cannot prevent the use of these other tracking technologies. Also, when these technologies are used in conjunction with verifiable credentials, new correlatable information could be discovered. For example, a birthday coupled with a GPS position can be used to strongly correlate an individual across multiple websites.
It is recommended that privacy-respecting systems prevent the use of these other tracking technologies when verifiable credentials are being used. In some cases, tracking technologies might need to be disabled on devices that transmit verifiable credentials on behalf of a holder.
This section is non-normative.
To enable recipients of verifiable credentials to use them in a variety of circumstances without revealing more personally identifiable information than necessary for transactions, issuers should consider limiting the information published in a credential to a minimal set needed for the expected purposes. One way to avoid placing personally identifiable information in a credential is to use an abstract property that meets the needs of verifiers without providing specific information about a subject.
For example, this document uses the ageOver
property
instead of a specific birthdate, which constitutes much stronger personally
identifiable information. If retailers in a specific market commonly require
purchasers to be older than a certain age, an issuer trusted in that
market might choose to offer a verifiable credential claiming that
subjects have met that requirement instead of offering
verifiable credentials containing claims about specific
birthdates. This enables individual customers to make purchases without
revealing specific personally identifiable information.
This section is non-normative.
Privacy violations occur when information divulged in one context leaks into another. Accepted best practice for preventing such violations is to limit the information requested, and received, to the absolute minimum necessary. This data minimization approach is required by regulation in multiple jurisdictions, including the Health Insurance Portability and Accountability Act (HIPAA) in the United States and the General Data Protection Regulation (GDPR) in the European Union.
With verifiable credentials, data minimization for issuers means limiting the content of a verifiable credential to the minimum required by potential verifiers for expected use. For verifiers, data minimization means limiting the scope of the information requested or required for accessing services.
For example, a driver's license containing a driver's ID number, height, weight, birthday, and home address is a credential containing more information than is necessary to establish that the person is above a certain age.
It is considered best practice for issuers to atomize information or use
a signature scheme that allows for selective disclosure. For example, an
issuer of driver's licenses could issue a verifiable credential
containing every attribute that appears on a driver's license, as well as a set
of verifiable credentials where every verifiable credential
contains only a single attribute such as a person's birthday. It could also
issue more abstract verifiable credentials (for example, a
verifiable credential containing only an ageOver
attribute).
One possible adaptation would be for issuers to provide secure HTTP
endpoints for retrieving single-use bearer credentials that promote the
pseudonymous usage of verifiable credentials. Implementers that find this
impractical or unsafe, should consider using selective disclosure schemes
that eliminate dependence on issuers at proving time and reduce temporal
correlation risk from issuers.
Verifiers are urged to only request information that is absolutely necessary for a specific transaction to occur. This is important for at least two reasons. It:
While it is possible to practice the Principle of Minimum Disclosure, it might be impossible to avoid the strong identification of an individual for specific use cases during a single session or over multiple sessions. The authors of this document cannot stress how difficult it is to meet this principle in real-world scenarios.
This section is non-normative.
A bearer credential is a privacy-enhancing piece of information, such as a concert ticket, which entitles the holder of the bearer credential to a specific resource without divulging sensitive information about the holder. Bearer credentials are often used in low-risk use cases where the sharing of the bearer credential is not a concern or would not result in large economic or reputational losses.
Verifiable credentials that are bearer credentials are made
possible by not specifying the subject identifier, expressed using the
id
property, which is nested in the
credentialSubject
property. For example, the following
verifiable credential is a bearer credential:
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/temporary/28934792387492384",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "https://example.edu/issuers/14",
"issuanceDate": "2017-10-22T12:23:48Z",
"credentialSubject": {
// note that the 'id' property is not specified for bearer credentials
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
},
"proof": { ... }
}
While bearer credentials can be privacy-enhancing, they must be carefully crafted so as not accidentally divulge more information than the holder of the bearer credential expects. For example, repeated use of the same bearer credential across multiple sites enables these sites to potentially collude to unduly track or correlate the holder. Likewise, information that might seem non-identifying, such as a birthdate and postal code, can be used to statistically identify an individual when used together in the same bearer credential or session.
Issuers of bearer credentials should ensure that the bearer credentials provide privacy-enhancing benefits that:
Holders should be warned by their software if bearer credentials containing sensitive information are issued or requested, or if there is a correlation risk when combining two or more bearer credentials across one or more sessions. While it might be impossible to detect all correlation risks, some might certainly be detectable.
Verifiers should not request bearer credentials that can be used to unduly correlate the holder.
This section is non-normative.
When processing verifiable credentials, verifiers are expected to perform many of the checks listed in Appendix § A. Validation as well as a variety of specific business process checks. Validity checks might include checking:
The process of performing these checks might result in information leakage that leads to a privacy violation of the holder. For example, a simple operation such as checking a revocation list can notify the issuer that a specific business is likely interacting with the holder. This could enable issuers to collude and correlate individuals without their knowledge.
Issuers are urged to not use mechanisms, such as credential revocation lists that are unique per credential, during the verification process that could lead to privacy violations. Organizations providing software to holders should warn when credentials include information that could lead to privacy violations during the verification process. Verifiers should consider rejecting credentials that produce privacy violations or that enable bad privacy practices.
This section is non-normative.
When a holder receives a verifiable credential from an issuer, the verifiable credential needs to be stored somewhere (for example, in a credential repository). Holders are warned that the information in a verifiable credential is sensitive in nature and highly individualized, making it a high value target for data mining. Services that advertise free storage of verifiable credentials might in fact be mining personal data and selling it to organizations wanting to build individualized profiles on people and organizations.
Holders need to be aware of the terms of service for their credential repository, specifically the correlation and data mining protections in place for those who store their verifiable credentials with the service provider.
Some effective mitigations for data mining and profiling include using:
This section is non-normative.
Holding two pieces of information about the same subject almost always reveals more about the subject than just the sum of the two pieces, even when the information is delivered through different channels. The aggregation of verifiable credentials is a privacy risk and all participants in the ecosystem need to be aware of the risks of data aggregation.
For example, if two bearer credentials, one for an email address and then one stating the holder is over the age of 21, are provided across multiple sessions, the verifier of the information now has a unique identifier as well as age-related information for that individual. It is now easy to create and build a profile for the holder such that more and more information is leaked over time. Aggregation of credentials can also be performed across multiple sites in collusion with each other, leading to privacy violations.
From a technological perspective, preventing aggregation of information is a very difficult privacy problem to address. While new cryptographic techniques, such as zero-knowledge proofs, are being proposed as solutions to the problem of aggregation and correlation, the existence of long-lived identifiers and browser tracking techniques defeats even the most modern cryptographic techniques.
The solution to the privacy implications of correlation or aggregation tends not to be technological in nature, but policy driven instead. Therefore, if a holder does not want information about them to be aggregated, they must express this in the verifiable presentations they transmit.
This section is non-normative.
Despite the best efforts to assure privacy, actually using verifiable credentials can potentially lead to de-anonymization and a loss of privacy. This correlation can occur when:
In part, it is possible to mitigate this de-anonymization and loss of privacy by:
It is understood that these mitigation techniques are not always practical or even compatible with necessary usage. Sometimes correlation is a requirement.
For example, in some prescription drug monitoring programs, usage monitoring is a requirement. Enforcement entities need to be able to confirm that individuals are not cheating the system to get multiple prescriptions for controlled substances. This statutory or regulatory need to correlate usage overrides individual privacy concerns.
Verifiable credentials will also be used to intentionally correlate individuals across services, for example, when using a common persona to log in to multiple services, so all activity on each of those services is intentionally linked to the same individual. This is not a privacy issue as long as each of those services uses the correlation in the expected manner.
Privacy risks of credential usage occur when unintended or unexpected correlation arises from the presentation of credentials.
This section is non-normative.
When a holder chooses to share information with a verifier, it might be the case that the verifier is acting in bad faith and requests information that could be used to harm the holder. For example, a verifier might ask for a bank account number, which could then be used with other information to defraud the holder or the bank.
Issuers should strive to tokenize as much information as possible such that if a holder accidentally transmits credentials to the wrong verifier, the situation is not catastrophic.
For example, instead of including a bank account number for the purpose of checking an individual's bank balance, provide a token that enables the verifier to check if the balance is above a certain amount. In this case, the bank could issue a verifiable credential containing a balance checking token to a holder. The holder would then include the verifiable credential in a verifiable presentation and bind the token to a credit checking agency using a digital signature. The verifier could then wrap the verifiable presentation in their digital signature, and hand it back to the issuer to dynamically check the account balance.
Using this approach, even if a holder shares the account balance token with the wrong party, an attacker cannot discover the bank account number, nor the exact value in the account. And given the validity period for the counter-signature, does not gain access to the token for more than a few minutes.
This section is non-normative.
As detailed in Section § 7.13 Usage Patterns, usage patterns can be correlated into certain types of behavior. Part of this correlation is mitigated when a holder uses a verifiable credential without the knowledge of the issuer. Issuers can defeat this protection however, by making their verifiable credentials short lived and renewal automatic.
For example, an ageOver
verifiable credential is useful for
gaining access to a bar. If an issuer issues such a
verifiable credential with a very short expiration date and an automatic
renewal mechanism, then the issuer could possibly correlate the behavior
of the holder in a way that negatively impacts the holder.
Organizations providing software to holders should warn them if they repeatedly use credentials with short lifespans, which could result in behavior correlation. Issuers should avoid issuing credentials in a way that enables them to correlate usage patterns.
This section is non-normative.
An ideal privacy-respecting system would require only the information necessary for interaction with the verifier to be disclosed by the holder. The verifier would then record that the disclosure requirement was met and forget any sensitive information that was disclosed. In many cases, competing priorities, such as regulatory burden, prevent this ideal system from being employed. In other cases, long-lived identifiers prevent single use. The design of any verifiable credentials ecosystem, however, should strive to be as privacy-respecting as possible by preferring single-use verifiable credentials whenever possible.
Using single-use verifiable credentials provides several benefits. The first benefit is to verifiers who can be sure that the data in a verifiable credential is fresh. The second benefit is to holders, who know that if there are no long-lived identifiers in the verifiable credential, the verifiable credential itself cannot be used to track or correlate them online. Finally, there is nothing for attackers to steal, making the entire ecosystem safer to operate within.
This section is non-normative.
In an ideal private browsing scenario, no personally identifiable information will be revealed. Because many credentials include personally identifiable information, organizations providing software to holders should warn them about the possibility of revealing this information if they wish to use credentials and presentations while in private browsing mode. As each browser vendor handles private browsing differently, and some browsers might not have this feature at all, it is important for implementers to be aware of these differences and implement solutions accordingly.
This section is non-normative.
There are a number of security considerations that issuers, holders, and verifiers should be aware of when processing data described by this specification. Ignoring or not understanding the implications of this section can result in security vulnerabilities.
While this section attempts to highlight a broad set of security considerations, it is not a complete list. Implementers are urged to seek the advice of security and cryptography professionals when implementing mission critical systems using the technology outlined in this specification.
This section is non-normative.
Some aspects of the data model described in this specification can be protected through the use of cryptography. It is important for implementers to understand the cryptography suites and libraries used to create and process credentials and presentations. Implementing and auditing cryptography systems generally requires substantial experience. Effective red teaming can also help remove bias from security reviews.
Cryptography suites and libraries have a shelf life and eventually fall to new attacks and technology advances. Production quality systems need to take this into account and ensure mechanisms exist to easily and proactively upgrade expired or broken cryptography suites and libraries, and to invalidate and replace existing credentials. Regular monitoring is important to ensure the long term viability of systems processing credentials.
This section is non-normative.
Verifiable credentials often contain URLs to data that resides outside of the verifiable credential itself. Linked content that exists outside a verifiable credential, such as images, JSON-LD Contexts, and other machine-readable data, are often not protected against tampering because the data resides outside of the protection of the proof on the verifiable credential. For example, the following highlighted links are not content-integrity protected and probably should be:
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "id": "http://example.edu/credentials/58473", "type": ["VerifiableCredential", "AlumniCredential"], "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "image": "https://example.edu/images/58473", "alumniOf": { "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", "name": [{ "value": "Example University", "lang": "en" }, { "value": "Exemple d'Université", "lang": "fr" }] } }, "proof": { ... } }
While this specification does not recommend any specific content integrity protection, document authors who want to ensure links to content are integrity protected are advised to use URL schemes that enforce content integrity. Two such schemes are the [HASHLINK] specification and the [IPFS]. The example below transforms the previous example and adds content integrity protection to the JSON-LD Contexts using the [HASHLINK] specification, and content integrity protection to the image by using an [IPFS] link.
{ "@context": [ "https://www.w3.org/2018/credentials/v1?hl=z3aq31uzgnZBuWNzUB", "https://www.w3.org/2018/credentials/examples/v1?hl=z8guWNzUBnZBu3aq31" ], "id": "http://example.edu/credentials/58473", "type": ["VerifiableCredential", "AlumniCredential"], "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "image": "ipfs:/ipfs/QmXfrS3pHerg44zzK6QKQj6JDk8H6cMtQS7pdXbohwNQfK/image", "alumniOf": { "id": "did:example:c276e12ec21ebfeb1f712ebc6f1", "name": [{ "value": "Example University", "lang": "en" }, { "value": "Exemple d'Université", "lang": "fr" }] } }, "proof": { ... } }
It is debatable whether the JSON-LD Contexts above need protection as it is expected production implementations will ship with static copies of important JSON-LD Contexts.
While the example above is one way to achieve content integrity protection, there are other solutions that might be better suited for certain applications. Implementers are urged to understand how links to external machine-readable content that are not content-integrity protected could result in successful attacks against their applications.
This section is non-normative.
This specification allows credentials to be produced that do not contain signatures or proofs of any kind. These types of credentials are often useful for intermediate storage, or self-asserted information, which is analogous to filling out a form on a web page. Implementers should be aware that these types of credentials are not verifiable because the authorship either is not known or cannot be trusted.
This section is non-normative.
A verifier might need to ensure it is the intended recipient of a verifiable presentation and not the target of a man-in-the-middle attack. Approaches such as token binding [RFC8471], which ties the request for a verifiable presentation to the response, can secure the protocol. Any unsecured protocol is susceptible to man-in-the-middle attacks.
This section is non-normative.
It is considered best practice for issuers to atomize information in a credential, or use a signature scheme that allows for selective disclosure. In the case of atomization, if it is not done securely by the issuer, the holder might bundle together different credentials in a way that was not intended by the issuer.
For example a university might issue two verifiable credentials to a person, each containing two properties, for example, "Staff Member" in the "Department of Computing", and "Post Graduate Student" in the "Department of Economics". If these verifiable credentials are atomized into separate properties, then the university would issue four credentials to the person, each containing one of the following properties, "Staff Member", "Post Graduate Student", "Department of Computing", and "Department of Economics". The holder could then transfer the "Staff Member" and "Department of Economics" verifiable credentials to a verifier, which together would comprise a false claim.
This section is non-normative.
When verifiable credentials are issued for highly dynamic information, implementers should ensure the expiration times are set appropriately. Expiration periods longer than the timeframe where the verifiable credential is valid might create exploitable security vulnerabilities. Expiration periods shorter than the timeframe where the information expressed by the verifiable credential is valid creates a burden on holders and verifiers. It is therefore important to set validity periods for verifiable credentials that are appropriate to the use case and the expected lifetime for the information contained in the verifiable credential.
This section is non-normative.
When verifiable credentials are stored on a device and that device is lost or stolen, it might be possible for an attacker to gain access to systems using the victim's verifiable credentials. Ways to mitigate this type of attack include:
This section is non-normative.
There are a number of accessibility considerations implementers should be aware of when processing data described in this specification. As with implementation of any web standard or protocol, ignoring accessibility issues makes this information unusable to a large subset of the population. It is important to follow accessibility guidelines and standards, such as [WCAG21], to ensure all people, regardless of ability, can make use of this data. This is especially important when establishing systems utilizing cryptography, which have historically created problems for assistive technologies.
This section details the general accessibility considerations to take into account when utilizing this data model.
This section is non-normative.
Many physical credentials in use today, such as government identification cards, have poor accessibility characteristics, including, but not limited to, small print, reliance on small and high-resolution images, and no affordances for people with vision impairments.
When utilizing this data model to create verifiable credentials, it is suggested that data model designers use a data first approach. For example, given the choice of using data or a graphical image to depict a credential, designers should express every element of the image, such as the name of an institution or the professional credential, in a machine-readable way instead of relying on a viewer's interpretation of the image to convey this information. Using a data first approach is preferred because it provides the foundational elements of building different interfaces for people with varying abilities.
This section is non-normative.
There are a number of internationalization considerations implementers are advised to be aware of when publishing data described in this specification. As with any web standards or protocols implementation, ignoring internationalization makes it difficult for data to be produced and consumed across a disparate set of languages and societies, which would limit the applicability of the specification and significantly diminish its value as a standard.
Implementers are strongly advised to read the Strings on the Web: Language and Direction Metadata document [STRING-META] published by the W3C Internationalization Activity as it elaborates upon the need to provide reliable metadata about text in order to support internationalization. Implementers are also urged to read the Implementation Guidance [VC-IMP-GUIDE] for the latest information related to this topic.
This section outlines general internationalization considerations to take into account when utilizing this data model and is intended to highlight specific parts of the Strings on the Web: Language and Direction Metadata document [STRING-META] that implementers might be interested in reading.
This section is non-normative.
Data publishers are strongly encouraged to read the section on Cross-Syntax Expression in the Strings on the Web: Language and Direction Metadata document [STRING-META] in order to ensure that the expression of language and/or base direction information is possible across multiple expression syntaxes such as [JSON-LD], [JSON], and CBOR [RFC7049].
The general design pattern is to use the following markup template when expressing a text string that is tagged with a language and, optionally, a specific base direction:
"property": { "value": "The string value", "lang": "LANGUAGE
" "dir": "DIRECTION
" }
An example utilizing the design pattern above is shown below to express the title of a book in the English language without specifying a text direction:
"title": {
"value": "HTML and CSS: Designing and Creating Websites",
"lang": "en
"
}
The next example uses a similar title expressed in the Arabic language with a base direction of right-to-left:
"title": { "value": "HTML و CSS: تصميم و إنشاء مواقع الويب", "lang": "ar
" "dir": "rtl
" }
The text above would most likley be rendered incorrectly as left to right without the explicit expression of language and direction as many systems will use the first character of a text string to determine text direction.
Implementers utilizing JSON-LD are strongly urged to
extend the JSON-LD Context defining the
internationalized property and utilize the Scoped Context feature of
JSON-LD to alias the @value
, @language
, and
@direction
keywords to value
, lang
,
and dir
, respectively. An example of a JSON-LD Context snippet
doing so is shown below:
"title": {
"@context": {"value": "@value", "lang": "@language", "dir": "@direction"},
"@id": "https://www.w3.org/2018/credentials/examples#title"
}
This section is non-normative.
When multiple languages, base directions, and/or annotations are used in a
single natural language string, more complex mechanisms are typically required.
It is possible to utilize markup languages, such as HTML, to encode
text with multiple language and/or base directions. It is also
possible to use the rdf:HTML
datatype to encode such values
accurately in JSON-LD.
Despite that possibility, implementers are strongly discouraged from encoding
information as HTML because doing so 1) requires some version of an HTML
processor, which increases the burden of processing language and/or base
direction information, and 2) increases the security attack surface when
utilizing this data model as blindly processing HTML could result in executing
a script
tag that an attacker injected at some point during the
data production process.
If implementers feel that they have to use HTML, or other markup languages that are capable of containing executable scripts, to achieve a particular use case, they are advised to analyze how an attacker would use the markup to mount injection attacks against a consumer of the markup and deploy mitigations for the identified attacks.
This section is non-normative.
While this specification does not provide conformance criteria for the process of the validation of verifiable credentials or verifiable presentations, readers may be curious about how the information in this data model is expected to be utilized by verifiers during the process of validation. This section captures a selection of conversations held by the Working Group related to the expected usage of the data fields in this specification by verifiers.
This section is non-normative.
In the verifiable credentials presented by a holder, the
value associated with the id
property for each
credentialSubject
is expected to identify a subject to the
verifier. If the holder is also the subject, then
the verifier could authenticate the holder if they have
public key metadata related to the holder. The verifier could then
authenticate the holder using a signature generated by the holder
contained in the verifiable presentation. The id
property is optional. Verifiers could use other
properties in a verifiable credential to uniquely identify a
subject.
For information on how authentication and WebAuthn might work with verifiable credentials, please refer to the [VC-IMP-GUIDE].
This section is non-normative.
The value associated with the issuer
property is expected
to identify an issuer that is known to and trusted by the
verifier.
Relevant metadata about the issuer
property is expected
to be available to the verifier. For example, an issuer can
publish information containing the public keys it uses to digitally sign
verifiable credentials that it issued. This metadata is relevant
when checking the proofs on the verifiable credentials.
This section is non-normative.
The issuanceDate
is expected to be within an expected range for
the verifier. For example, a verifier can ensure that the
issuance date of a verifiable credential is not in the future.
This section is non-normative.
The cryptographic mechanism used to prove that the information in a verifiable credential or a verifiable presentation has not been tampered with is called a proof. There are many types of cryptographic proofs including, but not limited to, digital signatures, zero-knowledge proofs, Proofs of Work, and Proofs of Stake. In general, when verifying proofs implementations are expected to ensure that:
Some proofs are digital signatures. In general, when verifying digital signatures, implementations are expected to ensure that:
proofPurpose
property,
it is expected to exist and be a valid value, such as
assertionMethod
).
The digital signature provides a number of protections, other than tamper
resistance, that are not immediately obvious. For example, a Linked Data
Signature created
property establishes a date and time
before which the credential should not be considered verified. The
verificationMethod
property specifies, for example, the
public key that can be used to verify the digital signature. Dereferencing a
public key URL reveals information about the controller of the key which can
be checked against the issuer of the credential. The
proofPurpose
property clearly expresses the purpose for
the proof and ensures that this information is protected by the signature. A
proof is typically attached to a verifiable presentation for
authentication purposes and to a verifiable credential as a method
of assertion.
This section is non-normative.
The expirationDate
is expected to be within an expected range
for the verifier. For example, a verifier can ensure that the
expiration date of a verifiable credential is not in the past.
This section is non-normative.
If the credentialStatus
property is available, the status of a
verifiable credential is expected to be evaluated by the
verifier according to the credentialStatus
type
definition for the verifiable credential and the verifier's
own status evaluation criteria. For example, a verifier can ensure that
the status of the verifiable credential is not "withdrawn for cause
by the issuer".
This section is non-normative.
The custom properties in the verifiable credential are appropriate
for the verifier's purpose. For example if a verifier needs to
determine whether a subject is older than 21 years of age, they might
rely on a specific birthdate
property, or more abstract
properties, such as ageOver
.
The issuer is trusted by the verifier to make the claims at hand. For example, a franchised fast food restaurant location trusts discount coupon claims made by the corporate headquarters of the franchise. Policy information expressed by the issuer in the verifiable credential should be respected by holders and verifiers unless they accept the liability of ignoring the policy.
This section is non-normative.
This section describes the possible relationships between a subject and a holder and how the Verifiable Credentials Data Model expresses these relationships. The following diagram illustrates the different types of relationships covered in the rest of this section.
The following sections describe how each of these relationships are handled in the data model.
This section is non-normative.
The most common relationship is when a subject is the holder. In this case, a verifier can easily deduce that a subject is the holder if the verifiable presentation is digitally signed by the holder and all contained verifiable credentials are about a subject that can be identified to be the same as the holder.
If only the credentialSubject
is allowed to insert a
verifiable credential into a verifiable presentation, the
issuer may insert the nonTransferable
property into the
verifiable credential, as described below.
This section is non-normative.
The nonTransferable
property indicates that a
verifiable credential must only be encapsulated into a
verifiable presentation whose proof was issued by the
credentialSubject
. A verifiable presentation that contains
a verifiable credential containing the nonTransferable
property, whose proof creator is not the credentialSubject
,
is invalid.
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "id": "http://example.edu/credentials/3732", "type": ["VerifiableCredential", "ProofOfAgeCredential"], "issuer": "https://example.edu/issuers/14", "issuanceDate": "2010-01-01T19:23:24Z", "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "ageOver": 21 }, "nonTransferable": "True", "proof": { .. "verificationMethod": "did:example:ebfeb1f712ebc6f1c276e12ec21", ... } }
This section is non-normative.
In this case, the credentialSubject
property might contain
multiple properties, each providing an aspect of a description of the
subject, which combine together to unambiguously identify the subject.
Some use cases might not require the holder to be identified at all,
such as checking to see if a doctor (the subject) is board-certified.
Other use cases might require the verifier to use out-of-band knowledge
to determine the relationship between the subject and the holder.
{ "@context": ["https://www.w3.org/2018/credentials/v1", "https://schema.org/"] "id": "http://example.edu/credentials/332", "type": ["VerifiableCredential", "IdentityCredential"], "issuer": "https://example.edu/issuers/4", "issuanceDate": "2017-02-24T19:73:24Z", "credentialSubject": { "name": "J. Doe", "address": { "streetAddress": "10 Rue de Chose", "postalCode": "98052", "addressLocality": "Paris", "addressCountry": "FR" }, "birthDate": "1989-03-15" ... }, "proof": { ... } }
The example above uniquely identifies the subject using the name, address, and birthdate of the individual.
This section is non-normative.
Usually verifiable credentials are presented to verifiers by the subject. However in some cases, the subject might need to pass the whole or part of a verifiable credential to another holder. For example, if a patient (the subject) is too ill to take a prescription (the verifiable credential) to the pharmacist (the verifier), a friend might take the prescription in to pick up the medication.
The data model allows for this, by the subject issuing a new verifiable credential and giving it to the new holder, who can then present both verifiable credentials to the verifier. However, the content of this second verifiable credential is likely to be application specific, so this specification cannot standardize the contents of this second verifiable credential. Nevertheless, a non-normative example is provided in Appendix § B.5 Subject Passes a Verifiable Credential to Someone Else.
This section is non-normative.
The Verifiable Credentials Data Model supports the holder acting on behalf of the subject in at least the following ways. The:
credentialSubject
property.
The mechanisms listed above describe the relationship between the holder and the subject and helps the verifier decide whether the relationship is sufficiently expressed for a given use case.
The additional mechanisms the issuer or the verifier uses to verify the relationship between the subject and the holder are outside the scope of this specification.
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "id": "http://example.edu/credentials/3732", "type": ["VerifiableCredential", "AgeCredential", "RelationshipCredential"], "issuer": "https://example.edu/issuers/14", "issuanceDate": "2010-01-01T19:23:24Z", "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "ageUnder": 16, "parent": { "id": "did:example:ebfeb1c276e12ec211f712ebc6f", "type": "Mother" } }, "proof": { ... } // the proof is generated by the DMV }
In the example above, the issuer expresses the relationship between the child and the parent such that a verifier would most likely accept the credential if it is provided by the child or the parent.
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "id": "http://example.edu/credentials/3732", "type": ["VerifiableCredential", "RelationshipCredential"], "issuer": "https://example.edu/issuers/14", "issuanceDate": "2010-01-01T19:23:24Z", "credentialSubject": { "id": "did:example:ebfeb1c276e12ec211f712ebc6f", "child": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "type": "Child" } }, "proof": { ... } // the proof is generated by the DMV }
In the example above, the issuer expresses the relationship between the child and the parent in a separate credential such that a verifier would most likely accept any of the child's credentials if they are provided by the child or if the credential above is provided with any of the child's credentials.
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "id": "http://example.org/credentials/23894", "type": ["VerifiableCredential", "RelationshipCredential"], "issuer": "http://example.org/credentials/23894", "issuanceDate": "2010-01-01T19:23:24Z", "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "parent": { "id": "did:example:ebfeb1c276e12ec211f712ebc6f", "type": "Mother" } }, "proof": { ... } // the proof is generated by the child }
In the example above, the child expresses the relationship between the child and the parent in a separate credential such that a verifier would most likely accept any of the child's credentials if the credential above is provided.
Similarly, the strategies described in the examples above can be used for many other types of use cases, including power of attorney, pet ownership, and patient prescription pickup.
This section is non-normative.
When a subject passes a verifiable credential to another holder, the subject might issue a new verifiable credential to the holder in which the:
The holder can now create a verifiable presentation containing these two verifiable credentials so that the verifier can verify that the subject gave the original verifiable credential to the holder.
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "id": "did:example:76e12ec21ebhyu1f712ebc6f1z2", "type": ["VerifiablePresentation", "CredentialManagerPresentation"], "credential": [ { "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "id": "http://example.gov/credentials/3732", "type": ["VerifiableCredential", "PrescriptionCredential"], "issuer": "https://example.edu", "issuanceDate": "2010-01-01T19:73:24Z", "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "prescription": {....} }, "revocation": { "id": "http://example.gov/revocations/738", "type": "SimpleRevocationList2017" }, "proof": {....} }, { "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "id": "https://example.com/VC/123456789", "type": ["VerifiableCredential", "PrescriptionCredential"], "issuer": "did:example:ebfeb1f712ebc6f1c276e12ec21", "issuanceDate": "2010-01-03T19:73:24Z", "credentialSubject": { "id": "did:example:76e12ec21ebhyu1f712ebc6f1z2", "prescription": {....} }, "proof": { "type": "RsaSignature2018", "created": "2018-06-17T10:03:48Z", "proofPurpose": "assertionMethod", "jws": "pYw8XNi1..Cky6Ed=", "verificationMethod": "did:example:ebfeb1f712ebc6f1c276e12ec21/keys/234" } } ], "proof": [{ "type": "RsaSignature2018", "created": "2018-06-18T21:19:10Z", "proofPurpose": "authentication", "verificationMethod": "did:example:76e12ec21ebhyu1f712ebc6f1z2/keys/2", "challenge": "c0ae1c8e-c7e7-469f-b252-86e6a0e7387e", "jws": "BavEll0/I1..W3JT24=" }] }
In the above example, a patient (the original subject) passed a prescription (the original verifiable credential) to a friend, and issued a new verifiable credential to the friend, in which the friend is the subject, the original subject is the issuer, and the credential is a copy of the original prescription.
This section is non-normative.
When an issuer wants to authorize a holder to possess a credential that describes a subject who is not the holder, and the holder has no known relationship with the subject, then the issuer inserts the relationship of the holder to itself into the credential for the subject.
Verifiable credentials are not an authorization framework and therefore delegation is out of scope for this specification. However, it is understood that verifiable credentials are likely to be used to build authorization and delegation systems. The following is one approach that may be appropriate for some use cases.
When an issuer wants to authorise a holder to possess a credential that describes a subject who is not the holder, and the holder has no known relationship with the subject, then the issuer might insert the relationship of the holder to itself into the subject's credential.
{ "@context": [ "https://www.w3.org/2018/credentials/v1", "https://www.w3.org/2018/credentials/examples/v1" ], "id": "http://example.edu/credentials/3732", "type": ["VerifiableCredential", "NameAndAddress"], "issuer": "https://example.edu/issuers/14", "holder": { "type": "LawEnforcement", "id": "did:example:ebfeb1276e12ec21f712ebc6f1c" }, "issuanceDate": "2010-01-01T19:73:24Z", "credentialSubject": { "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", "name": "Mr John Doe", "address": "10 Some Street, Anytown, ThisLocal, Country X" }, "proof": { "type": "RsaSignature2018", "created": "2018-06-17T10:03:48Z", "proofPurpose": "assertionMethod", "verificationMethod": "https://example.edu/issuers/14/keys/234", "jws": "pY9...Cky6Ed = " } }
This section is non-normative.
The Verifiable Credentials Data Model currently does not support either of these scenarios. It is for further study how they might be supported.
This section is non-normative.
This section will be submitted to the Internet Engineering Steering Group (IESG) for review, approval, and registration with IANA in the "JSON Web Token Claims Registry".