<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" ipr="trust200902" docName="draft-ietf-oauth-sd-jwt-vc-00" submissionType="IETF" category="std" xml:lang="en" consensus="true">

<front>
<title abbrev="SD-JWT VC">SD-JWT-based Verifiable Credentials (SD-JWT VC)</title><seriesInfo value="draft-ietf-oauth-sd-jwt-vc-00" stream="IETF" status="standard" name="Internet-Draft"/>
<author initials="O." surname="Terbu" fullname="Oliver Terbu"><organization>Spruce Systems, Inc.</organization><address><postal><street/>
</postal><email>oliver.terbu@spruceid.com</email>
</address></author>
<author initials="D." surname="Fett" fullname="Daniel Fett"><organization>Authlete Inc. </organization><address><postal><street/>
</postal><email>mail@danielfett.de</email>
</address></author>
<date/>
<area>Security</area>
<workgroup>Web Authorization Protocol</workgroup>
<keyword>security</keyword>
<keyword>oauth2</keyword>
<keyword>sd-jwt</keyword>

<abstract>
<t>This specification describes data formats as well as validation and processing
rules to express Verifiable Credentials with JSON payloads based on the Selective Disclosure
for JWTs (SD-JWT) <xref target="I-D.ietf-oauth-selective-disclosure-jwt"/> format.
It can be used without any selective disclosable claims, too.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>

<section anchor="issuer-holder-verifier-model"><name>Issuer-Holder-Verifier Model</name>
<t>In the so-called Issuer-Holder-Verifier Model, Issuers issue Verifiable Credentials to a
Holder, who can then present the Verifiable Credentials to Verifiers. Verifiable
Credentials are cryptographically signed statements about a Subject, typically the Holder.</t>
<figure><name>Issuer-Holder-Verifier Model with optional Status Provider
</name>
<sourcecode type="ascii-art">         +------------+
         |            |
         |   Issuer   |
         |            |
         +------------+
               |
    Issues Verifiable Credential
               |
               v
         +------------+
         |            |
         |   Holder   |
         |            |
         +------------+
               |
  Presents Verifiable Credential
               |
               v
         +-------------+
         |             |+                          +------------+
         |  Verifiers  ||+                         |   Status   |
         |             |||----- optionally -------&gt;|  Provider  |
         +-------------+||   retrieve status of    |            |
          +-------------+|  Verifiable Credential  +------------+
           +-------------+
</sourcecode>
</figure>
<t>Verifiers can check the authenticity of the data in the Verifiable Credentials
and optionally enforce Key Binding, i.e., ask the Holder to prove that they
are the intended holder of the Verifiable Credential, for example, by proving possession of a
cryptographic key referenced in the credential. This process is further
described in <xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>.</t>
<t>To support revocation of Verifiable Credentials, revocation information can
optionally be retrieved from a Status Provider. The role of a Status Provider
can be fulfilled by either a fourth party or by the Issuer.</t>
<t>This specification defines Verifiable Credentials based on the SD-JWT
format with a JWT Claim Set. It can be used when there are no selective disclosable claims, too.</t>
</section>

<section anchor="rationale"><name>Rationale</name>
<t>JSON Web Tokens (JWTs) <xref target="RFC7519"/> can in principle be used to express
Verifiable Credentials in a way that is easy to understand and process as it
builds upon established web primitives.</t>
<t>Selective Disclosure JWT (SD-JWT) <xref target="I-D.ietf-oauth-selective-disclosure-jwt"/> is
a specification that introduces conventions to support selective disclosure for
JWTs: For an SD-JWT document, a Holder can decide which claims to release (within
bounds defined by the Issuer).</t>
<t>SD-JWT is a superset of JWT as it can also be used when there are no selectively
disclosable claims and also supports JWS JSON serialization, which is useful for
long term archiving and multi signatures. However, SD-JWT itself does not define
the claims that must be used within the payload or their semantics.</t>
<t>This specification therefore uses SD-JWT and the well-established JWT content rules and
extensibility model as basis for representing Verifiable Credentials with JSON payload.
Those Verifiable Credentials are called SD-JWT VCs.</t>
<t>SD-JWTs VC can contain claims that are registered in "JSON Web Token Claims"
registry as defined in <xref target="RFC7519"/>, as well as public and
private claims.</t>
<t>Note: This specification does not utilize the W3C's Verifiable Credentials Data Model v1.0, v1.1, or v2.0.</t>
</section>

<section anchor="requirements-notation-and-conventions"><name>Requirements Notation and Conventions</name>
<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
"SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 <xref target="RFC2119"/>.</t>
</section>

<section anchor="terms-and-definitions"><name>Terms and Definitions</name>
<t>This specification uses the terms "Holder", "Issuer", "Verifier", "Key Binding JWT" defined by
<xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>.</t>

<dl>
<dt>Verifiable Credential (VC):</dt>
<dd>An Issuer-signed assertion with claims about a Subject.</dd>
<dt>SD-JWT-based Verifiable Credential (SD-JWT VC):</dt>
<dd>A Verifiable Credential encoded using the format defined in
<xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>. It may or may not contain
selectively disclosable claims.</dd>
<dt>Unsecured Payload of an SD-JWT VC:</dt>
<dd>A JSON object containing all selectively disclosable and non-selectively disclosable claims
of the SD-JWT VC. The Unsecured Payload acts as the input JSON object to issue
an SD-JWT VC complying to this specification.</dd>
<dt>Status Provider:</dt>
<dd>An entity that provides status information (e.g. revocation) about a Verifiable Credential.</dd>
</dl>
</section>
</section>

<section anchor="scope"><name>Scope</name>

<ul>
<li><t>This specification defines</t>

<ul>
<li>Data model and media types for Verifiable Credentials based on SD-JWTs.</li>
<li>Validation and processing rules for Verifiers and Holders.</li>
</ul></li>
</ul>
</section>

<section anchor="use-cases"><name>Use Cases</name>
<t>TBD: explain use cases of the Issuer-Holder-Verifier Model.</t>
<t>TBD: conventional crypt, hardware security, hsm, mobile secure area,
compliance with FIPS</t>
</section>

<section anchor="verifiable-credentials-based-on-sd-jwt"><name>Verifiable Credentials based on SD-JWT</name>
<t>This section defines encoding, validation and processing rules for SD-JWT VCs.</t>

<section anchor="media-type"><name>Media Type</name>
<t>SD-JWT VCs compliant with this specification MUST use the media type
<tt>application/vc+sd-jwt</tt> as defined in <xref target="application-vc-sd-jwt"/>.</t>
</section>

<section anchor="data-format"><name>Data Format</name>
<t>SD-JWT VCs MUST be encoded using the SD-JWT format defined in Section 5 of
<xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>. A presentation of an SD-JWT VC MAY
contain a Key Binding JWT.</t>
<t>Note that in some cases, an SD-JWT VC MAY have no selectively disclosable
claims, and therefore the encoded SD-JWT will not contain any Disclosures.</t>

<section anchor="header-parameters"><name>Header Parameters</name>
<t>This section defines JWT header parameters for the SD-JWT component of the
SD-JWT VC.</t>
<t>The <tt>typ</tt> header parameter of the SD-JWT MUST be present. The <tt>typ</tt> value MUST
use <tt>vc+sd-jwt</tt>. This indicates that the payload of the SD-JWT contains plain
JSON and follows the rules as defined in this specification. It further
indicates that the SD-JWT is a SD-JWT component of a SD-JWT VC.</t>
<t>The following is a non-normative example of a decoded SD-JWT header:</t>

<artwork>{
  "alg": "ES256",
  "typ": "vc+sd-jwt"
}
</artwork>
</section>

<section anchor="claims"><name>Claims</name>
<t>This section defines the claims that can be included in the payload of
SD-JWT VCs.</t>

<section anchor="type-claim"><name><tt>type</tt> claim</name>
<t>This specification defines the JWT claim <tt>type</tt>. The <tt>type</tt> value
MUST be a case-sensitive <tt>StringOrURI</tt> value serving as an identifier
for the type of the SD-JWT VC. A type defines which claims may or must appear in the
Unsecured Payload of the SD-JWT VC and whether they may, must, or must not be
selectively disclosable. This specification does not define any <tt>type</tt> values; instead
it is expected that ecosystems using SD-JWT VCs define such values including
the semantics of the respective claims and associated rules (e.g., policies for issuing and
validating credentials beyond what is defined in this specification).</t>
<t>The following is a non-normative example of how <tt>type</tt> is used to express
a type:</t>

<artwork>{
  "type": "IdentityCredential"
}
</artwork>
<t>For example, a type <tt>IdentityCredential</tt> can be defined such that at least the registered JWT claims <tt>given_name</tt>, <tt>family_name</tt>, <tt>birthdate</tt>, and <tt>address</tt> must appear in the Unsecured Payload. Additionally, the registered JWT claims <tt>email</tt> and <tt>phone_number</tt>, and the private claims <tt>is_over_18</tt>, <tt>is_over_21</tt>, and <tt>is_over_65</tt> may be used. The type might also indicate that <tt>given_name</tt>, <tt>family_name</tt>, <tt>birthdate</tt>, <tt>address</tt> can be selectively disclosable.</t>
</section>

<section anchor="registered-jwt-claims"><name>Registered JWT Claims</name>
<t>SD-JWT VCs MAY use any claim registered in the "JSON Web Token Claims"
registry as defined in <xref target="RFC7519"/>.</t>
<t>If present, the following registered JWT claims MUST be included in the SD-JWT
and MUST NOT be included in the Disclosures, i.e. cannot be selectively
disclosed:</t>

<ul>
<li><t><tt>iss</tt></t>

<ul>
<li>REQUIRED. The Issuer of the Verifiable Credential. The value of <tt>iss</tt>
MUST be a URI. See <xref target="RFC7519"/> for more information.</li>
</ul></li>
<li><t><tt>iat</tt></t>

<ul>
<li>REQUIRED. The time of issuance of the Verifiable Credential. See
<xref target="RFC7519"/> for more information.</li>
</ul></li>
<li><t><tt>nbf</tt></t>

<ul>
<li>OPTIONAL. The time before which the Verifiable Credential MUST NOT be
accepted before validating. See <xref target="RFC7519"/> for more information.</li>
</ul></li>
<li><t><tt>exp</tt></t>

<ul>
<li>OPTIONAL. The expiry time of the Verifiable Credential after which the
Verifiable Credential is no longer valid. See <xref target="RFC7519"/> for more
information.</li>
</ul></li>
<li><t><tt>cnf</tt></t>

<ul>
<li>REQUIRED when Cryptographic Key Binding is to be supported. Contains the confirmation method as defined in <xref target="RFC7800"/>. It SHOULD contain a JWK as defined in Section 3.2 of <xref target="RFC7800"/>.  For Cryptographic Key Binding, the Key Binding JWT in the Combined Format for Presentation MUST be signed by the key identified in this claim.</li>
</ul></li>
<li><t><tt>type</tt></t>

<ul>
<li>REQUIRED. The type of the Verifiable Credential, e.g.,
<tt>IdentityCredential</tt>, as defined in <xref target="type-claim"/>.</li>
</ul></li>
<li><t><tt>status</tt></t>

<ul>
<li>OPTIONAL. The information on how to read the status of the Verifiable
Credential. See <xref target="I-D.looker-oauth-jwt-cwt-status-list"/>
for more information.</li>
</ul></li>
</ul>
<t>The following registered JWT claims MAY be contained in the SD-JWT or in the
Disclosures and MAY be selectively disclosed:</t>

<ul>
<li><t><tt>sub</tt></t>

<ul>
<li>OPTIONAL. The identifier of the Subject of the Verifiable Credential.
The Issuer MAY use it to provide the Subject
identifier known by the Issuer. There is no requirement for a binding to
exist between <tt>sub</tt> and <tt>cnf</tt> claims.</li>
</ul></li>
</ul>
</section>

<section anchor="public-jwt-claims"><name>Public JWT claims</name>
<t>Additional public claims MAY be used in SD-JWT VCs depending on the
application.</t>
</section>

<section anchor="sd-jwt-vc-without-selectively-disclosable-claims"><name>SD-JWT VC without Selectively Disclosable Claims</name>
<t>An SD-JWT VC MAY have no selectively disclosable claims.
In that case, the SD-JWT VC MUST NOT contain the <tt>_sd</tt> claim in the JWT body. It also
MUST NOT have any Disclosures.</t>
</section>
</section>
</section>

<section anchor="example"><name>Example</name>
<t>The following is a non-normative example of an unsecured payload of an
SD-JWT VC.</t>

<sourcecode type="json">{
  "type": "IdentityCredential",
  "given_name": "John",
  "family_name": "Doe",
  "email": "johndoe@example.com",
  "phone_number": "+1-202-555-0101",
  "address": {
    "street_address": "123 Main St",
    "locality": "Anytown",
    "region": "Anystate",
    "country": "US"
  },
  "birthdate": "1940-01-01",
  "is_over_18": true,
  "is_over_21": true,
  "is_over_65": true
}
</sourcecode>
<t>The following is a non-normative example of how the unsecured payload of the
SD-JWT VC above can be used in a SD-JWT where the resulting SD-JWT VC contains
only claims about the Subject that are selectively disclosable:</t>

<sourcecode type="json">{
  "_sd": [
    "09vKrJMOlyTWM0sjpu_pdOBVBQ2M1y3KhpH515nXkpY",
    "2rsjGbaC0ky8mT0pJrPioWTq0_daw1sX76poUlgCwbI",
    "EkO8dhW0dHEJbvUHlE_VCeuC9uRELOieLZhh7XbUTtA",
    "IlDzIKeiZdDwpqpK6ZfbyphFvz5FgnWa-sN6wqQXCiw",
    "JzYjH4svliH0R3PyEMfeZu6Jt69u5qehZo7F7EPYlSE",
    "PorFbpKuVu6xymJagvkFsFXAbRoc2JGlAUA2BA4o7cI",
    "TGf4oLbgwd5JQaHyKVQZU9UdGE0w5rtDsrZzfUaomLo",
    "jdrTE8YcbY4EifugihiAe_BPekxJQZICeiUQwY9QqxI",
    "jsu9yVulwQQlhFlM_3JlzMaSFzglhQG0DpfayQwLUK4"
  ],
  "iss": "https://example.com/issuer",
  "iat": 1683000000,
  "exp": 1883000000,
  "type": "IdentityCredential",
  "_sd_alg": "sha-256",
  "cnf": {
    "jwk": {
      "kty": "EC",
      "crv": "P-256",
      "x": "TCAER19Zvu3OHF4j4W4vfSVoHIP1ILilDls7vCeGemc",
      "y": "ZxjiWWbZMQGHVWKVQ4hbSIirsVfuecCE6t4jT9F2HZQ"
    }
  }
}
</sourcecode>
<t>Note that a <tt>cnf</tt> claim has been added to the SD-JWT payload to express the
confirmation method of the Key Binding.</t>
<t>The following are the Disclosures belonging to the SD-JWT payload above:</t>
<t><strong>Claim <tt>given_name</tt></strong>:</t>

<ul>
<li>SHA-256 Hash: <tt>jsu9yVulwQQlhFlM_3JlzMaSFzglhQG0DpfayQwLUK4</tt></li>
<li>Disclosure:<br/>
<tt>WyIyR0xDNDJzS1F2ZUNmR2ZyeU5STjl3IiwgImdpdmVuX25hbWUiLCAiSm9o</tt><br/>
<tt>biJd</tt></li>
<li>Contents:
<tt>["2GLC42sKQveCfGfryNRN9w", "given_name", "John"]</tt></li>
</ul>
<t><strong>Claim <tt>family_name</tt></strong>:</t>

<ul>
<li>SHA-256 Hash: <tt>TGf4oLbgwd5JQaHyKVQZU9UdGE0w5rtDsrZzfUaomLo</tt></li>
<li>Disclosure:<br/>
<tt>WyJlbHVWNU9nM2dTTklJOEVZbnN4QV9BIiwgImZhbWlseV9uYW1lIiwgIkRv</tt><br/>
<tt>ZSJd</tt></li>
<li>Contents:
<tt>["eluV5Og3gSNII8EYnsxA_A", "family_name", "Doe"]</tt></li>
</ul>
<t><strong>Claim <tt>email</tt></strong>:</t>

<ul>
<li>SHA-256 Hash: <tt>JzYjH4svliH0R3PyEMfeZu6Jt69u5qehZo7F7EPYlSE</tt></li>
<li>Disclosure:<br/>
<tt>WyI2SWo3dE0tYTVpVlBHYm9TNXRtdlZBIiwgImVtYWlsIiwgImpvaG5kb2VA</tt><br/>
<tt>ZXhhbXBsZS5jb20iXQ</tt></li>
<li>Contents:
<tt>["6Ij7tM-a5iVPGboS5tmvVA", "email", "johndoe@example.com"]</tt></li>
</ul>
<t><strong>Claim <tt>phone_number</tt></strong>:</t>

<ul>
<li>SHA-256 Hash: <tt>PorFbpKuVu6xymJagvkFsFXAbRoc2JGlAUA2BA4o7cI</tt></li>
<li>Disclosure:<br/>
<tt>WyJlSThaV205UW5LUHBOUGVOZW5IZGhRIiwgInBob25lX251bWJlciIsICIr</tt><br/>
<tt>MS0yMDItNTU1LTAxMDEiXQ</tt></li>
<li>Contents:
<tt>["eI8ZWm9QnKPpNPeNenHdhQ", "phone_number",</tt><br/>
<tt>"+1-202-555-0101"]</tt></li>
</ul>
<t><strong>Claim <tt>address</tt></strong>:</t>

<ul>
<li>SHA-256 Hash: <tt>IlDzIKeiZdDwpqpK6ZfbyphFvz5FgnWa-sN6wqQXCiw</tt></li>
<li>Disclosure:<br/>
<tt>WyJRZ19PNjR6cUF4ZTQxMmExMDhpcm9BIiwgImFkZHJlc3MiLCB7InN0cmVl</tt><br/>
<tt>dF9hZGRyZXNzIjogIjEyMyBNYWluIFN0IiwgImxvY2FsaXR5IjogIkFueXRv</tt><br/>
<tt>d24iLCAicmVnaW9uIjogIkFueXN0YXRlIiwgImNvdW50cnkiOiAiVVMifV0</tt></li>
<li>Contents:
<tt>["Qg_O64zqAxe412a108iroA", "address", {"street_address":</tt><br/>
<tt>"123 Main St", "locality": "Anytown", "region": "Anystate",</tt><br/>
<tt>"country": "US"}]</tt></li>
</ul>
<t><strong>Claim <tt>birthdate</tt></strong>:</t>

<ul>
<li>SHA-256 Hash: <tt>jdrTE8YcbY4EifugihiAe_BPekxJQZICeiUQwY9QqxI</tt></li>
<li>Disclosure:<br/>
<tt>WyJBSngtMDk1VlBycFR0TjRRTU9xUk9BIiwgImJpcnRoZGF0ZSIsICIxOTQw</tt><br/>
<tt>LTAxLTAxIl0</tt></li>
<li>Contents:
<tt>["AJx-095VPrpTtN4QMOqROA", "birthdate", "1940-01-01"]</tt></li>
</ul>
<t><strong>Claim <tt>is_over_18</tt></strong>:</t>

<ul>
<li>SHA-256 Hash: <tt>09vKrJMOlyTWM0sjpu_pdOBVBQ2M1y3KhpH515nXkpY</tt></li>
<li>Disclosure:<br/>
<tt>WyJQYzMzSk0yTGNoY1VfbEhnZ3ZfdWZRIiwgImlzX292ZXJfMTgiLCB0cnVl</tt><br/>
<tt>XQ</tt></li>
<li>Contents:
<tt>["Pc33JM2LchcU_lHggv_ufQ", "is_over_18", true]</tt></li>
</ul>
<t><strong>Claim <tt>is_over_21</tt></strong>:</t>

<ul>
<li>SHA-256 Hash: <tt>2rsjGbaC0ky8mT0pJrPioWTq0_daw1sX76poUlgCwbI</tt></li>
<li>Disclosure:<br/>
<tt>WyJHMDJOU3JRZmpGWFE3SW8wOXN5YWpBIiwgImlzX292ZXJfMjEiLCB0cnVl</tt><br/>
<tt>XQ</tt></li>
<li>Contents:
<tt>["G02NSrQfjFXQ7Io09syajA", "is_over_21", true]</tt></li>
</ul>
<t><strong>Claim <tt>is_over_65</tt></strong>:</t>

<ul>
<li>SHA-256 Hash: <tt>EkO8dhW0dHEJbvUHlE_VCeuC9uRELOieLZhh7XbUTtA</tt></li>
<li>Disclosure:<br/>
<tt>WyJsa2x4RjVqTVlsR1RQVW92TU5JdkNBIiwgImlzX292ZXJfNjUiLCB0cnVl</tt><br/>
<tt>XQ</tt></li>
<li>Contents:
<tt>["lklxF5jMYlGTPUovMNIvCA", "is_over_65", true]</tt></li>
</ul>
<t>The SD-JWT and the Disclosures would then be serialized by the Issuer into the following format for issuance to the Holder:</t>

<sourcecode type="txt">eyJhbGciOiAiRVMyNTYifQ.eyJfc2QiOiBbIjA5dktySk1PbHlUV00wc2pwdV9wZE9CV
kJRMk0xeTNLaHBINTE1blhrcFkiLCAiMnJzakdiYUMwa3k4bVQwcEpyUGlvV1RxMF9kY
Xcxc1g3NnBvVWxnQ3diSSIsICJFa084ZGhXMGRIRUpidlVIbEVfVkNldUM5dVJFTE9pZ
UxaaGg3WGJVVHRBIiwgIklsRHpJS2VpWmREd3BxcEs2WmZieXBoRnZ6NUZnbldhLXNON
ndxUVhDaXciLCAiSnpZakg0c3ZsaUgwUjNQeUVNZmVadTZKdDY5dTVxZWhabzdGN0VQW
WxTRSIsICJQb3JGYnBLdVZ1Nnh5bUphZ3ZrRnNGWEFiUm9jMkpHbEFVQTJCQTRvN2NJI
iwgIlRHZjRvTGJnd2Q1SlFhSHlLVlFaVTlVZEdFMHc1cnREc3JaemZVYW9tTG8iLCAia
mRyVEU4WWNiWTRFaWZ1Z2loaUFlX0JQZWt4SlFaSUNlaVVRd1k5UXF4SSIsICJqc3U5e
VZ1bHdRUWxoRmxNXzNKbHpNYVNGemdsaFFHMERwZmF5UXdMVUs0Il0sICJpc3MiOiAia
HR0cHM6Ly9leGFtcGxlLmNvbS9pc3N1ZXIiLCAiaWF0IjogMTY4MzAwMDAwMCwgImV4c
CI6IDE4ODMwMDAwMDAsICJ0eXBlIjogIklkZW50aXR5Q3JlZGVudGlhbCIsICJfc2RfY
WxnIjogInNoYS0yNTYiLCAiY25mIjogeyJqd2siOiB7Imt0eSI6ICJFQyIsICJjcnYiO
iAiUC0yNTYiLCAieCI6ICJUQ0FFUjE5WnZ1M09IRjRqNFc0dmZTVm9ISVAxSUxpbERsc
zd2Q2VHZW1jIiwgInkiOiAiWnhqaVdXYlpNUUdIVldLVlE0aGJTSWlyc1ZmdWVjQ0U2d
DRqVDlGMkhaUSJ9fX0.eUqZ_0dIAWQoGxtGAwh4Dy_JreQgJF0S9aspLpgUdQM5GFIke
6YyNibeou-bLYeqpy5OA_M_0p_s0U0cFlMR7g~WyIyR0xDNDJzS1F2ZUNmR2ZyeU5STj
l3IiwgImdpdmVuX25hbWUiLCAiSm9obiJd~WyJlbHVWNU9nM2dTTklJOEVZbnN4QV9BI
iwgImZhbWlseV9uYW1lIiwgIkRvZSJd~WyI2SWo3dE0tYTVpVlBHYm9TNXRtdlZBIiwg
ImVtYWlsIiwgImpvaG5kb2VAZXhhbXBsZS5jb20iXQ~WyJlSThaV205UW5LUHBOUGVOZ
W5IZGhRIiwgInBob25lX251bWJlciIsICIrMS0yMDItNTU1LTAxMDEiXQ~WyJRZ19PNj
R6cUF4ZTQxMmExMDhpcm9BIiwgImFkZHJlc3MiLCB7InN0cmVldF9hZGRyZXNzIjogIj
EyMyBNYWluIFN0IiwgImxvY2FsaXR5IjogIkFueXRvd24iLCAicmVnaW9uIjogIkFueX
N0YXRlIiwgImNvdW50cnkiOiAiVVMifV0~WyJBSngtMDk1VlBycFR0TjRRTU9xUk9BIi
wgImJpcnRoZGF0ZSIsICIxOTQwLTAxLTAxIl0~WyJQYzMzSk0yTGNoY1VfbEhnZ3ZfdW
ZRIiwgImlzX292ZXJfMTgiLCB0cnVlXQ~WyJHMDJOU3JRZmpGWFE3SW8wOXN5YWpBIiw
gImlzX292ZXJfMjEiLCB0cnVlXQ~WyJsa2x4RjVqTVlsR1RQVW92TU5JdkNBIiwgImlz
X292ZXJfNjUiLCB0cnVlXQ~
</sourcecode>
</section>

<section anchor="vc-sd-jwt-verification-and-processing"><name>Verification and Processing</name>
<t>The recipient (Holder or Verifier) of an SD-JWT VC MUST process and verify an
SD-JWT VC as described in Section 6 of
<xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>.</t>
<t>If Key Binding is required (refer to the security considerations in Section 9.6 of <xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>), the Verifier MUST verify the Key Binding JWT
according to Section 6 of <xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>. To verify
the Key Binding JWT, the <tt>cnf</tt> claim of the SD-JWT MUST be used.</t>
<t>For the verification, the <tt>iss</tt> claim in the SD-JWT MAY be used to retrieve the
public key from the JWT Issuer Metadata configuration (as defined in
<xref target="jwt-issuer-metadata"/>) of the SD-JWT VC issuer. Alternative methods MAY be used
to obtain the public key to verify the signature of the SD-JWT.</t>
<t>If there are no selectively disclosable claims, there is no need to process the
<tt>_sd</tt> claim nor any Disclosures.</t>
<t>If <tt>status</tt> is present in the verified payload of the SD-JWT, the status SHOULD
be checked. It depends on the Verifier policy to reject or accept a presentation
of a SD-JWT VC based on the status of the Verifiable Credential.</t>
<t>Any claims used that are not understood MUST be ignored.</t>
<t>Additional validation rules MAY apply, but their use is out of the scope of this
specification.</t>
</section>
</section>

<section anchor="jwt-issuer-metadata"><name>JWT Issuer Metadata</name>
<t>This specification defines the JWT Issuer Metadata to retrieve the JWT Issuer
Metadata configuration of the JWT Issuer of the JWT. The JWT Issuer is
identified by the <tt>iss</tt> claim in the JWT. Use of the JWT Issuer Metadata
is OPTIONAL.</t>
<t>JWT Issuers publishing JWT Issuer Metadata MUST make a JWT Issuer Metadata
configuration available at the path formed by concatenating the string
<tt>/.well-known/jwt-issuer</tt> to the <tt>iss</tt> claim value in the JWT. The <tt>iss</tt> MUST
be a case-sensitive URL using the HTTPS scheme that contains scheme, host and,
optionally, port number and path components, but no query or fragment
components.</t>

<section anchor="jwt-issuer-metadata-request"><name>JWT Issuer Metadata Request</name>
<t>A JWT Issuer Metadata configuration MUST be queried using an HTTP <tt>GET</tt> request
at the path defined in <xref target="jwt-issuer-metadata"/>.</t>
<t>The following is a non-normative example of a HTTP request for the JWT Issuer
Metadata configuration when <tt>iss</tt> is set to <tt>https://example.com</tt>:</t>

<artwork>GET /.well-known/jwt-issuer HTTP/1.1
Host: example.com
</artwork>
<t>If the <tt>iss</tt> value contains a path component, any terminating <tt>/</tt> MUST be
removed before inserting <tt>/.well-known/</tt> and the well-known URI suffix
between the host component and the path component.</t>
<t>The following is a non-normative example of a HTTP request for the JWT Issuer
Metadata configuration when <tt>iss</tt> is set to <tt>https://example.com/user/1234</tt>:</t>

<artwork>GET /.well-known/jwt-issuer/user/1234 HTTP/1.1
Host: example.com
</artwork>
</section>

<section anchor="jwt-issuer-metadata-response"><name>JWT Issuer Metadata Response</name>
<t>A successful response MUST use the <tt>200 OK HTTP</tt> and return the JWT Issuer
Metadata configuration using the <tt>application/json</tt> content type.</t>
<t>An error response uses the applicable HTTP status code value.</t>
<t>This specification defines the following JWT Issuer Metadata configuration
parameters:</t>

<ul>
<li><tt>issuer</tt>
  REQUIRED. The JWT Issuer identifier, which MUST be identical to the <tt>iss</tt>
value in the JWT.</li>
<li><t><tt>jwks_uri</tt></t>

<ul>
<li>OPTIONAL. URL string referencing the JWT Issuer's JSON Web Key (JWK) Set
<xref target="RFC7517"/> document which contains the JWT Issuer's public keys. The value of
this field MUST point to a valid JWK Set document. Use of this parameter is
RECOMMENDED, as it allows for easy key rotation.</li>
</ul></li>
<li><t><tt>jwks</tt></t>

<ul>
<li>OPTIONAL. JWT Issuer's JSON Web Key Set <xref target="RFC7517"/> document value, which
contains the JWT Issuer's public keys. The value of this field MUST be a JSON
object containing a valid JWK Set. This parameter is intended to be used by JWT
Issuer that cannot use the <tt>jwks_uri</tt> parameter.</li>
</ul></li>
</ul>
<t>JWT Issuer Metadata MUST include either <tt>jwks_uri</tt> or <tt>jwks</tt> in their JWT
Issuer Metadata, but not both.</t>
<t>It is RECOMMENDED that the JWT contains a <tt>kid</tt> JWT header parameter that can
be used to lookup the public key in the JWK Set included by value or referenced
in the JWT Issuer Metadata.</t>
<t>The following is a non-normative example of a JWT Issuer Metadata configuration
including <tt>jwks</tt>:</t>

<artwork>{
   "issuer":"https://example.com",
   "jwks":{
      "keys":[
         {
            "kid":"doc-signer-05-25-2022",
            "e":"AQAB",
            "n":"nj3YJwsLUFl9BmpAbkOswCNVx17Eh9wMO-_AReZwBqfaWFcfG
   HrZXsIV2VMCNVNU8Tpb4obUaSXcRcQ-VMsfQPJm9IzgtRdAY8NN8Xb7PEcYyk
   lBjvTtuPbpzIaqyiUepzUXNDFuAOOkrIol3WmflPUUgMKULBN0EUd1fpOD70p
   RM0rlp_gg_WNUKoW1V-3keYUJoXH9NztEDm_D2MQXj9eGOJJ8yPgGL8PAZMLe
   2R7jb9TxOCPDED7tY_TU4nFPlxptw59A42mldEmViXsKQt60s1SLboazxFKve
   qXC_jpLUt22OC6GUG63p-REw-ZOr3r845z50wMuzifQrMI9bQ",
            "kty":"RSA"
         }
      ]
   }
}
</artwork>
<t>The following is a non-normative example of a JWT Issuer Metadata
configuration including <tt>jwks_uri</tt>:</t>

<artwork>{
   "issuer":"https://example.com",
   "jwks_uri":"https://jwt-issuer.example.org/my_public_keys.jwks"
}
</artwork>
<t>Additional JWT Issuer Metadata configuration parameters MAY also be used.</t>
</section>

<section anchor="jwt-issuer-metadata-validation"><name>JWT Issuer Metadata Validation</name>
<t>The <tt>issuer</tt> value returned MUST be identical to the <tt>iss</tt> value of the JWT. If
these values are not identical, the data contained in the response MUST NOT be
used.</t>
</section>
</section>

<section anchor="presenting-verifiable-credentials"><name>Presenting Verifiable Credentials</name>
<t>This section defines encoding, validation and processing rules for presentations
of SD-JWT VCs.</t>

<section anchor="key-binding-jwt"><name>Key Binding JWT</name>
<t>If the presentation of the SD-JWT VC includes a Key Binding JWT, the
following claims are used within the Key Binding JWT:</t>

<ul>
<li><t><tt>nonce</tt></t>

<ul>
<li>REQUIRED. String value used to associate a transaction between a Verifier
an a Holder, and to mitigate replay attacks. The value is passed
through unmodified from the Verifier to the Key Binding JWT. Sufficient
entropy MUST be present in the <tt>nonce</tt> values used to prevent attackers from
guessing values.</li>
</ul></li>
<li><t><tt>aud</tt></t>

<ul>
<li>REQUIRED. The intended recipient of the Key Binding JWT which is
typically the Verifier. See <xref target="RFC7519"/> for more information.</li>
</ul></li>
<li><t><tt>iat</tt></t>

<ul>
<li>REQUIRED. The time of issuance of the Key Binding JWT. See
<xref target="RFC7519"/> for more information.</li>
</ul></li>
<li><t><tt>exp</tt></t>

<ul>
<li>OPTIONAL. The expiration time of the signature when
the Key Binding is no longer considered valid. See <xref target="RFC7519"/>
for more information.</li>
</ul></li>
</ul>
<t>The Key Binding JWT MAY include addtional claims which when not understood
MUST be ignored.</t>
</section>

<section anchor="examples"><name>Examples</name>
<t>The following is a non-normative example of a presentation of the SD-JWT shown
above including a Key Binding JWT:</t>

<sourcecode type="txt">eyJhbGciOiAiRVMyNTYifQ.eyJfc2QiOiBbIjA5dktySk1PbHlUV00wc2pwdV9wZE9CV
kJRMk0xeTNLaHBINTE1blhrcFkiLCAiMnJzakdiYUMwa3k4bVQwcEpyUGlvV1RxMF9kY
Xcxc1g3NnBvVWxnQ3diSSIsICJFa084ZGhXMGRIRUpidlVIbEVfVkNldUM5dVJFTE9pZ
UxaaGg3WGJVVHRBIiwgIklsRHpJS2VpWmREd3BxcEs2WmZieXBoRnZ6NUZnbldhLXNON
ndxUVhDaXciLCAiSnpZakg0c3ZsaUgwUjNQeUVNZmVadTZKdDY5dTVxZWhabzdGN0VQW
WxTRSIsICJQb3JGYnBLdVZ1Nnh5bUphZ3ZrRnNGWEFiUm9jMkpHbEFVQTJCQTRvN2NJI
iwgIlRHZjRvTGJnd2Q1SlFhSHlLVlFaVTlVZEdFMHc1cnREc3JaemZVYW9tTG8iLCAia
mRyVEU4WWNiWTRFaWZ1Z2loaUFlX0JQZWt4SlFaSUNlaVVRd1k5UXF4SSIsICJqc3U5e
VZ1bHdRUWxoRmxNXzNKbHpNYVNGemdsaFFHMERwZmF5UXdMVUs0Il0sICJpc3MiOiAia
HR0cHM6Ly9leGFtcGxlLmNvbS9pc3N1ZXIiLCAiaWF0IjogMTY4MzAwMDAwMCwgImV4c
CI6IDE4ODMwMDAwMDAsICJ0eXBlIjogIklkZW50aXR5Q3JlZGVudGlhbCIsICJfc2RfY
WxnIjogInNoYS0yNTYiLCAiY25mIjogeyJqd2siOiB7Imt0eSI6ICJFQyIsICJjcnYiO
iAiUC0yNTYiLCAieCI6ICJUQ0FFUjE5WnZ1M09IRjRqNFc0dmZTVm9ISVAxSUxpbERsc
zd2Q2VHZW1jIiwgInkiOiAiWnhqaVdXYlpNUUdIVldLVlE0aGJTSWlyc1ZmdWVjQ0U2d
DRqVDlGMkhaUSJ9fX0.eUqZ_0dIAWQoGxtGAwh4Dy_JreQgJF0S9aspLpgUdQM5GFIke
6YyNibeou-bLYeqpy5OA_M_0p_s0U0cFlMR7g~WyJRZ19PNjR6cUF4ZTQxMmExMDhpcm
9BIiwgImFkZHJlc3MiLCB7InN0cmVldF9hZGRyZXNzIjogIjEyMyBNYWluIFN0IiwgIm
xvY2FsaXR5IjogIkFueXRvd24iLCAicmVnaW9uIjogIkFueXN0YXRlIiwgImNvdW50cn
kiOiAiVVMifV0~eyJhbGciOiAiRVMyNTYiLCAidHlwIjogImtiK2p3dCJ9.eyJub25jZ
SI6ICIxMjM0NTY3ODkwIiwgImF1ZCI6ICJodHRwczovL2V4YW1wbGUuY29tL3Zlcmlma
WVyIiwgImlhdCI6IDE2OTIxODk2Nzd9.GikUOdFdJwdSQEnpbrW1gapU4xKq6e1zPlSQ
BvudxBqxea-sNVAqYjOyaDjcwUFFPsZoDoR4Vi9i0VMk8rgqeg
</sourcecode>
<t>In this presentation, the Holder provides only the Disclosure for the claim
<tt>address</tt>. Other claims are not disclosed to the Verifier.</t>
<t>The following example shows a presentation of a (different) SD-JWT without a
Key Binding JWT:</t>

<sourcecode type="txt">eyJhbGciOiAiRVMyNTYifQ.eyJfc2QiOiBbIjA5dktySk1PbHlUV00wc2pwdV9wZE9CV
kJRMk0xeTNLaHBINTE1blhrcFkiLCAiMnJzakdiYUMwa3k4bVQwcEpyUGlvV1RxMF9kY
Xcxc1g3NnBvVWxnQ3diSSIsICJFa084ZGhXMGRIRUpidlVIbEVfVkNldUM5dVJFTE9pZ
UxaaGg3WGJVVHRBIiwgIklsRHpJS2VpWmREd3BxcEs2WmZieXBoRnZ6NUZnbldhLXNON
ndxUVhDaXciLCAiSnpZakg0c3ZsaUgwUjNQeUVNZmVadTZKdDY5dTVxZWhabzdGN0VQW
WxTRSIsICJQb3JGYnBLdVZ1Nnh5bUphZ3ZrRnNGWEFiUm9jMkpHbEFVQTJCQTRvN2NJI
iwgIlRHZjRvTGJnd2Q1SlFhSHlLVlFaVTlVZEdFMHc1cnREc3JaemZVYW9tTG8iLCAia
mRyVEU4WWNiWTRFaWZ1Z2loaUFlX0JQZWt4SlFaSUNlaVVRd1k5UXF4SSIsICJqc3U5e
VZ1bHdRUWxoRmxNXzNKbHpNYVNGemdsaFFHMERwZmF5UXdMVUs0Il0sICJpc3MiOiAia
HR0cHM6Ly9leGFtcGxlLmNvbS9pc3N1ZXIiLCAiaWF0IjogMTY4MzAwMDAwMCwgImV4c
CI6IDE4ODMwMDAwMDAsICJ0eXBlIjogIklkZW50aXR5Q3JlZGVudGlhbCIsICJfc2RfY
WxnIjogInNoYS0yNTYifQ.-qHdV-T4fTH8bez7DFORjWcr3Bs5diCMIEGAOt__PYMc20
H_678SHcRHzjEcH6f2MZsIxBJy7yesYsbGg7oq5w~WyJRZ19PNjR6cUF4ZTQxMmExMDh
pcm9BIiwgImFkZHJlc3MiLCB7InN0cmVldF9hZGRyZXNzIjogIjEyMyBNYWluIFN0Iiw
gImxvY2FsaXR5IjogIkFueXRvd24iLCAicmVnaW9uIjogIkFueXN0YXRlIiwgImNvdW5
0cnkiOiAiVVMifV0~
</sourcecode>
</section>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>TBD: Verifier provided <tt>nonce</tt>.</t>
</section>

<section anchor="privacy-considerations"><name>Privacy Considerations</name>
<t>TBD: Holder provided nonce via <tt>jti</tt>.</t>
</section>

<section anchor="relationships-to-other-documents"><name>Relationships to Other Documents</name>
<t>TBD</t>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.ietf-oauth-selective-disclosure-jwt.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.looker-oauth-jwt-cwt-status-list.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7519.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7800.xml"/>
</references>
<references><name>Informative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7517.xml"/>
</references>

<section anchor="iana-considerations"><name>IANA Considerations</name>

<section anchor="json-web-token-claims-registration"><name>JSON Web Token Claims Registration</name>

<ul>
<li><t>Claim Name: "type"</t>

<ul>
<li>Claim Description: Credential Type</li>
<li>Change Controller: IESG</li>
<li>Specification Document(s): <xref target="type-claim"/> of this document</li>
</ul></li>
</ul>
</section>

<section anchor="media-types-registry"><name>Media Types Registry</name>

<section anchor="application-vc-sd-jwt"><name>application/vc+sd-jwt</name>
<t>The Internet media type for a SD-JWT VC is <tt>application/vc+sd-jwt</tt>.</t>
<t>Type name: : <tt>application</tt></t>
<t>Subtype name: : <tt>vc+sd-jwt</tt></t>
<t>Required parameters: : n/a</t>
<t>Optional parameters: : n/a</t>
<t>Encoding considerations: : 8-bit code points; SD-JWT VC values are encoded as a
series of base64url-encoded values (some of which may be the empty string)
separated by period ('.') and tilde ('~') characters.</t>
<t>Security considerations: : See Security Considerations in <xref target="security-considerations"/>.</t>
<t>Interoperability considerations: : n/a</t>

<ul>
<li>Published specification: : RFC TODO</li>
<li>Applications that use this media type: : Applications that issue, present,
verify verifiable credentials and presentations.</li>
<li><t>Additional information:</t>

<ul>
<li>Magic number(s): n/a</li>
<li>File extension(s): n/a</li>
<li>Macintosh file type code(s): n/a</li>
<li>Person &amp; email address to contact for further information: TBD</li>
<li>Intended usage: COMMON</li>
<li>Restrictions on usage: none</li>
<li>Author: Oliver Terbu <eref target="mailto:oliver.terbu@spruceid.com">oliver.terbu@spruceid.com</eref></li>
<li>Change controller: IETF</li>
</ul></li>
</ul>
</section>
</section>
</section>

<section anchor="Acknowledgements"><name>Acknowledgements</name>
<t>We would like to thank
Alen Horvat,
Andres Uribe,
Brian Campbell,
Christian Bormann,
Giuseppe De Marco,
Michael Jones,
Mike Prorock,
Orie Steele,
Paul Bastian,
Torsten Lodderstedt,
Tobias Looker, and
Kristina Yasuda
for their contributions (some of which substantial) to this draft and to the initial set of implementations.</t>
</section>

<section anchor="document-history"><name>Document History</name>
<t>-00</t>

<ul>
<li>Upload as draft-ietf-oauth-sd-jwt-vc-00</li>
<li>Aligned terminology and descriptions with latest version of SD-JWT</li>
</ul>
<t>[[ pre Working Group Adoption: ]]</t>
<t>-00</t>

<ul>
<li>Initial Version</li>
<li>Removed W3C VCDM transformation algorithm</li>
<li>Various editorial changes based on feedback</li>
<li>Adjusted terminology based on feedback</li>
<li>Added non-selectively disclosable JWT VC</li>
<li>Added a note that this is not W3C VCDM</li>
</ul>
</section>

</back>

</rfc>
