Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework the data model to support statusPurpose field. #24

Merged
merged 4 commits into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 10 additions & 25 deletions contexts/v1.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -16,54 +16,39 @@
}
},

"RevocationList2021": {
"StatusList2021": {
"@id":
"https://w3id.org/vc/status-list#RevocationList2021",
"https://w3id.org/vc/status-list#StatusList2021",
"@context": {
"@protected": true,

"id": "@id",
"type": "@type",

"statusPurpose":
"https://w3id.org/vc/status-list#statusPurpose",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is better than statusType ... but maybe. Still considering.

Copy link
Member Author

@msporny msporny Mar 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned about adding too many xType fields... people are going to get confused between that and the regular type field. Seems like there's good alignment with proofPurpose.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think this is probably a good approach.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+100 @msporny

Copy link

@aljones15 aljones15 Mar 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also agreeing here: statusPurpose is a better name than statusType which creates ambiguity with numerous other uses of the term type.

"encodedList": "https://w3id.org/vc/status-list#encodedList"
}
},

"RevocationList2021Status": {
"StatusList2021Entry": {
"@id":
"https://w3id.org/vc/status-list#RevocationList2021Status",
"https://w3id.org/vc/status-list#StatusList2021Entry",
"@context": {
"@protected": true,

"id": "@id",
"type": "@type",

"statusListCredential": {
"@id":
"https://w3id.org/vc/status-list#statusListCredential",
"@type": "@id"
},
"statusPurpose":
"https://w3id.org/vc/status-list#statusPurpose",
"statusListIndex":
"https://w3id.org/vc/status-list#statusListIndex"
}
},

"SuspensionList2021Status": {
"@id":
"https://w3id.org/vc/status-list#SuspensionList2021Status",
"@context": {
"@protected": true,

"id": "@id",
"type": "@type",

"https://w3id.org/vc/status-list#statusListIndex",
"statusListCredential": {
"@id":
"https://w3id.org/vc/status-list#statusListCredential",
"@type": "@id"
},
"statusListIndex":
"https://w3id.org/vc/status-list#statusListIndex"
}
}
}
}
Expand Down
193 changes: 96 additions & 97 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@
// Team Contact.
//wgPatentURI: "https://www.w3.org/2004/01/pp-impl/98922/status",
maxTocLevel: 2,
inlineCSS: true
inlineCSS: true,
otherLinks: [{
key: "Related Documents",
data: [{
value: "Verifiable Credentials Data Model",
href: "https://www.w3.org/TR/vc-data-model/"
}]
}]
};
</script>
<style>
Expand Down Expand Up @@ -276,7 +283,7 @@ <h2>Data Model</h2>
</p>

<section>
<h3>RevocationList2021Status</h3>
<h3>StatusList2021Entry</h3>

<p>
When an <a>issuer</a> desires to enable status information for a
Expand Down Expand Up @@ -305,93 +312,47 @@ <h3>RevocationList2021Status</h3>
<tr>
<td>type</td>
<td>
The <code>type</code> property MUST be <code>RevocationList2021Status</code>.
The <code>type</code> property MUST be <code>StatusList2021Entry</code>.
</td>
</tr>
<tr>
<td>statusListIndex</td>
<td>statusPurpose</td>
<td>
The <code>statusListIndex</code> property MUST be an arbitrary size integer
greater than or equal to 0, expressed as a string. The value identifies the bit
position of the revocation status of the <a>verifiable credential</a>.
</td>
</tr>
<tr>
<td>statusListCredential</td>
<td>
The <code>statusListCredential</code> property MUST be a URL to a
<a>verifiable credential</a>. When the URL is dereferenced, the resulting
<a>verifiable credential</a> MUST have <code>type</code> property that
includes the <code>StatusList2021Credential</code> value.
</td>
</tr>
</tbody>
</table>

<pre class="example nohighlight" title="Example RevocationList2021Status">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/vc-status-list-2021/v1"
],
"id": "https://example.com/credentials/23894672394",
"type": ["VerifiableCredential"],
"issuer": "did:example:12345",
"issued": "2021-04-05T14:27:42Z",
<span class="highlight">"credentialStatus": {
"id": "https://dmv.example.gov/credentials/status/3#94567",
"type": "RevocationList2021Status",
"statusListIndex": "94567",
"statusListCredential": "https://example.com/credentials/status/3"
}</span>,
"credentialSubject": {
"id": "did:example:6789",
"type": "Person"
},
"proof": { <span class="comment">...</span> }
}
</pre>
</section>

<section>
<h3>SuspensionList2021Status</h3>

<p>
When an <a>issuer</a> desires to enable status information for a
<a>verifiable credential</a>, they MAY add a <code>status</code> property
that uses the data model described in this specification.
</p>

<table class="simple">
<thead>
<tr>
<th style="white-space: nowrap">Property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>
The constraints on the <code>id</code> property are listed in the
Verifiable Credentials Data Model specification [[VC-DATA-MODEL]]. The
value is expected to be a URL that identifies the status information associated
with the <a>verifiable credential</a>. It MUST NOT be the URL for the
status list.
</td>
</tr>
<tr>
<td>type</td>
<td>
The <code>type</code> property MUST be <code>SuspensionList2021Status</code>.
The purpose of the status entry MUST be a string. While the value of the
string is arbitrary, the following values MUST be used for their intended
purpose:
<table class="simple">
<thead>
<tr>
<th style="white-space: nowrap">Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>revocation</code></td>
<td>
Used to cancel the validity of a <a>verifiable credential</a>. This status is
not reversible.
</td>
</tr>
<tr>
<td><code>suspension</code></td>
<td>
Used to temporarily prevent the acceptance of a <a>verifiable credential</a>.
This status is reversible.
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>statusListIndex</td>
<td>
The <code>statusListIndex</code> property MUST be an arbitrary size integer
greater than or equal to 0, expressed as a string. The value identifies the bit
position of the revocation status of the <a>verifiable credential</a>.
position of the status of the <a>verifiable credential</a>.
</td>
</tr>
<tr>
Expand All @@ -406,19 +367,19 @@ <h3>SuspensionList2021Status</h3>
</tbody>
</table>

<pre class="example nohighlight" title="Example SuspensionList2021Status">
<pre class="example nohighlight" title="Example RevocationList2021Status">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/vc-status-list-2021/v1"
"https://w3id.org/vc/status-list/2021/v1"
],
"id": "https://example.com/credentials/23894672394",
"type": ["VerifiableCredential"],
"issuer": "did:example:12345",
"issued": "2021-04-05T14:27:42Z",
<span class="highlight">"credentialStatus": {
"id": "https://dmv.example.gov/credentials/status/3#94567",
"type": "SuspensionList2021Status",
"type": "StatusList2021Entry",
"statusPurpose": "revocation",
"statusListIndex": "94567",
"statusListCredential": "https://example.com/credentials/status/3"
}</span>,
Expand Down Expand Up @@ -452,11 +413,10 @@ <h3>StatusList2021Credential</h3>
<tr>
<td>id</td>
<td>
The <a>verifiable credential</a> that contains the status list MUST
The <a>verifiable credential</a> that contains the status list MAY
express an <code>id</code> property that matches the value specified in
<code>statusListCredential</code> for the corresponding
<code>RevocationList2021Status</code>
(see <a href="#revocationlist2021status"></a>).
<code>StatusList2021Entry</code> (see <a href="#statuslist2021entry"></a>).
</td>
</tr>
<tr>
Expand All @@ -471,7 +431,39 @@ <h3>StatusList2021Credential</h3>
<td>credentialSubject.type</td>
<td>
The <code>type</code> of the credential <a>subject</a>, which is the
status list, MUST be <code>RevocationList2021</code>.
status list, MUST be <code>StatusList2021</code>.
</td>
</tr>
<tr>
<td>credentialSubject.statusPurpose</td>
<td>
The purpose of the status entry MUST be a string. While the value of the
string is arbitrary, the following values MUST be used for their intended
purpose:
<table class="simple">
<thead>
<tr>
<th style="white-space: nowrap">Value</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>revocation</code></td>
<td>
Used to cancel the validity of a <a>verifiable credential</a>. This status is
not reversible.
</td>
</tr>
<tr>
<td><code>suspension</code></td>
<td>
Used to temporarily prevent the acceptance of a <a>verifiable credential</a>.
This status is reversible.
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
Expand All @@ -483,23 +475,25 @@ <h3>StatusList2021Credential</h3>
uncompressed bitstring MUST be at least 16KB in size.
</td>
</tr>

</tbody>
</table>

<pre class="example nohighlight" title="Example RevocationList2021 Credential">
<pre class="example nohighlight" title="Example StatusList2021 Credential">
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/vc-status-list-2021/v1"
"https://w3id.org/vc/status-list/2021/v1"
],
"id": "<span class="highlight">https://example.com/credentials/status/3</span>",
"type": ["VerifiableCredential", "<span class="highlight">StatusList2021Credential</span>"],
"issuer": "did:example:12345",
"issued": "2021-04-05T14:27:40Z",
"credentialSubject": {
"id": "https://example.com/status/3#list",
"type": "<span class="highlight">RevocationList2021</span>",
<span class="highlight">"encodedList": "H4sIAAAAAAAAA-3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAIC3AYbSVKsAQAAA"</span>
"type": "<span class="highlight">StatusList2021</span>",
"statusPurpose": "<span class="highlight">revocation</span>",
"encodedList": "<span class="highlight">H4sIAAAAAAAAA-3BMQEAAADCoPVPbQwfoAAAAAAAAAAAAAAAAAAAAIC3AYbSVKsAQAAA</span>"
},
"proof": { ... }
}
Expand Down Expand Up @@ -562,17 +556,21 @@ <h3>Validate Algorithm</h3>
<ol class="algorithm">
<li>
Let <strong>credentialToValidate</strong> be a <a>verifiable credentials</a>
containing a <code>status</code> entry that is a
<a href="#revocationlist2021status">RevocationList2021Status</a>.
containing a <code>credentialStatus</code> entry that is a
<a href="#statuslist2021entry">StatusList2021Entry</a>.
</li>
<li>
Let <strong>status purpose</strong> be the value of <code>statusPurpose</code>
in the <code>credentialStatus</code> entry in the
<strong>credentialToValidate</strong>.
</li>
<li>
Verify all proofs associated with the <strong>credentialToValidate</strong>.
If a proof fails, return a validation error.
</li>
<li>
Let <strong>statusListCredential</strong> be set to the value of the
<a href="#statuslist2021credential">StatusList2021Credential</a>.
</li>
Verify that the <strong>status purpose</strong> matches the
<code>statusPurpose</code> value in the <strong>statusListCredential</strong>.
<li>
Let <strong>compressed bitstring</strong> be the value of the
<code>encodedList</code> property of the
Expand All @@ -589,11 +587,12 @@ <h3>Validate Algorithm</h3>
<a href="#bitstring-expansion-algorithm">Bitstring Expansion Algorithm</a>.
</li>
<li>
Let <strong>revoked</strong> be the value of the bit at position
Let <strong>status</strong> be the value of the bit at position
<strong>credentialIndex</strong> in the <strong>revocation bitstring</strong>.
</li>
<li>
Return <code>true</code> if revoked is 1, false otherwise.
Return <code>true</code> if <strong>status</strong> is 1, <code>false</code>
otherwise.
</li>
</ol>
</section>
Expand Down