<?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-terbu-sd-jwt-vc-01" submissionType="IETF" category="std" xml:lang="en" consensus="true">

<front>
<title abbrev="SD-JWT VC">SD-JWT-based Verifiable Credentials with JSON payloads (SD-JWT VC)</title><seriesInfo value="draft-terbu-sd-jwt-vc-01" 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>Internet</area>
<workgroup>TODO Working Group</workgroup>
<keyword>security</keyword>
<keyword>openid</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 payload based on the SD-JWT
format <xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>.</t>
</abstract>

</front>

<middle>

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

<section anchor="three-party-model"><name>Three-Party-Model</name>
<t>In the so-called Three-Party-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>Three-Party-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 Holder 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, an optional fourth party can be
involved, a Status Provider, who delivers revocation information to Verifiers.
(The Verifier can also serve as the Status Provider.)</t>
<t>This specification defines Verifiable Credentials based on the SD-JWT
format with a JWT Claim Set.</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. While JWT-based credentials enable selective
disclosure, i.e., the ability for a Holder to disclose only a subset of the contained
claims, in an Identity Provider ecosystem by issuing new JWTs to the Verifier for
every presentation, this approach does not work in the three-party-model.</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). This format is therefore perfectly suited for
Verifiable Credentials.</t>
<t>SD-JWT itself does not define the claims that must be used within the payload or
their semantics. This specification therefore defines how Verifiable Credentials
can be expressed using SD-JWT.</t>
<t>JWTs (and SD-JWTs) 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. Private claims are not relevant for this specification due to the
openness of the three-party-model. Since SD-JWTs are based on JWTs, this specification
aims to express the basic
Verifiable Credential data model purely through JWT Claim Sets, using registered
claims while allowing Issuers to use additional registered claims, as well as
new or existing public claims, to make statements about the Subject of the
Verifiable Credential.</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", defined by
<xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>.</t>

<dl>
<dt>Verifiable Credential (VC):</dt>
<dd>An Issuer-signed attestation with claims about a Subject whose authenticity
can be cryptographically verified.</dd>
<dt>SD-JWT-based Verifiable Credential (SD-JWT VC):</dt>
<dd>A Verifiable Credential encoded using the Issuance format defined in
<xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>.</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 three-party-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 Combined Format for Issuance as
defined in Section 5.3. of <xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>.</t>
<t>SD-JWT VCs MUST contain all Disclosures corresponding to their SD-JWT component
except for Decoy Digests as per Section 5.1.1.3. of <xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>.</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> claim is used
to express the type of the JSON object that is secured by the
JWT. The <tt>type</tt> value MUST be a case-sensitive <tt>StringOrURI</tt> value.</t>
<t>The following is a non-normative example of how <tt>type</tt> is used to express
a type:</t>

<artwork>{
  "type": "SomeType"
}
</artwork>
</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 Holder 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"/> and in this case, the <tt>kid</tt> (Key ID) member MUST be present in the JWK.  For Cryptographic Holder Binding, the Holder 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 [TBD] 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 value of <tt>sub</tt> MUST be a URI. 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>
</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 holder 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
HR0cHM6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3JRZmpGWFE3SW8wOXN5YWpBIiw
gImlzX292ZXJfMjEiLCB0cnVlXQ~WyJsa2x4RjVqTVlsR1RQVW92TU5JdkNBIiwgImlz
X292ZXJfNjUiLCB0cnVlXQ
</sourcecode>
</section>

<section anchor="vc-sd-jwt-verification-and-processing"><name>Verification and Processing</name>
<t>The recipient of the SD-JWT VC MUST process and verify an SD-JWT VC as
follows:</t>

<ol>
<li>REQUIRED. Process and verify the SD-JWT as defined in
Section 6. of <xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>. 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. A Verifier MAY use alternative
methods to obtain the public key to verify the signature of the SD-JWT.</li>
<li>OPTIONAL. 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.</li>
</ol>
<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="data-format-1"><name>Data Format</name>
<t>A presentation of an SD-JWT VC MUST be encoded using the SD-JWT Combined
Format for Presentation as defined in Section 5.4. of
<xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>.</t>
<t>A presentation of an SD-JWT VC MAY contain a Holder Binding JWT as described in
Section 5.4.1. of <xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>.</t>

<section anchor="holder-binding-jwt"><name>Holder Binding JWT</name>
<t>If the presentation of the SD-JWT VC includes a Holder Binding JWT, the
following claims are used within the Holder 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 Holder 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 Holder 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 Holder 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 Holder Binding is no longer considered valid. See <xref target="RFC7519"/>
for more information.</li>
</ul></li>
</ul>
<t>The Holder Binding JWT MAY include addtional claims which when not understood
MUST be ignored.</t>
</section>
</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 Holder Binding JWT:</t>

<sourcecode type="txt">eyJhbGciOiAiRVMyNTYifQ.eyJfc2QiOiBbIjA5dktySk1PbHlUV00wc2pwdV9wZE9CV
kJRMk0xeTNLaHBINTE1blhrcFkiLCAiMnJzakdiYUMwa3k4bVQwcEpyUGlvV1RxMF9kY
Xcxc1g3NnBvVWxnQ3diSSIsICJFa084ZGhXMGRIRUpidlVIbEVfVkNldUM5dVJFTE9pZ
UxaaGg3WGJVVHRBIiwgIklsRHpJS2VpWmREd3BxcEs2WmZieXBoRnZ6NUZnbldhLXNON
ndxUVhDaXciLCAiSnpZakg0c3ZsaUgwUjNQeUVNZmVadTZKdDY5dTVxZWhabzdGN0VQW
WxTRSIsICJQb3JGYnBLdVZ1Nnh5bUphZ3ZrRnNGWEFiUm9j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z0Uv32APNwttIe5MAD_Ysw
</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
Holder Binding JWT:</t>

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

<section anchor="vp-sd-jwt-verification-and-processing"><name>Verification and Processing</name>
<t>The Verifier MUST process and verify a presentation of SD-JWT VC as follows:</t>

<ol>
<li>REQUIRED. When processing and verifying the presentation of the SD-JWT VC,
the Verifier MUST follow the same verification and processing rules as defined
in <xref target="vc-sd-jwt-verification-and-processing"/>.</li>
<li>OPTIONAL. If provided, the Verifier MUST verify the Holder Binding JWT
according to Section 6.2. of <xref target="I-D.ietf-oauth-selective-disclosure-jwt"/>.
To verify the Holder Binding JWT, the <tt>cnf</tt> claim of the SD-JWT MUST be used.</li>
</ol>
</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/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, Christian Bormann,
Giuseppe De Marco, 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>-01</t>

<ul>
<li>Removed W3C VCDM transformation algorithm</li>
<li>Various editorial changes based on feedback</li>
</ul>
<t>-00</t>

<ul>
<li>Initial Version</li>
</ul>
</section>

</back>

</rfc>
