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

Add relatedResource property to VerifiablePresentation #1370

Closed
wants to merge 5 commits into from
Closed
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
4 changes: 4 additions & 0 deletions contexts/credentials/v2
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@
"@container": "@graph",
"@context": null
},
"relatedResource": {
"@id": "https://www.w3.org/2018/credentials#relatedResource",
"@type": "@id"
},
"termsOfUse": {
"@id": "https://www.w3.org/2018/credentials#termsOfUse",
"@type": "@id"
Expand Down
26 changes: 17 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3054,30 +3054,38 @@ <h4>Semantic Interoperability</h4>
<section>
<h2>Integrity of Related Resources</h2>
<p>
When including a link to an external resource in a <a>verifiable credential</a>,
When including a link to an external resource in a <a>conforming document</a>,
it is desirable to know whether the resource that is pointed to is the same at
signing time as it is at verification time. This applies to cases where there is
an external resource that is remotely retrieved as well as to cases where the
<a>issuer</a> and/or <a>verifier</a> may have local cached copies of a resource.
<a>issuer</a> and/or <a>verifier</a> might have local cached copies of a
resource.
</p>
<p>
It is also desirable to know that the contents of the JSON-LD context(s) used in
the <a>verifiable credential</a> are the same when used by both the
a <a>conforming document</a> are the same when used by both the
<a>issuer</a> and <a>verifier</a>.
</p>
<p>
To validate that a resource referenced by a <a>verifiable credential</a> is the
To validate that a resource referenced by a <a>conforming document</a> is the
same at verification time as it is at issuing time, an implementer MAY include a
property named <code id="defn-relatedResource">relatedResource</code> that
stores an array of objects that describe additional integrity metadata about
each resource referenced by the <a>verifiable credential</a>. If
each resource referenced by the <a>conforming document</a>. If
<code>relatedResource</code> is present, there MUST be an object in the array
for each remote resource for each context used in the verifiable credential.
for each remote resource used in the verifiable credential.
Copy link
Contributor

Choose a reason for hiding this comment

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

data URIs are IRIs.

</p>
<p class="issue" title="Mandatory listing of contexts in relatedResouce are under debate.">
The requirement that contexts be listed in `relatedResource` is currently being
debated in the VCWG. This requirement might be removed in future iterations of
the specification.
</p>
<p class="issue atrisk" title="Use of `relatedResource` in `VerifiablePresentation`">
The Working Group is seeking feedback from implementers on whether the
`relatedResource` property is useful when used in `VerifiablePresentation`
objects. Based on feedback, the Working Group might determine that the property
is not useful and will then remove the feature during the Candidate
Recommendation phase.
</p>
<p>
Each object in the <code>relatedResource</code> array MUST contain the
Expand Down Expand Up @@ -3118,7 +3126,7 @@ <h2>Integrity of Related Resources</h2>
</ul>

<p>
Any object in the <a>verifiable credential</a> that contains an `id` [[URL]]
Any object in a <a>conforming document</a> that contains an `id` [[URL]]
property MAY be annotated with integrity information as specified in this
section by inclusion of <code>digestSRI</code>
in the object.
Expand All @@ -3140,7 +3148,7 @@ <h2>Integrity of Related Resources</h2>
FIPS 180-4 Secure Hash Standard</a> and the
<a href="https://media.defense.gov/2022/Sep/07/2003071834/-1/-1/0/CSA_CNSA_2.0_ALGORITHMS_.PDF">
Commercial National Security Algorithm Suite 2.0</a> to ensure that they are
chosing a current and reliable hash algorithm. At the time of this writing
choosing a current and reliable hash algorithm. At the time of this writing
`sha384` SHOULD be considered the minimum strength hash algorithm for use by
implementers.
</p>
Expand Down Expand Up @@ -3170,7 +3178,7 @@ <h2>Integrity of Related Resources</h2>
</pre>

<p>
An example of an object in a `credentialSubject` that is refering to an
An example of an object in a `credentialSubject` that is referring to an
integrity protected image.
</p>

Expand Down
10 changes: 5 additions & 5 deletions vocab/credentials/v2/vocabulary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ property:
label: Subresource integrity digest
defined_by: https://www.w3.org/TR/vc-data-model-2.0/#defn-digestSRI
range: cred:sriString
see_also:
see_also:
- label: Subresource Integrity Metadata
url: https://www.w3.org/TR/SRI/#the-integrity-attribute

- id: evidence
label: Evidence
defined_by: https://www.w3.org/TR/vc-data-model-2.0/#defn-evidence
Expand Down Expand Up @@ -163,7 +163,7 @@ property:

- id: relatedResource
label: Related resource
domain: cred:VerifiableCredential
domain: [cred:VerifiableCredential, cred:VerifiablePresentation]
Copy link
Contributor

@OR13 OR13 Dec 4, 2023

Choose a reason for hiding this comment

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

sry, I meant for this comment to go on "range".

Given this points to credentials by URL, which can't you use a Data URI here?

{
  "@context": [
    "https://www.w3.org/ns/credentials/v2",
    "https://www.w3.org/ns/credentials/examples/v2"
  ],
  "id": "urn:uuid:5ec137ea-871e-11ee-a783-ef96a4397a9a",
  "type": ["VerifiablePresentation", "ExamplePresentation"],
  "relatedResource": [
    "https://vendor.example/resources/42",
    "data:application/jwt;base64,QzVjV...RMjUK==",
    "data:application/cwt;base64,ZmlOW...pYzMK="
 ]
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Because an enveloped credential is far more that just a "related resource".

Copy link
Contributor

Choose a reason for hiding this comment

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

it would be concerning to me to use this property to represent jwts/cwts that are transformable to w3c vcs

Copy link
Member Author

@msporny msporny Dec 11, 2023

Choose a reason for hiding this comment

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

@decentralgabe, would you find this mechanism more acceptable? #1379 (preview here)

range: IRI
defined_by: https://www.w3.org/TR/vc-data-model-2.0/#defn-relatedResource

Expand Down Expand Up @@ -198,7 +198,7 @@ datatype:
label: Datatype for digest SRI values
upper_value: xsd:string
defined_by: https://www.w3.org/TR/vc-data-model-2.0/#the-sristring-datatype
see_also:
see_also:
- label: Subresource Integrity Metadata
url: https://www.w3.org/TR/SRI/#the-integrity-attribute