Copyright © 2023 World Wide Web Consortium. W3C® liability, trademark and permissive document license rules apply.
This specification defines how to secure Verifiable Credentials with JSON Web Tokens (JWT) [RFC7519], which build on JSON Web Signatures (JWS) [RFC7515]. This enables Verifiable Credentials to be easily integrated into ecosystems that already support JSON Web Tokens.
This section describes the status of this document at the time of its publication. 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/.
This document was published by the Verifiable Credentials Working Group as a Working Draft using the Recommendation track.
Publication as a Working Draft does not imply endorsement by W3C and its Members.
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 2 November 2021 W3C Process Document.
JSON Web Token (JWT) [RFC7519] is a widely-used means of expressing 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 ecosystem overview. A JWT encodes a set of claims as a JSON object that is contained in a JSON Web Signature (JWS) [RFC7515] and/or JSON Web Encryption (JWE) [RFC7516]. For this specification, the use of JWE is out of scope.
This specification describes how to secure media types expressing Verifiable Credentials and Verifiable Presentations as described in the [VC-DATA-MODEL], using JWTs [RFC7519].
The application/vc+jwt
media type described in this specification defines
an example of a unidirectional mapping to a base media type defined in
the [VC-DATA-MODEL]; see Appendix A.4.1.
This section provides guidance on how to use JSON [RFC7159] claimsets with JWT registered claims to construct a JWT that can be mapped to a verifiable credential. This section also describes how to use content types and token types to distinguish different representations of verifiable credentials.
This representation relies on claims registered in the IANA JSON Web Token Claims Registry whenever possible.
Production of this representation does not use vc+ld+json
as an input.
typ MUST use the media type vc+jwt
.
The vc
and vp
claims MUST NOT be present when the content type header parameter is set to credential-claims-set+json
.
The use of Verifiable Credentials often involves the representation and exchange of structured data in the form of JSON-LD. While JSON-LD provides a flexible and extensible format for describing data, it is important to note that it also provides a linkage between the data structure and semantic meaning of data.
This section outlines how JSON-LD encoded claimset can be secured using either JOSE or COSE.
A benefit to this approach is that payloads can be made to conform directly to the [VC-DATA-MODEL] without any mapping or transformation.
This section details how to secure data payloads with the type application/vc+ld+json
with JOSE.
[rfc7515] MAY be used to secure this media type.
When using this approach, the typ
MUST be vc+ld+jwt
When using this approach, the cty
MUST be vc+ld+json
See Common JOSE Header Parameters
for additional details regarding usage of typ
and cty
.
This section details how to secure verifiable presentations with the type
application/vp+ld+json
with JOSE.
[rfc7515] MAY be used to secure this media type.
When using this approach, the typ
MUST be vp+ld+jwt
When using this approach, the cty
MUST be vp+ld+json
See Common JOSE Header Parameters
for additional details regarding usage of typ
and cty
.
COSE [rfc8152] is a common approach to encoding and securing information using CBOR [rfc8949]. Verifiable credentials MAY be secured using COSE [rfc8152] and MUST be identified through use of content types as outlined in this section.
This section details how to secure data with the type application/vc+ld+json
with COSE.
[rfc8152] MAY be used to secure this media type.
When using this approach, the type (TBD)
MUST be vc+ld+cwt
When using this approach, the content type (3)
MUST be application/vc+ld+json
See Common COSE Header Parameters for additional details.
See Concise Binary Object Representation (CBOR) Tags for additional details.
There is no registered tag for typ
in COSE.
This prevents following the guidance from the JWT BCP
The [VC-DATA-MODEL] version 1.1 introduced 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 Claims Set as follows:
vc
: JSON object, which MUST be present in a VC-JWT conforming to the version 1.1 specification.
verifiable credential. The object contains the
credential according to this specification.
vp
: JSON object, which MUST be present in a VP-JWT conforming to the version 1.1 specification.
verifiable presentation. The object contains the
presentation according to this specification.
To encode a verifiable credential as a JWT, specific properties MUST be either:
If no explicit rule is specified, properties are encoded in
the same way as with a standard credential, and the encoded properties are then added to
the vc
claim 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 refers either to the
issuer of the verifiable credential, or in the case of
a verifiable presentation, to the holder of the
verifiable credential. The JWS proves that the
iss
of the JWT signed the contained JWT Claims Set 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 set for digital signatures. If only the
proof
property is needed for the chosen
signature method (that is, if there is no choice of algorithm
within that method), 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.
For backward compatibility with JWT processors, the following registered JWT claim names MUST be used, instead of or in addition to, their respective standard verifiable credential counterparts:
exp
MUST represent the expirationDate
property, encoded as a UNIX timestamp
(NumericDate
).
iss
MUST represent the issuer
property of a verifiable credential or the
holder
property of a verifiable presentation.
nbf
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 credentialSubject
.
In bearer credentials
and
presentations
, sub
will not be
present.
aud
MUST represent (i.e., identify) the intended
audience of the verifiable presentation (i.e., the
verifier intended by the presenting holder to
receive and verify the verifiable presentation).
Other JOSE header parameters and JWT claim names not specified
herein can be used if their use is not explicitly discouraged.
Additional
verifiable credential claims MUST be added to the
credentialSubject
property of the JWT.
For more information about using JOSE header parameters and/or JWT claim names not specified herein, see the Verifiable Credentials Implementation Guidelines [VC-IMP-GUIDE] document.
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
JWT claim.
At the time of this writing, JWTs do not have a representation for multiple subjects and are thus not capable of encoding a verifiable credential with more than one subjects. The Working Group may decide to create a new JWT claim for this purpose, and, if so, may register it in the JSON Web Token Claims Registry.
To decode a JWT to a standard credential or presentation, the following transformation MUST be performed:
vc
or vp
claim 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 [XMLSCHEMA11-2] 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
credential JSON object or the holder
property of the new presentation JSON object.
nbf
is present, the UNIX timestamp MUST be
converted to an [XMLSCHEMA11-2] 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 credential
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", "kid": "did:example:abfe13f712120431c276e12ecab#keys-1" }
In the example above, the verifiable credential uses a
proof
based on JWS
digital signatures, and
the corresponding verificatio 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", "nbf": 1541493724, "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
. The nonce
has been
added to stop a replay attack.
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImRpZDpleGFtcGxlOmFiZmUxM2Y3MTIxMjA0
MzFjMjc2ZTEyZWNhYiNrZXlzLTEif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ebc6f1c276e12ec21#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", "nbf": 1541493724, "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"], // 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 a string array of
verifiable credentials using JWT
compact
serialization. The nonce
has been added to stop a
replay attack.
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImRpZDpleGFtcGxlOjB4YWJjI2tleTEifQ.e
yJpc3MiOiJkaWQ6ZXhhbXBsZTplYmZlYjFmNzEyZWJjNmYxYzI3NmUxMmVjMjEiLCJqdGkiOiJ1cm46d
XVpZDozOTc4MzQ0Zi04NTk2LTRjM2EtYTk3OC04ZmNhYmEzOTAzYzUiLCJhdWQiOiJkaWQ6ZXhhbXBsZ
To0YTU3NTQ2OTczNDM2ZjZmNmM0YTRhNTc1NzMiLCJuYmYiOjE1NDE0OTM3MjQsImlhdCI6MTU0MTQ5M
zcyNCwiZXhwIjoxNTczMDI5NzIzLCJub25jZSI6IjM0M3MkRlNGRGEtIiwidnAiOnsiQGNvbnRleHQiO
lsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL3d3dy53My5vc
mcvMjAxOC9jcmVkZW50aWFscy9leGFtcGxlcy92MSJdLCJ0eXBlIjpbIlZlcmlmaWFibGVQcmVzZW50Y
XRpb24iLCJDcmVkZW50aWFsTWFuYWdlclByZXNlbnRhdGlvbiJdLCJ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JRzUxYmNPcGNtbHhkV1Z6U
EM5emNHRnVQaUo5ZlgxOS5LTEpvNUdBeUJORDNMRFRuOUg3RlFva0VzVUVpOGpLd1hoR3ZvTjNKdFJhN
TF4ck5EZ1hEYjBjcTFVVFlCLXJLNEZ0OVlWbVIxTklfWk9GOG9HY183d0FwOFBIYkYySGFXb2RRSW9PQ
nh4VC00V05xQXhmdDdFVDZsa0gtNFM2VXgzclNHQW1jek1vaEVFZjhlQ2VOLWpDOFdla2RQbDZ6S1pRa
jBZUEIxcng2WDAteGxGQnM3Y2w2V3Q4cmZCUF90WjlZZ1ZXclFtVVd5cFNpb2MwTVV5aXBobXlFYkxaY
WdUeVBsVXlmbEdsRWRxclpBdjZlU2U2UnR4Snk2TTEtbEQ3YTVIVHphbllUV0JQQVVIRFpHeUdLWGRKd
y1XX3gwSVdDaEJ6STh0M2twRzI1M2ZnNlYzdFBnSGVLWEU5NGZ6X1FwWWZnLS03a0xzeUJBZlFHYmciX
X19.ft_Eq4IniBrr7gtzRfrYj8Vy1aPXuFZU-6_ai0wvaKcsrzI4JkQEKTvbJwdvIeuGuTqy7ipO-EYi
7V4TvonPuTRdpB7ZHOlYlbZ4wA9WJ6mSVSqDACvYRiFvrOFmie8rgm6GacWatgO4m4NqiFKFko3r58Lu
eFfGw47NK9RcfOkVQeHCq4btaDqksDKeoTrNysF4YS89INa-prWomrLRAhnwLOo1Etp3E4ESAxg73CR2
kA5AoMbf5KtFueWnMcSbQkMRdWcGC1VssC0tB0JffVjq7ZV6OTyV4kl1-UVgiPLXUTpupFfLRhf9QpqM
BjYgP62KvhIvW8BbkGUelYMetA
This section describes how to produce a VC-JWT encoded
VerifiableCredential
from an object of media type application/vc+ld+json
.
There are currently 2 competing solutions to this problem described below. It is a goal of the v2 work to resolve them and reduce production rules to a single, simple, set of instructions that any implementer can easily meet if they possess a software library supporting [RFC7515] or [RFC7519].
There are several members (claims) of the
application/vc+ld+json
which will need to be translated to their JOSE
form, and included next to the vc
or
vp
member in the JWT Claims Set.
We refer to the JWT Claims Set as payload
in this section.
If a member is not present in the application/vc+ld+json
, it MUST NOT
be present in the VerifiableCredential
as either a claim
in the payload or a claim in the vc
attribute of the
payload.
We start with payload objects and an empty header, and we add members
to the header and the payload based on the content in the
application/vc+ld+json
.
This member MUST be present in the
payload.vc.issuer
attribute as either a string or an
object
with and id
.
This member MUST be present payload.iss
.
In the case that payload.vc.issuer
is an object,
payload.iss
MUST be payload.vc.issuer.id
.
In the case that
payload.vc.issuer
is a string,
payload.iss
must be
payload.vc.issuer
This member MUST be present in the
payload.vc.issuanceDate
attribute as an XMLDateTime
String.
This member MUST be present payload.nbf
as a unix
timestamp.
In the case that the issuanceDate
includes leap
seconds, it is not possible to detect them when the date time is
represented in nbf
This section needs to be defined.
The header and payload converted into a JWT, in accorance with the RFC: RFC7519 Section 7.1
The following steps are one way to obtain this representation:
application/vc+ld+json
that were mapped in the previous steps.
vc
member of the claim set.
The object value for the vc
property,
when Instead of... production rules have been applied,
is not of media type application/vc+ld+json
.
This section describes how to produce a VP-JWT encoded
VerifiablePresentation
from an object of media type application/presentation+ld+json
.
There are several members (claims) of the
application/presentation+ld+json
which will need to be translated to their JOSE
form, and included next to the vp
member in the JWT Claims Set.
We refer to the JWT Claims Set as payload
in this section.
If a member is not present in the application/presentation+ld+json
it MUST NOT
be present in the VerifiablePresentation
as either a claim
in the payload or a claim in the vp
attribute of the
payload.
We start with an empty header, and payload objects, and we add members
to the header and the payload based on the content in the
application/presentation+ld+json
.
This member MAY be present in the
payload.vp.holder
attribute as either a string or an
object
with an id
.
This member MAY be present payload.iss
.
If payload.vp.holder
is an object,
payload.iss
MUST be payload.vp.holder.id
.
If
payload.vp.holder
is a string,
payload.iss
must be
payload.vp.holder
If
payload.vp.id
is a string,
payload.jti
must be
payload.vp.id
payload.nonce
MUST be present.
payload.vp.verifiableCredential
contains a string array of verifiable credentials using JWT compact serialization.
The header and payload converted into a JWT, in accorance with the RFC: RFC7519 Section 7.1
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, and MUST 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.
Verifiable Credentials often contain sensitive information that needs to be protected to ensure the privacy and security of organizations and individuals. This section outlines some privacy considerations relevant to implementers and users.
Implementers are advised to note and abide by all privacy considerations called out in the [VC-DATA-MODEL].
Implementers are additionally advised to reference the Privacy Consideration section of the JWT specification for privacy guidance.
In addition to the privacy recommendations in the [VC-DATA-MODEL], the following considerations are given:
Minimization of data: It is considered best practice for Verifiable Credentials to only contain the minimum amount of data necessary to achieve their intended purpose. This helps to limit the amount of sensitive information that is shared or stored unnecessarily.
Informed consent: It is considered best practice that individuals be fully informed about how their data will be used and provide the ability to consent to or decline the use of their data. This helps to ensure that individuals maintain control over their own personal information.
Data protection: It is considered best practice to protect Verifiable Credentials using strong encryption and other security measures to prevent unauthorized access, modification, or disclosure.
These considerations are not exhaustive, and implementers and users are advised to consult additional privacy resources and best practices to ensure the privacy and security of Verifiable Credentials implemented using VC-JWT.
This section outlines security considerations for implementers and users of this specification. It is important to carefully consider these factors to ensure the security and integrity of Verifiable Credentials when implemented using JWTs.
When implementing VC-JWTs, it is essential to address all security issues relevant to broad cryptographic applications. This especially includes protecting the user's asymmetric private and symmetric secret keys, as well as employing countermeasures against various attacks. Failure to adequately address these issues could compromise the security and integrity of Verifiable Credentials, potentially leading to unauthorized access, modification, or disclosure of sensitive information.
Implementers are advised to follow best practices and established cryptographic standards to ensure the secure handling of keys and other sensitive data. Additionally, conduct regular security assessments and audits to identify and address any vulnerabilities or threats.
Follow all security considerations outlined in [rfc7515] and [rfc7519].
When utilizing JSON-LD, take special care around remote retrieval of contexts and follow the additional security considerations noted in [json-ld11].
As noted in [rfc7515] when utilizing JSON [rfc7159], strict validation is a security requirement. If malformed JSON is received, it may be impossible to reliably interpret the producer's intent, potentially leading to ambiguous or exploitable situations. To prevent these risks, it is essential to use a JSON parser that strictly validates the syntax of all input data. It is essential that any JSON inputs that do not conform to the JSON-text syntax defined in [rfc7159] be rejected in their entirety by JSON parsers. Failure to reject invalid input could compromise the security and integrity of Verifiable Credentials.
This section is non-normative.
This specification registers the application/vc+jwt
Media Type specifically for
identifying a JWT conforming to the Verifiable Credentials JWT format in the typ
header.
Type name: | application |
Subtype name: | application/vc+jwt |
Required parameters: | None |
Encoding considerations: |
application/vc+jwt values are encoded
as a series of base64url encoded values (some of which may be the
empty string) each separated from the next by a single period
('.') character.
|
Security considerations: |
As defined in this specification. See also the security considerations in [RFC7519]. |
Contact: | W3C Verifiable Credentials Working Group public-vc-wg@w3.org |
This specification registers the application/vc+ld+jwt
Media Type specifically for
identifying a JWT conforming to the Verifiable Credentials JWT format in the typ
header.
Type name: | application |
Subtype name: | vc+ld+jwt |
Required parameters: | None |
Encoding considerations: |
application/vc+ld+jwt values are encoded
as a series of base64url encoded values (some of which may be the
empty string) each separated from the next by a single period
('.') character.
|
Security considerations: |
As defined in this specification. See also the security considerations in [RFC7519]. |
Contact: | W3C Verifiable Credentials Working Group public-vc-wg@w3.org |
This specification registers the application/credential-claims-set-1.1+json
MIME Media Type specifically for
identifying a JWT Claims Set conforming to the Verifiable Credentials 1.1 JWT format in the cty
header.
Type name: | application |
Subtype name: | application/credential-claims-set-1.1+json |
Required parameters: | None |
Encoding considerations: |
Resources that use the "application/credential-claims-set-1.1+json "
Media Type are required to conform to all of the requirements
for the "application/json " Media Type and are
therefore subject to the same encoding considerations specified
in Section 11 of [RFC7159].
|
Security considerations: |
As defined in this specification. See also the security considerations in [RFC7519]. |
Contact: | W3C Verifiable Credentials Working Group public-vc-wg@w3.org |
The following describes a mapping from application/vc+jwt
to
application/vc+ld+json
. This is one possible unidirectional mapping
between 2.0 VC-JWTs and the VC Data Model; other such mappings are possible.
iss
, sub
, iat
, nbf
,
exp
, jti
, and aud
as registered claims.
@context
to
"https://www.w3.org/ns/credentials/v2"
.
type
to ["VerifiableCredential"]
.
issuer
property to one of the following:
iss
is a URL, use the value of iss
.
iss
is not a URL, use the concatenation of "urn:vc:
"
and the value of iss
.
jti
is present, set the value of id
to the
concatenation of "urn:vc:
" and the value of jti
.
nbf
is present, set the value of validFrom
to the
dateTime
obtained by converting the value of nbf
from
the NumericDate
described in [RFC7519] to a dateTime
as
described in [XMLSCHEMA11-2].
exp
is present, set the value of validUntil
to the
dateTime
obtained by converting the value of exp
from
the NumericDate
described in [RFC7519] to a dateTime
as
described in [XMLSCHEMA11-2].
credentialSubject
to an object that contains
the following properties:
sub
is present, set the value of the id
property to
the concatenation of "urn:vc:" and the value of sub
.