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

signatures should be on quoted graphs #1248

Closed
bblfish opened this issue Aug 20, 2023 · 43 comments
Closed

signatures should be on quoted graphs #1248

bblfish opened this issue Aug 20, 2023 · 43 comments

Comments

@bblfish
Copy link

bblfish commented Aug 20, 2023

In issue 204 on the N3 CG, I tried to translate 2 VC model examples. This revealed a few minor errors and some deeper conceptual problems, which are much easier to see in N3 than in Json-LD. These conceptual problems revolve around what is in a graph context and what is not. The JsonLD seems to place the contexts incorrectly, leading to unclarity about what is and what is not signed.

Update: the problem is perhaps most concisely expressed in a comment below in response to @msporny's feedback.

The N3 notation is to NQuads what Turtle is to NTriples: it makes it easy to read and reduces repetition for the author and the reader so that one can easily get an overview of what is being said. N3 makes it easy to read and write contexts. It also adds many other things, such as the ability to write rules for logical inferences... Where JsonLD makes it easy for developers happy with JSON to use the result, N3 makes it easy to see the data structure and reason about it. It especially makes it easy to see contexts, which are very difficult to see in jsonld.

1. Mapping the JSonLD of example 1 to N3

To take example 1, which I placed here https://bblfish.net/tmp/2023/08/vcdm.ex1.jsonld the result after fixing a few errors with namespaces, explained in detail in N3 issue 204 is that it gives me the following N3:

@prefix sec:     <https://w3id.org/security#> .
@prefix cred:    <https://www.w3.org/2018/credentials#> .
@prefix eg:      <https://example.org/examples#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .

<did:example:c276e12ec21ebfeb1f712ebc6f1>
    <http://schema.org/name>
        "Exemple d'Université"@fr , 
        "Example University"@en .

<did:example:ebfeb1f712ebc6f1c276e12ec21>
    <http://schema.org/alumniOf>
        <did:example:c276e12ec21ebfeb1f712ebc6f1> .

<http://example.edu/credentials/1872>
    cred:issuer <https://example.edu/issuers/565049> ;
    a   eg:AlumniCredential ;
    a   cred:VerifiableCredential ;
    cred:issuanceDate "2010-01-01T19:23:24Z"^^xsd:dateTime ;
    cred:credentialSubject
        <did:example:ebfeb1f712ebc6f1c276e12ec21> ;
    sec:proof {
            []  a sec:RsaSignature2018 ;
                 dc:created "2017-06-18T21:19:10Z"^^xsd:dateTime ;
                sec:jws "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..TCYt5XsITJX1CxPCT8yAV-TVkIEq_PbChOMqsLfRoPsnsgw5WEuts01mq-pQy7UJiN5mgRxD-WUcX16dUEMGlv50aqzpqh4Qktb3rk-BuQy72IFLOqV0G_zS245-kronKb78cPN25DGlcTwLtjPAYuNzVBAh4vGHSrQyHUdBBPM" ;
               sec:proofPurpose sec:assertionMethod ;
              sec:verificationMethod
                    <https://example.edu/issuers/565049#key-1> .        
    }

The problem is that when signing data, one has to be very clear about which triples are signed. They, therefore, belong into a context which in n3 is placed inside the squiggly brackets { ... } .
In this N3 we have the signature in the context, but the claim that should be signed is outside of the context, so exactly what triples are being signed is unclear.

This can be made clearer by representing the above N3 in the diagram below, which shows graphs on rectangular surfaces when they appear inside {...} in the n3 notation.

Credential translated from JsonLD

Here we see that we can't tell clearly what is signed. We see that the credential links to the credential subject did:example:ebfeb1..., but what after that is included in the data signed? Is it also the alumniOf relation? Should one also add the literals? Which of the credential attributes has been signed? The data does not tell us that, but it should.

The problem is that one does not sign an object but a graph. Signatures are always applied to documents. Indeed, we can think of Graphs as semantically structured documents. Graphs are a type of object, of course, but we have a special syntax in N3 to relate them to other nodes by surrounding a set of triples with { ... }. Diagrammatically we represent this as nodes with graphs on the nodes.

As we will see next, we can have graphs in the nodes recursively: that is, graphs within nodes can also have graphs at their nodes. In the diagram below, we see this with the yellow rectangle surrounded by a green rectangle which itself is a node in a larger graph.

2. N3 corresponding to the VC Credentials diagram

The intuitions were clearly understood by the authors of diagram 6 from §3.2 of the VC-data-model spec, which uses surfaces to distinguish different claims.

Credentials Graph image from spec

This diagram represents the signature, the graph signed, and the claim, each in its own graph. This seems like the right model, aligning us with the well-known Says logic for decentralized access control.
We can interpret the colored surfaces as telling us who is making a claim.
Our trust in the claim being made depends on our trust in the agent making the claim, and our ability to verify that it did make that claim.

Anyway, the official Verifiable Claims interpretation of the JsonLD is that it should consist of 3 claims, i.e., sets of relations that we can think of as being placed on surfaces, following an idea from Pat Hayes, that he took from Peirce and which is now being worked on in the RDF Surfaces CG.

As shown in the diagram, a VC is data about a claim (the Yellow surface to the right) stating that Pat is an alumnus of "Example University". That claim is made or "said" by the issuer - the University in this case - at a certain date. The data about that is on the pink surface. Finally, the University key signs the above claim with the statement on the green surface.

In the says logic, this would be expressed as something like this:

$$\text{ UniKey } \text{ says } \text{ Uni } \text{ says } \text{ PaU}$$

where $\text{ PaU } \equiv \text{ Pat alumnusOf Uni }$

This suggests that the pink and yellow surfaces are placed onto the green surface, which follows by associativity of the says relation:

$$ \text{UniKey} \text{ says } ( \text{ Uni } \text{ says } \text{ PaU} ) $$

To be precise, we should perhaps start with The Guard initially receiving the following claim from some connAgent,
ie the agent at the other end of a connection.

$$ \text{ connAgent } \text{says} (\text{UniKey} \text{ says } ( \text{ Uni } \text{ says } \text{ PaU} )) $$

From the Guard's point of view, the only fact that exists at that point in time,
is that the connAgent said that thing (that the UniKey said...)
None of the embedded statements are to be taken as true or false at that point by the Guard.
They are quoted sayings, and their truth value is yet to be decided.

Yet, without needing to trust the connAgent at all, the Guard can verify the embedded claim made by the UniKey using cryptographic signatures so that it can conclude to the truth of the pink surface.
That is because the Guard trust the University key to speak for the University.
So he concludes:

$$ \text{ Uni } \text{ says } \text{ PaU } $$

Again here, the Guard has a fact that does not assert or deny that Pat is an alumnus of Uni, only that the Uni said so.
So we are now on the pink surface where the Guard does not yet know if the yellow surface is true or false.
If the Guard trusts the issuer about claims it makes regarding its own members - which seems like a reasonable assumption - then the Guard can proceed to believe that Pat is an alumnus of that university. Perhaps that is what is needed to be proven to satisfy an access control rule.

All that makes logical sense. If we wanted to write the above official diagram in N3, we would have something like the following N3.
(Note: the diagram has two links (credentialSubject and proof) that go from an object into a node in a graph context (a box). That requires an extra relation to point into the graph, it seems, but I'll ask and the N3 group if it could be done if it were really needed.)

@prefix sec:     <https://w3id.org/security#> .
@prefix cred:    <https://www.w3.org/2018/credentials#> .
@prefix eg:      <https://example.org/examples#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix schema: <http://schema.org/>.

{   
<http://example.edu/credentials/1872>
    cred:issuer <https://example.edu/issuers/565049> ;
    a   eg:AlumniCredential ,  cred:VerifiableCredential ;
    cred:issuanceDate "2010-01-01T19:23:24Z"^^xsd:dateTime ;
    cred:credentialSubject
        <did:example:ebfeb1f712ebc6f1c276e12ec21> ;
    cred:claim { 
    <did:example:ebfeb1f712ebc6f1c276e12ec21>
         schema:alumniOf [ id <did:example:c276e12ec21ebfeb1f712ebc6f1> 
               schema:name "Exemple d'Université"@fr ,   "Example University"@en 
         ] 
   }
 } sec:proofObject _:gn;
    sec:proof {
    _:gn  a sec:RsaSignature2018 ;
           dc:created "2017-06-18T21:19:10Z"^^xsd:dateTime ;
           sec:jws "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..TCYt5XsITJX1CxPCT8yAV-TVkIEq_PbChOMqsLfRoPsnsgw5WEuts01mq-pQy7UJiN5mgRxD-WUcX16dUEMGlv50aqzpqh4Qktb3rk-BuQy72IFLOqV0G_zS245-kronKb78cPN25DGlcTwLtjPAYuNzVBAh4vGHSrQyHUdBBPM" ;
            sec:proofPurpose sec:assertionMethod ;
            sec:verificationMethod
                    <https://example.edu/issuers/565049#key-1> 
    ]  .
} .

Here the VC signed the information about who made the claim and the claim together.
Now we see that it is odd that the university's name is in the claim. Should it perhaps be outside the claim? It is not clear from the graph what is intended there, but both would be fine.

3. Slight Simplification of N3 translation of Diagram

We have two arguments for removing the green surface:

  1. Since the information about the signature is not itself signed, the claim does not perhaps need to be in a graph context. In the language of RDF Surfaces, if the top surface is positive, then we can take it to be the default surface.
  2. As argued above from the key says ... we can think of the green surface as containing the pink one and so the green surface being the base one. In that case we can see that the green surface would be the default graph and we can get rid of it altogether.

Removing the green surface simplifies the n3 quite a lot giving us:

@prefix sec:     <https://w3id.org/security#> .
@prefix cred:    <https://www.w3.org/2018/credentials#> .
@prefix eg:      <https://example.org/examples#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix schema: <http://schema.org/>.

{   
<http://example.edu/credentials/1872>
    cred:issuer <https://example.edu/issuers/565049> ;
    a   eg:AlumniCredential ,  cred:VerifiableCredential ;
    cred:issuanceDate "2010-01-01T19:23:24Z"^^xsd:dateTime ;
    cred:credentialSubject
        <did:example:ebfeb1f712ebc6f1c276e12ec21> ;
    cred:claim { 
    <did:example:ebfeb1f712ebc6f1c276e12ec21>
         schema:alumniOf [ id <did:example:c276e12ec21ebfeb1f712ebc6f1> 
               schema:name "Exemple d'Université"@fr ,   "Example University"@en 
         ] 
   }
 } sec:proofObject [  a sec:RsaSignature2018 ;
     dc:created "2017-06-18T21:19:10Z"^^xsd:dateTime ;
     sec:jws "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..TCYt5XsITJX1CxPCT8yAV-TVkIEq_PbChOMqsLfRoPsnsgw5WEuts01mq-pQy7UJiN5mgRxD-WUcX16dUEMGlv50aqzpqh4Qktb3rk-BuQy72IFLOqV0G_zS245-kronKb78cPN25DGlcTwLtjPAYuNzVBAh4vGHSrQyHUdBBPM" ;
      sec:proofPurpose sec:assertionMethod ;
      sec:verificationMethod
               <https://example.edu/issuers/565049#key-1> 
    ]  .

Graphically this can be represented as
Intermediate: Credential with Credential Proof in default

Would it be possible, with minor tweaking of the Json-ld contexts, to get the above interpretation to work?

4. proposition of N3 intended by the JsonLD

The above seems right but is not what the JsonLD mapping to RDF shows, if only because it is missing the yellow surface and has placed the data to be signed on the default surface.

The closest to something we could get that resembles the RDF we found the current JSonLD to translate to is to flip the
contexts. Instead of the signature being in the context, we get something more reasonable by having the signed data be in a context.

Perhaps this is what the VC data model intended the original json-ld to represent?

@prefix sec:     <https://w3id.org/security#> .
@prefix cred:    <https://www.w3.org/2018/credentials#> .
@prefix eg:      <https://example.org/examples#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix schema: <http://schema.org/>.

{
<did:example:c276e12ec21ebfeb1f712ebc6f1>
    schema:name
        "Exemple d'Université"@fr ,   "Example University"@en .

<did:example:ebfeb1f712ebc6f1c276e12ec21>
    schema:alumniOf <did:example:c276e12ec21ebfeb1f712ebc6f1> .

<http://example.edu/credentials/1872>
    cred:issuer <https://example.edu/issuers/565049> ;
    a   eg:AlumniCredential ,  cred:VerifiableCredential ;
    cred:issuanceDate "2010-01-01T19:23:24Z"^^xsd:dateTime ;
    cred:credentialSubject
        <did:example:ebfeb1f712ebc6f1c276e12ec21>  .
 } sec:proof [  a sec:RsaSignature2018 ;
           dc:created "2017-06-18T21:19:10Z"^^xsd:dateTime ;
           sec:jws "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..TCYt5XsITJX1CxPCT8yAV-TVkIEq_PbChOMqsLfRoPsnsgw5WEuts01mq-pQy7UJiN5mgRxD-WUcX16dUEMGlv50aqzpqh4Qktb3rk-BuQy72IFLOqV0G_zS245-kronKb78cPN25DGlcTwLtjPAYuNzVBAh4vGHSrQyHUdBBPM" ;
            sec:proofPurpose sec:assertionMethod ;
            sec:verificationMethod
                    <https://example.edu/issuers/565049#key-1> 
    ]  .

That is, here we only use a graph context to enclose the signed triples, which in this case
I guess enclose the metadata about the issuer too. Graphically represented, this is what we have:

Is this what Credential Example 2 Should Be?

Is that correct? I don't know. It would require a very close analysis of the spec to understand what is intended to be signed. Update: See a detailed reasoning for why this follows from the previous two models.

(todo: We could also imagine that only the claim was intended to be signed.)

In issue 204 on the N3 repo I show the same problem with Example 6 in the spec.

Conclusion

Perhaps I missed something. Is there a mistake in the JsonLd or its @context statements? I have not written a JSON-LD parser, so I don't know the capabilities of contexts inside out. Perhaps it is easy to fix? What is the intended N3 corresponding to the Json-Ld?

@bblfish
Copy link
Author

bblfish commented Aug 21, 2023

I also had a look at Example 2: A simple example of a verifiable presentation.

  1. I placed a copy of the JsonLd here https://bblfish.net/tmp/2023/08/vcdm.ex2.jsonld
  2. The first transformation led to something close to N3 but with broken URLs such as <sec:proofPurpose> for relations, and literals that appear as blank nodes https://bblfish.net/tmp/2023/08/vcdm.ex2.broken.n3 . The JsonLd playground gives the same result.
  3. I repaired that and added namespaces https://bblfish.net/tmp/2023/08/vcdm.ex2.repaired.n3
  4. Then I translated to pure N3 (ie without quads) doing the minimal work https://bblfish.net/tmp/2023/08/vcdm.ex2.pure.n3
  5. Then I translated that using the Jena N3 parser Jen3 which made it more readable https://bblfish.net/tmp/2023/08/vcdm.ex2.jen3.n3
  6. And finally, I improved it by hand https://bblfish.net/tmp/2023/08/vcdm.ex2.n3 but not to perfection
@prefix cred:    <https://www.w3.org/2018/credentials#> .
@prefix credEx:  <http://example.edu/credentials/> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sec:     <https://w3id.org/security#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix sch:     <http://schema.org/> .
@prefix dc:      <http://purl.org/dc/terms/> .

credEx:1872 sec:proof {
     []  rdf:type sec:RsaSignature2018 ;
       dc:created "2017-06-18T21:19:10Z"^^xsd:dateTime ;
       sec:jws "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..TCYt5XsITJX1CxPCT8yAV-TVkIEq_PbChOMqsLfRoPsnsgw5WEuts01mq-pQy7UJiN5mgRxD-WUcX16dUEMGlv50aqzpqh4Qktb3rk-BuQy72IFLOqV0G_zS245-kronKb78cPN25DGlcTwLtjPAYuNzVBAh4vGHSrQyHUdBBPM" ;
       sec:proofPurpose sec:assertionMethod ;
       sec:verificationMethod
             <https://example.edu/issuers/565049#key-1> .        
} .

[] a  cred:VerifiablePresentation ;
   cred:verifiableCredential {
     <did:example:ebfeb1f712ebc6f1c276e12ec21>
         sch:alumniOf [ id <did:example:c276e12ec21ebfeb1f712ebc6f1> 
             sch:name "Example University"@en, "Exemple d'Université"@fr
         ] .
              
     credEx:1872 a cred:VerifiableCredential,
             <https://example.org/examples#AlumniCredential>; 
         cred:credentialSubject
             <did:example:ebfeb1f712ebc6f1c276e12ec21> .
     credEx:1872
         cred:issuanceDate "2010-01-01T19:23:24Z"^^xsd:dateTime ;
         cred:issuer <https://example.edu/issuers/565049> .        
    } ;
    sec:proof {
      [] a sec:RsaSignature2018 ;
        dc:created "2018-09-14T21:19:10Z"^^xsd:dateTime ;
        sec:challenge "1f44d55f-f161-4938-a659-f8026467f126" ;
        sec:domain "4jt78h47fh47" ;
        sec:jws "eyJhbGciOiJSUzI1NiIsImI2NCI6ZmFsc2UsImNyaXQiOlsiYjY0Il19..kTCYt5XsITJX1CxPCT8yAV-TVIw5WEuts01mq-pQy7UJiN5mgREEMGlv50aqzpqh4Qq_PbChOMqsLfRoPsnsgxD-WUcX16dUOqV0G_zS245-kronKb78cPktb3rk-BuQy72IFLN25DYuNzVBAh4vGHSrQyHUGlcTwLtjPAnKb78" ;
        sec:proofPurpose sec:authenticationMethod ;
        sec:verificationMethod
           <did:example:ebfeb1f712ebc6f1c276e12ec21#keys-1> .        
    } .

This makes more sense because we are linking a graph of verifiable credentials and a signature. But it seems like the signature needs not be placed in a graph. It is an acknowledged statement of fact. And indeed, it is a bit weird because the signature is a blank node so the proof is a statement in which one has to find the only blank node and continue from there to find the proof. The context could have been avoided and a link directly to the blank node made.

@bblfish bblfish changed the title N3 rendering of Verifiable Claims Examples raises some questions N3 rendering of Verifiable Claims Examples problems Aug 23, 2023
@iherman
Copy link
Member

iherman commented Aug 23, 2023

The issue was discussed in a meeting on 2023-08-23

  • no resolutions were taken
View the transcript

3.2. N3 rendering of Verifiable Claims Examples problems (issue vc-data-model#1248)

See github issue vc-data-model#1248.

Manu Sporny: This has to do with the 'verifiable credential graph' language that some would like, and also relates to the diagrams. I think Henry got it right, and suggested some post-CR modifications we could make.

Brent Zundel: I'm not hearing any objections to this being post-CR.

@bblfish
Copy link
Author

bblfish commented Aug 23, 2023

@iherman reported

..
Brent Zundel: I'm not hearing any objections to this being post-CR.
...

Thanks for letting me know about that discussion.
What does post-CR mean? I tried to look at the tags for definitions or hints but without luck.

@brentzundel
Copy link
Member

post-CR means that addressing this issue will not require additional features or normative requirements being added to the spec, which means we will be able to focus on it after the VC Data Model v2 has entered Candidate Recommendation.

@bblfish
Copy link
Author

bblfish commented Aug 24, 2023

Just as an addendum note to @iherman, @brentzundel and @msporny
I think the official diagram discussed in §2 above entails the representation §3 and §4, and I detailed that in a comment on issue 206 to the N3 group.

More importantly, I argue that the JsonLd that is currently produced won't do. It is related to how graphs get merged, which is an essential property of RDF: merging true graphs should lead to true graphs.

Consider the graph reached by current jsonld conversion

CredFromJsonLd

Now consider merging this graph with another true graph. This could quickly render the signature meaningless. Take for example, the true graph

<did:example:ebfeb1f712ebc6f1c276e12ec21> foaf:name "Pay Hayes";
      foaf:publications <https://scholar.google.com/citations?sortby=pubdate&hl=en&user=VTNr4NMAAAAJ&view_op=list_works> .

If we merged that to the representation where only the signature is a surface, the new graph would consist of the intact green surface, the other data and those three triples on the same default surface. I.e. we have the following graph, and it would no longer be possible to know what was signed.
Crential Merged.
Now this may not be false, but it suddenly became useless. There is no longer any way of using the signature.

Compare this to the merging of the simplified model of §4 with the true Pat Hayes graph.
We get the following:

Cred graph of §4 union a true graph about Pat

Here we can still verify the Credential Graph using the Proof object, and if we still believe it, then we can merge the content of the pink surface and the rest without problem.

So that provides a simple, pragmatic reason for why the current translation is not good.
The main issue description may not have been clear enough, so I thought this argument deserves particular attention.

@msporny
Copy link
Member

msporny commented Aug 24, 2023

@bblfish thanks for the very detailed issue report; the diagrams were very helpful.

They need to be in their own context because people can say untrue things, and others can be suspicious of what is being said….

Yes, exactly.

My initial response to you (which I deleted, but you still responded to) was incorrect, please discard that one and read this one instead. :)

I had to read through your issue multiple times in an attempt to understand the content at depth. I'm fairly convinced I'm still missing something, so apologies for the overly verbose reply. Just to establish some other content that might help you navigate this:

For securing a Verifiable Credential using Data Integrity (what you delve into above), you might want to familiarize yourself with the Data Integrity specification and at least one of the cryptosuite specifications, such as a EdDSA Cryptosuite that uses RDF Dataset Canonicalization.

Namely, the following are further detailed across these specifications:

  • The current cryptosuites that do RDF processing, do the processing on RDF Datasets.
  • Each item in the verifiableCredential set in a VerifiablePresentation is a separate RDF Dataset.
  • The RDF Dataset for the proof, expressed via the proof predicate, is canonicalized and hashed separately from the default RDF Dataset (the Verifiable Credential). The hash for the default dataset and the hash for the proof dataset are then combined, hashed and digitally signed over to create the final proofValue. This "binds" the proof to the default RDF dataset.
  • This also extends to proof sets (where each proof is its own RDF Dataset) and proof chains, where the latter encapsulates previous proof RDF Datasets in the signature.

What I'm trying to elaborate upon above is that we have put a lot of thought and time into ensuring that the proper boundaries are created around the default RDF Dataset, the proof RDF Datasets, and the verifiableCredential RDF Datasets as they are found in VerifiablePresentations. That said, we do not allow arbitrary information to be "mixed into" the default graph -- doing so will cause the signature to (rightly) fail. Similarly, adding another RDF Dataset into the ones that exist (as a part of the Verifiable Presentation or Verifiable Credential) will not merge or allow that dataset to affect the secured graphs of information; it will always be a RDF Dataset that exists, but has no proof attached to it (and can, therefore, not be trusted in the same way a VC or a VP can be trusted). To put it another way; don't merge graphs that you don't trust with graphs that you do trust. Similarly, don't merge two graphs together that have blank node labels as you might end up merging things that are labeled with the same label, but are not the same subject (this is the whole reason we're using RDF Datasets in the first place -- to keep the blank nodes separate).

There is a boundary to the information that is contained in a VP or a VC, and that boundary ends at the document you receive. Since we're using RDF Datasets, you /can/ make inferences across those boundaries if objects are identified using URLs, but merging RDF Datasets isn't something one should do without careful consideration (such as, there are no labeled blank nodes in either RDF Dataset that might conflict).

I do expect that we could do better to explain the above, but at the same time, remember that we have a number of people in the ecosystem that neither care about these formal modelling details or want to know about them. The more RDF we put into the specification, the more agitated a subset of the community becomes... so we've always struggled to provide just the right level of information, especially at the beginning of the specification, without opening up the flood gates into graph theory and formal semantics... which, people using this technology, don't need to know about... just like how someone operating a vehicle doesn't need to understand the physics behind it all... you just press one pedal to go and another pedal to stop.

All that said, we do have to do at least the following:

  • Address the concept of a Verifiable Credential graph, a proof graph, and the default graph raised in issue Address normative concept of VerifiableCredentialGraph #1240.
  • Perform some minor fixes to the diagrams (e.g., fix the proof arrows in Figure 6 and Figure 8)
  • Perhaps address some variation of what you're concerned about in this issue, but when and where remains to be seen.

In the meantime, try this example instead, which is from the latest spec (EXAMPLE 1):

{
  "@context": [
    "https://www.w3.org/ns/credentials/v2",
    "https://www.w3.org/ns/credentials/examples/v2"
  ],
  "id": "http://university.example/credentials/1872",
  "type": ["VerifiableCredential", "ExampleAlumniCredential"],
  "issuer": "https://university.example/issuers/565049",
  "validFrom": "2010-01-01T19:23:24Z",
  "credentialSubject": {
    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
    "alumniOf": {
      "id": "did:example:c276e12ec21ebfeb1f712ebc6f1",
      "name": "Example University"
    }
  },
  "proof": {
    "type": "DataIntegrityProof",
    "cryptosuite": "eddsa-2022",
    "created": "2023-06-18T21:19:10Z",
    "proofPurpose": "assertionMethod",
    "verificationMethod": "https://university.example/issuers/565049#key-123",
    "proofValue": "zQeVbY4oey5q2M3XKaxup3tmzN4DRFTLVqpLMweBrSxMY2xHX5XTYV8nQApmEcqaqA3Q1gVHMrXFkXJeV6doDwLWx"
  }
}

I'll stop there and see if you have more concrete guidance on what we could do with the above.

@bblfish
Copy link
Author

bblfish commented Aug 25, 2023

Thanks, Manu, for the Detailed response. Let me start with your final suggestion to look at the examples 1 and 2 from the 2.0 spec (I was looking at the 1.1 data model before)
Example 1 is found inside Example 2. As a visual reminder, this is the figure 6 from the data model 2.0 representing the verifiable presentation, containing a Verifiable claim.
explanatory graph from the spec
I agree that is a good model.
(I would just say that one could simplify because there is no need to place the signature in its own graph.)

So, I started with Example 1 JsonLD and using the JSLd Playground transformed it into NQuads and then by hand to Example 1 N3. (It definitely would save a huge amount of time if @jeswr added his JS N3 lib to the JS playground as per comment). The resulting RDF was structurally no different than the 1.1 spec. Within a node of the default RDF graph, we have a Credential Proof Graph. We colored that node green here to match the spec colors. When a node contains a graph, we can call it a surface. (The default graph is on the default surface, too, if you think of every RDF graph as located on a single hidden node, which is just another way to say that it could be quote in a larger context)

Example 1 diagram

I then translated the Json from Example 2 using the same procedure (and using Jen3) to an n3 file which makes it easier to see the semantic structure. I drew that out as

diagram representing structure of Example 2

The problem here is less serious than above because both the credential graph and the presentation proof graph are wrapped in a node. (The proof does not need to be wrapped as above). Still, once the presentation proof is verified, we can unwrap the verifiable credential graph and pass it on to another agent who may want to verify the credential: but it will be stumped again because it won't be able to tell what is signed.

That is just like with cryptography: we sign a stringlike object. In RDF1.0, these graphs-in-nodes would have been rdf:XMLLiteral with an RDF/XML type. All we are doing here is showing more clearly the internal structure of such nodes.

To put it another way, don't merge graphs that you don't trust with graphs that you do trust.

Agree. My argument above works because I start with the assumption that I fully trust two graphs that I wanted to merge. I used this graph as an example

<did:example:ebfeb1f712ebc6f1c276e12ec21> foaf:name "Pay Hayes";
      foaf:publications <https://tinyurl.com/patHayesScholar> .

We assume those two triples are true. It is a law of RDF that when true graphs are merged the new conjoined graph will also be true.
RDF also defines that merging two graphs requires blank nodes from each graph to be kept distinct in the merged graph. This is equivalent to what in lambda calculus is called alpha reduction. All programming languages do this, and in RDF it is exceedingly easy to to so.

So given those two essential rules of RDF that are millions of times easier to understand than cryptographic algorithms, if we were to merge the Example 1 graph with the two triples above, we would get the following graph:

Example 1 graph with two extra triples
The color coding of nodes on the default surface indicates their role for VC: the only colors that count are the surface colors. So a program can not tell in advance that the grey nodes are different from the yellow ones.
Now notice that even though nothing may be false, we did move from a situation where we had a signature that we thought made sense - i.e., we thought we could verify it on a given graph - to one where it no longer did: because we don't know what set of triples are signed. This indicates that this is ill-defined.
We can also see that there will an indefinite number of such consequences that can be drawn from other true graphs.

But there is an even better example. Every graph with a node ?n entails a graph with the extra triple ?n owl:sameAs ?n.
So the diagram drawn from the JSON-LD example 1, entails the following diagram with only the arrow in red added
owlSame as inferred
With just this small change, it will no longer be easy to tell what the signature was signing.

But the answer to this is very simple:

  1. Place the triples that have been signed in what we call a surface (an RDF graph in a node), as you do in the pink diagram from the spec at the top. Those are the triples the cryptosuites have somehow canonicalized so that the signed text can be recreated - (just as with HttpSig headers).
  2. You don't need to place the signature in its own graph, as RDF ensures that blank nodes from merged graphs will never be identified.

Here 1 is essential. 2 would just simplify your data structure. I say that, betting that you can't find a good reason not just to use a blank node.

Given those points, what you want is the RDF or JSON/LD for this diagram:

Proposal for Example 1

Is that problematic to express in JSON-LD?

@bblfish
Copy link
Author

bblfish commented Aug 26, 2023

I think the simple rule should be that: whatever is signed should be a graph node; i.e., what goes into {...} in n3 or the things that are 4tuples in NQuads, or the surfaces containing graphs in our diagrams.

Following the rule, this is what the Example 2 Presentation should look like.
proposed data structure for Presentation in Example 2
(Arguably, the yellow claim could be added to clarify what is being asserted precisely by whom.)

@bblfish bblfish changed the title N3 rendering of Verifiable Claims Examples problems signatures should be on quoted graphs Aug 26, 2023
@TallTed
Copy link
Member

TallTed commented Aug 28, 2023

@bblfish @msporny (and others) -- Please note that color coding will not be sufficient to mark elements of diagrams in our published documents, for a11y reasons. Dashed or otherwise differentiated lines and borders, and different kinds of B&W (or other high contrast) shading of interiors, is preferred.

Specifically regarding the draft diagrams above, @bblfish, I would like to have some border around each entire dataset. (The "page color" background is fine.)

@bblfish
Copy link
Author

bblfish commented Aug 28, 2023

Btw, I put a lot of energy into making the diagrams also work in Dark Mode so that people can read them at night and still see the arrows.

Someone who reads the above diagrams and does not see color would not lose out on the information presented. A color-blind person would see it more like the computer sees it: the only thing of import are graphs composed of arrows and nodes, with values on the nodes, which can be strings, integers, and other literals, blank nodes, URIs, or graphs recursively. So the yellow-colored nodes that belong to the claim graph in Figure 6 of the spec don't belong to the claim graph if they are not themselves inside a node that distinguishes them from the rest of the graph, as in many of the examples above. What colors a node is the context in which it is located. I just kept the color of the nodes as a visual reminder of their intended role... (a debatable decision, I agree).

As for placing the whole graph inside a default node, i.e., having a border around the whole node, I think that would be better left to the document portraying the diagram: the outer context is there to be drawn out by information that is outside the context of the graph: i.e., another graph that mentions these graph, by placing them in a node. In the language of RDF Surfaces all current RDF graphs are on a positive surface, and a positive surface on a positive surface makes a positive surface, i.e., the border can be erased.

Now for the moment, these diagrams are here not to be placed inside a spec but to explain the problem with the current encoding of VCs, which I hope will be fixed :-)

@dlongley
Copy link
Contributor

dlongley commented Aug 28, 2023

@bblfish,

The charter limits us to securing VCs and similar documents which put data in the default graph and has worked this way for a decade; and that data must be signed. This informs the design. We were specifically asked not to try and create a general solution for all linked data, but rather this specific profile of "well-bound documents".

When previously signed data (like VCs) is attached to other graphs, we do put it into a graph container, but we expect it to be removed and put back into a default graph for independent verification.

Future work could extend things further, but that's not what was on the table for this WG.

@bblfish
Copy link
Author

bblfish commented Aug 28, 2023

@dlongley, charter interpretation is a fine art that requires many different contexts to be brought together. A key criterion is that what you come up with has to be coherent with the existing specs, such as JSON, JWK, JsonLd, and therefore, RDF and RDF semantics.

My impression is that you have been working very closely with Json and the cryptography community, who don't care at all about the semantic web side. In your time working on these specs, you learned from them and produced something that makes them happy. That is a great feat.

But clearly, people have not been seriously looking at the semantic side at all. First, in the 1.1 Data Model spec, there were a lot of basic mistakes in the RDF generated from the examples, which shows that the spec was not tested in depth. (For the IETF Signing HTTP Messages Spec, I ran tests on all the examples (of a version ~17), to make sure the signatures were correct).

A charter cannot order you to do what breaks existing specs, nor can it order you to build logically incoherent systems. When push comes to shove on an issue like this, the charter would have to give ground to RDF semantics. But, in any case, I could not find the text in the charter which supports your statement.

I think you may want to keep the JSON format stable if possible. So one should search for a solution as far as possible to see if JsonLD provides tools to give the right semantics and make the Json folks happy too. Otherwise one may have to make a slight adjustment at the syntax level.

Currently from the RDF perspective, it is not possible to really tell what is being signed. As a result, it is not really possible to verify a signature if one is serious about the Semantic side. I really don't think it can be a big step to get these things right.

@dlongley
Copy link
Contributor

dlongley commented Aug 28, 2023

@bblfish,

charter interpretation is a fine art that requires many different contexts to be brought together.

Indeed. And it only gets accepted once it has specific text that certain parties, for whatever reason, agree to -- in the face of potential objections. It's quite true that all of the various concerns raised are not always easily gleaned from the charter text directly. Often these concerns can then only be more deeply understood from reading long conversations on various public mailing lists or meeting minutes. Even then, the potential objections aren't necessarily understood by all parties but if the text is agreed to, the group moves on without dwelling on them or trying to fully understand all facets.

But clearly, people have not been seriously looking at the semantic side at all.

I would not say that. It may be true that other portions have received proportionally more attention. And a number of mistakes were made in areas that were known to not have been well tested, especially with RSA signatures. This work has been dropped.

As you know, producing work items in working groups can be very challenging as a number of different competing concerns must be reconciled. And no work item output is ever perfect. But this is why work continues on in future revisions and with new iterations of working groups -- each with their own hard timelines and hard fought outputs.

Currently from the RDF perspective, it is not possible to really tell what is being signed.

This is not true: for well-bound datasets (such as VCs), for proof sets, everything in the default graph is signed over as is the contents of each individual proof (separately). This does imply a constraint, as mentioned above and that you also reference, that you cannot merge data into a singular default graph without knowing where the boundaries are unless they are tracked independently, such as they are, for example, with externalized JSON structure. But improving on this further is a different issue for another WG if anyone is able to create a charter that would allow working on that problem without objections. Whether such work can get sufficient support and consensus from competing communities with goals that are not perfectly aligned -- in order to produce acceptable output -- is also an open question.

@bblfish
Copy link
Author

bblfish commented Aug 28, 2023

Let's do this a step at a time @dlongley . What text in the Verifiable Credentials WG charter do you believe supports your position that the signature must be of the default graph.
(which I believe I showed above breaks RDF semantics, but lets' leave this for later.)

@dlongley
Copy link
Contributor

@bblfish,

I don't think any text requires it directly. I think the charter that was going to be created to pursue security of RDF outside of the context of specifically signing VCs, which do use the default graph, was strenuously objected to and instead the work was limited to securing VCs and similar well-bound documents.

@bblfish
Copy link
Author

bblfish commented Aug 29, 2023

@dlongley "I don't think any text requires it directly."
Well, in that case, why not try to resolve the problem?

I looked at example 1 Verifiable Credential from the 1.1 spec and the 2.0 spec, and both map to RDF graphs which are logically equivalent to one with an extra owl:sameAs on an arbitrary node, and even some implied types added, as illustrated here with the three red arrows below.
extra owl:sameAs link
How would an agent wishing to verify that signature (on the green background), determine which triples on the background surface (those with pink nodes) were the ones signed? There are endless similar cases that can be built. This just follows from RDF being a framework for logical OO-like entailment.

You have no problem using "named" graphs since you use one for the signature - the surface in green above. We can solve all your problems by moving the named graph around so that the triples to be signed are in the context, as shown here
VC that solves all problems
It's simple, logically correct, and safe.

So our question should be:

  • Can we change the JsonLd @context to get the logically correct VC graph?
  • if not, is there something else that we would have to change?

@dlongley
Copy link
Contributor

dlongley commented Aug 29, 2023

@bblfish,

Well, in that case, why not try to resolve the problem?

For the reasons I stated in the rest of my comment: #1248 (comment)

Can we change the JsonLd @context to get the logically correct VC graph?

No, I do not believe so.

if not, is there something else that we would have to change?

I don't think there is interest in taking on this kind of change -- especially given what I mentioned in my comment -- at this time. The feeling is that we will have to make more incremental progress instead and take on this sort of thing, if it's desirable (gets to consensus), in a future WG.

@bblfish
Copy link
Author

bblfish commented Aug 29, 2023

So, do I understand correctly that there is no way a client could know what is signed in the following logical consequence of your Example 1? (without trying out various guesses such as removing owl:sameAs or rdf:type links?)

logical consequence of Example 1 from spec

@dlongley
Copy link
Contributor

dlongley commented Aug 29, 2023

@bblfish,

A particular JSON-LD document is well bound. They presume everything is signed according to the securing mechanism's documentation. This works and there are implementations that use it today without issue.

Extending the wrappers around what is signed into the information space as you have recommended would be great. We just can't do it right now, there are a number of practical (but not strictly technical) limitations that are in the way.

@msporny
Copy link
Member

msporny commented Aug 29, 2023

So, do I understand correctly that there is no way a client could know what is signed in the following logical consequence of your Example 1? (without trying out various guesses such as removing owl:sameAs or rdf:type links?)

Yes, because by doing the merge in the way that you've done it, you've violated the "well bound dataset" requirement that this WG is under. IOW, you shouldn't do the merge BEFORE checking signatures, you should do it AFTER checking signatures (where you're fine if the data is co-mingled)... and if you're not fine w/ co-mingling the data, you should put it into a separate graph (as you say). Processing rules could then take the quads and put them into a default graph to check the signature (if you wanted the proof to live on w/ the data).

A future WG, more focused on RDF, could tackle the concern you raised but, as @dlongley stated above, doing so in this WG is 1) out of scope for this WG to address, and 2) using the VC Data Model and Data Integrity in a way that it was not intended to be used, 3) entirely preventable if you don't process it in the way that you are, and 4) achievable if you do some post-processing on the RDF Dataset to add/remove the boundaries that you'd like.

Does the above make sense, @bblfish?

@bblfish
Copy link
Author

bblfish commented Aug 29, 2023

@msporny I don't see a definition of "well bound dataset" in the VC Data Model spec 2.0.
The way to get that in RDF, you have to either
a. enclose the dataset in a node (i.e. a named graph)
b. or you have to use a reification mechanism
Since you are using JsonLd, and you are already using named graphs, you might as well use them. That is the only way to do it.

We should have a brainstorming session because we are confronted here with a clear problem and a reasonable solution and yet a strong rejection on your part that is mostly procedurally based. I feel that behind that lies a technical problem that is keeping quiet.

I am left to having to guess what the real underlying technical problem is. My guess is informed from discussions some ten years ago, where, if I remember correctly, a few people warned about the problem you were getting yourself into here. But at the time, if I remember correctly, the answer was that JSON-LD would solve the problem. And perhaps it can...

So here is my guess - tell me if I am right.

You want to be able to add signatures to JSON without changing the JSON parsers so that they can see the content without having to read the signature, perhaps first. (One can glean that from how you build up your examples in the VC Data Integrity spec where you start with

{
  "title": "Hello world!"
};

and then add the "proof" next to the title.
This syntactic structure is what forces you to have the "proof" next to the other content, which is in the default graph. I guess that you can only place the "proof" in its own graph using JSON-LD @context. Everything else being open ends up in the default graph unless specified differently by the JsonLD context.

Is that right?

@dlongley
Copy link
Contributor

dlongley commented Aug 29, 2023

@bblfish,

We should have a brainstorming session because we are confronted here with a clear problem and a reasonable solution and yet a strong rejection on your part that is mostly procedurally based. I feel that behind that lies a technical problem that is keeping quiet.

Political, social, and procedural issues are in the way here. The only technical issues have to do with what has already been mentioned right here in this issue, which is that VCs use JSON-LD in a JSON-idiomatic way and those always use the default graph. You could express what you're looking for in a non-JSON-idiomatic way (using @graph) that would be rejected by the vanilla JSON community, which would not be helpful here. A future JSON-LD WG could consider a new @context feature to try and overcome this, but that is also a procedural, political, and social problem, not a strictly technical one.

As mentioned many times, the biggest hurdle is not technical. Rather, it is more complex; it is related to those parties that very strenuously objected to doing anything around RDF security that wasn't strictly tied to VCs, which again, are expressed in JSON-LD format and always use the default graph to ensure idiomatic JSON, which is, again partly for political and social reasons, and not strictly technical in nature.

We simply cannot do what you're asking at this time for procedural, social, and political reasons. Technical solutions alone are not possible. A number of different WGs with members that are able to come to consensus on a variety of issues all within the same timeline is what is required to do what you want. Unfortunately, that's not where we are today. A technical solution can always be invented to just about any of these problems if those other issues fade away.

@bblfish
Copy link
Author

bblfish commented Aug 29, 2023

I understand what you are saying, @dlongley, but my point is that your RDF model is so clearly wrong that it is the equivalent of pushing people to use broken cryptographic systems. No Charter can be used to support such an abuse of a standard you are basing your work on.
So the only thing you can do is find an acceptable solution, either by extending JsonLD or by changing your syntax. Sometimes one has to confront difficult decisions. You can't forever push the problems out into the future.

@dlongley
Copy link
Contributor

dlongley commented Aug 29, 2023

@bblfish,

I disagree with your assessment.

You can't forever push the problems out into the future.

Not forever, just now. An attempt was already made to do something different that could have included what you are interested in, but a pivot had to be made to focus on the work that is now quickly approaching CR. These things do not happen in a political and social vacuum, getting to consensus is hard, standards are never perfect, and procedural timelines are real.

@bblfish
Copy link
Author

bblfish commented Aug 30, 2023

I would say this issue is close to going on forever now.

I brought it up in a January 2016 email "Signature in Wrong Position", and I know this type of problem was brought up years before on various occasions. I just thought that day I should summarise it:

The mistake is to put the signature inside the graph.
Take example 1:

{
 "@context": "https://w3id.org/identity/v1",
 "title": "Hello World!",
 "signature": {
   "type": "LinkedDataSignature2015",
   "creator": "http://example.com/i/pat/keys/5",
   "created": "2011-09-23T20:21:34Z",
   "domain": "example.org",
   "nonce": "2bbgh3dgjg2302d-d2b3gi423d42",
   "signatureValue": "OGQzNGVkMzVm4NTIyZTkZDYMmMzQzNmExMgoYzI43Q3ODIyOWM32NjI="
 }
}

In short: Signatures should be external to the graph since that is the object
of the signature. By placing it inside the graph as above, the problem is

  1. the algorithm needs to remove elements from the signed graph
  2. The algorithm won't be able to cope with alignment of ontologies, such as
    a different relation being discovered to be owl:sameAs the :signature
    relation above. If another such widely used vocabulary is found, or perhaps even
    if the current vocabulary is extended, then the signature verification systems won't
    necessarily be able to understand to remove those relations too.

There was a long discussion see thread, but your answer the next day was that the graph could be signed:

...
All that being said, there's no reason why you can't bundle things up in
a graph before signing them, for example:

{
 "someOtherMetaData": { ... },
 "someProperty": {
   "@graph": { core data }
 },
 "signature": { ... }
}

This is the approach taken in the Identity Credentials work, where an Identity can possess credentials, each stored as a signed graph itself -- and you can sign the entire Identity as well, whilst maintaining the integrity of the signed credentials.

I did not want to continue the discussion at that point, as there were too many moving parts.
So instead, I went off to learn Category Theory, which I think was a good investment.

When the Verifiable Credentials Model 1.1 came along, I thought I should check how you had solved the problem, and on seeing Figure 6 with a Credential Graph was pleased that this had been done correctly. I did not have time to check carefully as I did in the last week what the JsonLD corresponded to.

The argument put forward most succinctly a few comments up is closely related to what I brought up 7.5 years ago. But it is of course, much clearer now, since I can work from documents you have published, rather than promises of things that were to happen.

@iherman
Copy link
Member

iherman commented Oct 18, 2023

Alas!, I think this issue should be closed because we cannot properly finish the discussion with Henry 😢. The essence of his message, ie, that the current diagrams are incorrect, has been taken up in #1318; the rest of the discussion involving N3 and possibly RDF surfaces is to be followed up elsewhere, if needed.

@brentzundel @Sakurann @msporny

@msporny
Copy link
Member

msporny commented Oct 18, 2023

Agree, marking pending close.

@msporny msporny added the pending close Close if no objection within 7 days label Oct 18, 2023
@iherman

This comment was marked as off-topic.

@msporny

This comment was marked as off-topic.

@melvincarvalho
Copy link

Henry's issue was:

In short: Signatures should be external to the graph, since that is the object of the signature

...

It is much better to put the signature outside of the graph.

Diagrams are only one part of it. It would be better if the JSON-LD was written out together with the diagram.

Henry has put a lot of work into pointing out a major bug. I think it would be a good one to fix.

If it's going to be a WONTFIX, I think it would be good to say that in this issue.

@iherman

This comment was marked as off-topic.

@iherman
Copy link
Member

iherman commented Oct 19, 2023

Oops. I have just realized that I have put comments to the wrong issue!!

#1248 (comment) and #1248 (comment) and, I suppose, #1248 (comment), should have been added to #1318

@msporny
Copy link
Member

msporny commented Oct 19, 2023

Henry has put a lot of work into pointing out a major bug. I think it would be a good one to fix.

There is disagreement on whether or not this is a bug. To put it more clearly -- it's not a bug. Here's the answer to the question that Henry posed:

How would an agent wishing to verify that signature (on the green background), determine which triples on the background surface (those with pink nodes) were the ones signed?

The agent would have to use the same bound document that was used to generate the signature. That is, you can't just take the document and throw it into a quad-store w/o ensuring that you keep all the triples/graphs in some sort of bound structure. Doing that is outside of the scope of the WG, which is why the WG was limited to addressing the problem in bound documents (not arbitrary graph soup databases).

So, there is a simple answer to the question posed: If you want to verify the signature, keep the information together, such as just storing the JSON-LD document in a document-oriented database.

@iherman
Copy link
Member

iherman commented Oct 19, 2023

@melvincarvalho: Henry himself said, in #1248 (comment):

I would say this issue is close to going on forever now.

See also #1248 (comment).

We do not have a separate "WONTFIX" label in our repository, but I think that, semantically, this issue falls into this category: at this stage of the WG's work this will not be fixed. Hence, the proposal is to close it.

@melvincarvalho
Copy link

melvincarvalho commented Oct 19, 2023

@iherman I dont believe Henry's use of the word "forever" is to be taken literally. He has been objecting to this since 2016, and the objection dates back even further than that.

this type of problem was brought up years before on various occasions

I think he is objecting to the issue that he has worked hard to describe, for a very long time, being ignored or swept under the rug, or kicked into the "long grass".

So the only thing you can do is find an acceptable solution ... You can't forever push the problems out into the future

@iherman
Copy link
Member

iherman commented Oct 19, 2023

You may be right, @melvincarvalho, but I believe my comment

We do not have a separate "WONTFIX" label in our repository, but I think that, semantically, this issue falls into this category: at this stage of the WG's work this will not be fixed. Hence, the proposal is to close it.

reflects the WG's position.

@brentzundel @Sakurann

@kaefer3000
Copy link

kaefer3000 commented Oct 19, 2023

Henry indeed has a point.

@uvdsl and I saw the issue too when looking at the verifiable credentials data model with our RDF glasses on.

In [1,2], we discuss possible solutions for the issue of how to represent the triples to be signed, with the contestants:

  • Reified RDF triples in RDF lists
  • RDF-star triples in and outside of RDF lists
  • Named graphs

None of the above was without drawbacks (reified triples - referential opacity, named graphs - what are the semantics - are the signed triples asserted?, RDF lists - imposed ordering on the triples, no RDF list - open set of triples ...). N3 quoted graph would also have been a contestant, but also not without problems.

We thus agree with Henry that the current state of the standard is iffy from an RDF perspective, thus we hope that the issue gets more attention than a WONTFIX and the standard receives some update, even if it is minor.

[1] Christoph Braun, Tobias Käfer "Quantifiable Integrity for Linked Data on the Web", Semantic Web Journal, 2023. https://semantic-web-journal.net/content/quantifiable-integrity-linked-data-web-0
[2] Christoph Braun, Tobias Käfer "Self-Verifying Web Resource Representations using Solid, RDF-star and Signed URIs", Demo at the European Semantic Web Conference (ESWC), 2023. https://uvdsl.solid.aifb.kit.edu/conf/2022/eswc/demo

@melvincarvalho
Copy link

There is disagreement on whether or not this is a bug. To put it more clearly -- it's not a bug.

Compare this with Henry's comment:

your RDF model is so clearly wrong that it is the equivalent of pushing people to use broken cryptographic systems.

No Charter can be used to support such an abuse of a standard you are basing your work on. So the only thing you can do is find an acceptable solution.

It seems more than saying: "that the current diagrams are incorrect". IMHO it's worth looking at possible solutions, as suggested by @bblfish and @kaefer3000.

@iherman
Copy link
Member

iherman commented Oct 24, 2023

The new PR #1326, which has just been raised, is very much relevant for this discussion. Beyond improving the diagrams, it also gives a proper definition of which graphs, i.e., which quads, are signed through the mechanism defined by the proof property. This was indeed missing (or unclear) from the spec so far and, in my view, this is the major issue raised by Henry. The PR does this using the RDF Dataset terminology, which is our only choice, because other solutions, like N3, are not formal standards, nor are they expressible in JSON-LD today.

The definition is VC specific, and relies on "out of band" knowledge of the structure of Verifiable Credentials. This is the approach that has been around for a long time, which has been adopted by the Working Group (previous and current), and has already been deployed in products. In other words, the PR does not provide a generic solution for securing linked data, nor does it aim to do so. In an ideal world, a generic solution would have to include, I presume, some sort of "back" relationships from the proof to the original data in some way or other to specify "what" is being signed. But such a generic approach is not what this WG is meant to do, nor is it chartered to do.

@iherman
Copy link
Member

iherman commented Oct 24, 2023

Admin: imho this issue should be closed if and when #1326 is finalized and merged to the main spec. To avoid misunderstandings, I have removed the 'pending close' flag, which could be misunderstood.

@iherman iherman added pr exists and removed pending close Close if no objection within 7 days labels Oct 24, 2023
@melvincarvalho
Copy link

@iherman

improving the diagrams, it also gives a proper definition of which graphs, i.e., which quads, are signed through the mechanism defined by the proof property. This was indeed missing (or unclear) from the spec so far and, in my view, this is the major issue raised by Henry

I do not believe this is correct

Henry's statement:

the only thing you can do is find an acceptable solution, either by extending JsonLD or by changing your syntax

Would it be correct to say that #1326 are non normative changes (for example to the diagrams)?

@iherman
Copy link
Member

iherman commented Oct 24, 2023

@iherman

improving the diagrams, it also gives a proper definition of which graphs, i.e., which quads, are signed through the mechanism defined by the proof property. This was indeed missing (or unclear) from the spec so far and, in my view, this is the major issue raised by Henry

I do not believe this is correct

Henry's statement:

the only thing you can do is find an acceptable solution, either by extending JsonLD or by changing your syntax

... and I respectfully disagree with this for the specific VC case. It may be correct if the aim is the general solution. But it isn't.

Also

extending JsonLD or by changing your syntax

is simply not an option for the Working Group.

Would it be correct to say that #1326 are non normative changes (for example to the diagrams)?

As I hinted in #1326 (comment), it is actually a borderline. The diagram changes are indeed non-normative. But the changes or, rather, additions in the specification on the usage proof property, with regard to VC-s (see here and here) are specifying something that was not clearly written down in the spec (although it was there between the lines).

@msporny
Copy link
Member

msporny commented Nov 4, 2023

PR #1326 has been merged, which was raised to address this issue. Closing.

@msporny msporny closed this as completed Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants