-
Notifications
You must be signed in to change notification settings - Fork 112
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 VC-JWT diagrams to core specification #1135
Comments
Boy, that sounds straightforward... |
%%{
init: {
'theme': 'base',
'themeVariables': {
'primaryColor': '#DDDDDD',
'primaryTextColor': '#000000',
'nodeBorder': '#000000',
'edgeLabelBackground': '#DDDDDD',
'clusterBkg': '#DDDDDD',
'clusterBorder': '#000000',
'lineColor': '#000000',
'fontFamily': 'monospace',
'darkmode': true
}
}
}%%
graph
subgraph 0 [  Verifiable Credential   ]
n4("Metadata")
n5("Claim(s)")
n6("Proof(s)")
end
subgraph 1 [  JSON Web Token   ]
n1("Header")
n2("Claimset")
n3("Signature")
end
subgraph 2 [  Claimset   ]
subgraph 3 [  Metadata   ]
n7("AlumniCredential")
n8("Credential 123")
n9("ExampleUniversity")
n10("2023-05-21T19:16:35.495Z")
end
subgraph 4 [  Claims   ]
n11("Pat")
n12("ExampleUniversity")
end
end
subgraph 5 [  Protected Header   ]
n13("iss: did:example:123")
n14("kid: #key-42")
n15("alg: ES384")
n16("typ: vc+ld+jwt")
n17("cty: vc+ld+json")
end
0 --   representation   --> 1
n8 -- type --> n7
n8 -- validFrom --> n10
n8 -- issuer --> n9
n8 -- subject --> n11
n11 -- AlumniOf --> n12
n2 --> 2
n1 --> 5
class n1,n4,n7,n8,n9,n10,n13,n14,n15,n16,n17 RedNode;
class n2,n5,n11,n12 YellowNode;
class n3,n6 GreenNode;
classDef RedNode text-align: center, color:#000, fill:#DDAABB, stroke:#000, stroke-width:1px;
classDef YellowNode color:#000, fill:#FFEE99, stroke:#000, stroke-width:1px;
classDef GreenNode color:#000, fill:#BBDDAA, stroke:#000, stroke-width:1px;
|
With "proof tunneling" %%{
init: {
'theme': 'base',
'themeVariables': {
'primaryColor': '#DDDDDD',
'primaryTextColor': '#000000',
'nodeBorder': '#000000',
'edgeLabelBackground': '#DDDDDD',
'clusterBkg': '#DDDDDD',
'clusterBorder': '#000000',
'lineColor': '#000000',
'fontFamily': 'monospace',
'darkmode': true
}
}
}%%
graph
subgraph 1 [  JSON Web Token   ]
n1("Header")
n2("Claimset")
n3("Signature")
end
subgraph 7 [  Verifiable Credential   ]
subgraph 2 [  Credential Graph   ]
subgraph 3 [  Metadata   ]
n7("AlumniCredential")
n8("Credential 123")
n9("ExampleUniversity")
n10("2023-05-21T19:16:35.495Z")
end
subgraph 4 [  Claims   ]
n11("Pat")
n12("ExampleUniversity")
end
end
subgraph 6 [  Proof Graph   ]
n18("Signature 456")
n19("DataIntegrityProof")
n20("2023-05-21T20:09:37.988Z")
n21("zu4oey5q...eV6")
n22("Example University Public Key 7")
end
end
subgraph 5 [  Protected Header   ]
n13("iss: did:example:123")
n14("kid: #key-42")
n15("alg: ES384")
n16("typ: vc+ld+jwt")
n17("cty: vc+ld+json")
end
2 --   proof   --> 6
n8 -- type --> n7
n8 -- validFrom --> n10
n8 -- issuer --> n9
n8 -- subject --> n11
n11 -- AlumniOf --> n12
n2 --> 7
n1 --> 5
n18 -- type --> n19
n18 -- created --> n20
n18 -- proofValue --> n21
n18 -- verificationMethod --> n22
class n1,n4,n7,n8,n9,n10,n13,n14,n15,n16,n17 RedNode;
class n2,n5,n11,n12 YellowNode;
class n3,n6,n18,n19,n20,n21,n22 GreenNode;
classDef RedNode text-align: center, color:#000, fill:#DDAABB, stroke:#000, stroke-width:1px;
classDef YellowNode color:#000, fill:#FFEE99, stroke:#000, stroke-width:1px;
classDef GreenNode color:#000, fill:#BBDDAA, stroke:#000, stroke-width:1px;
|
Related PR is the digital bazaar tooling which is powering the current examples rendered in the spec... w3c/respec-vc#8 |
The issue was discussed in a meeting on 2023-06-28
View the transcript2.10. Add VC-JWT diagrams to core specification (issue vc-data-model#1135)See github issue vc-data-model#1135. Brent Zundel: #1135 - Add VC JWT diagrams to core specification.
Brent Zundel: as diagrams are non-normative this is a post-CR. Orie Steele: related to date integrity proofs in the core context and need to be understood by implementers. The pictures are one of the most important information we offer.
Orie Steele: prefer to see the diagrams upgraded include proof specs that define securing mechanisms.
Brent Zundel: w3c/vc-data-integrity#107.
Brent Zundel: PRs are welcomed! (Manu encouraged that).
Brent Zundel: if anyone has a problem raising a PR ask for help of Brent or anyone to learn how. Michael Jones: reinforced Orie's comment about stuff that should be in the securing spec.
|
I have created an alternative diagram for the simple case (based on the sketches of @OR13 above); it is in the https://raw.githubusercontent.com/w3c/vc-data-model/create-jwt-diagram/diagrams/vc-jwt.svg But it is also reproduced below. My goals were to make it as close to the existing diagram in the spec, meaning it reuses exactly the same graph for the credential graph itself (not only content-wise but also visually; I just made a copy/paste using the same drawing program). This also means that the diagram is also "dark-mode-safe". I made it also a bit simpler then what is in #1135 (comment), and I also tried to make it "narrow" so that it would fit into the spec area. I am not sure it is worth adding the (DI) proof into the diagram (as on #1135 (comment)), I would think it just muddles the information at that point. I am happy
However, before getting into a PR, I wanted to see if the direction is acceptable... cc @OR13 @msporny @decentralgabe (@decentralgabe, I made you a promise in #1326 (comment) to do this...) |
Thanks! This looks excellent, I would remove iss from the header and make kid an absolute URL. |
This is awesome work @iherman. Greatly appreciate you taking the time and effort to do this. It looks really good. |
I have updated the vc-jwt example, and I have also created a vp-jwt one, see below. Specific questions:
Specific questions to @msporny as the "main" editor: should I simply add the new diagram, preceded with an explanation text, after Figure 6 (resp. Figure 8)? I was wondering whether it is possible to do the same trick as in, for example, Example 5, but I see that this is done via a JS script, and it is not 100% how I would put this into the spec for figures (and whether it is a good idea). I also cc this to @TallTed explicitly, who always locates the possible problems in these things... :-). Would appreciate your remarks, Ted. Here are the two diagrams as they look now: |
The pressure's on! Overall, I really like these. In no particular order ...
If any of the above disagrees with the current body text, I think that text is in error and needs re-review. |
😀
I see what you mean and I agree. However, if you agree, I would prefer to postpone these changes into a separate future (strictly editorial) PR. The reason is that these changes should then be made on Figures 6 and 8 of the current spec, because it is important to keep consistency. Indeed, one of the important parts of the message is that the same VC graph can be either secured through DI (which is on Figure 6) and with JWT (which is the first of the two new diagrams). I will take care of these later, I promise!
Hm. I leave that to the JWT experts (which I am not!). If I understand you well, you say the header part should say:
This is indeed in line with some other text (like the JWT Handbook which I just checked), but I took the model of these diagrams from #1135 (comment). I need clear directions on this. @OR13?
Damn. I changed that for
Hm. My understanding on using JWT with VP-s is that we take all the VP material, remove the proofs, and turn it into a payload. This is what I have done. What is exactly wrong with this in your view? |
I would ommit typ for now, it's considered a best practice to include it, but there is no consensus on what it should be for multiple suffixes. There is a PR up that removes all the typ related media types from vc-jose-cose. My preference for diagrams is to always show the minimal legal structure first, and then possibly show a detailed example filled with optionality. I do not think that the core data model is the right place for diagrams related to securing speciations. |
I agree. Just to avoid unnecessary rounds, this means that the header part would include:
Is that correct? What about the usage of JWT vs. JWS in the (informal) label on the upper left-hand corner? |
OK for JWT. My knowledge about the COSE version converges to zero 😀. But is it fundamentally different than the JWT case? Because if the difference is only encoding, then I would think it is enough to mention it in the accompanying text (and maybe add diagrams into the JOSE-COSE document). WDYT? |
I think it's probably ok to leave COSE examples in the securing spec. I would prefer all securing diagrams be placed in securing specs. |
Do you mean that you would prefer to remove the current Figures 6 and 8, too? If so, I respectfully disagree. That whole section is an introductory section giving a high level overview of what is happening in credentials, and that should also include something on securing (which is also present elsewhere in the spec). Adding the new diagrams sounds essential to me to separate the external and embedded securing mechanisms on the same level. |
I think high level diagrams and diagrams covering the RDF data model are fine, but I continue to object to the core data model including securing specific diagrams and content. I think it's bad architecture, and leads to harmful security assumptions. Understanding claims and securing them should be separated unless there is only one way to secure them. Specifications that take dependency on the core data model, such as C2PA... Have to explain that they only use the data model, not data integrity proofs... This supports the position that blending the two together is harmful enough to cause dependent specifications to write extra text. Also, proof is defined twice, once as a general purpose securing mechanism, and once in the context of the core data model... That's confusing for readers. |
-1, the specification is about creating verifiable credentials, not just credentials by themselves. There are multiple ways to make the core data model verifiable, and the WG has explicitly defined what some of those mechanisms are and it's appropriate to talk about those things in the specification (and point to / defer to the securing specifications for more details). In addition, |
@OR13 I have the impression that you are raising issues that are not part of the current discussion in this issue. Or would you object putting the diagrams that I created into the VCDM spec? I must admit I am not sure what we are discussing here. |
PR #1404 has been raised. This issue should be closed if and when that PR gets merged. |
#1404 has just been merged, closing. |
@OR13 suggested that VC-JWT diagrams should be added to the core specification. I'm assigning the VC-JWT Editors to do that given that they are the experts on the matter.
The tooling used to generate the diagrams in the specification was Google Draw. Post processing was done in Inkscape with an export optimized SVG. Further editing was made on the SVG to make them accessible by Chaals, and then further refinement on text placement was done by hand editing the SVG.
The text was updated successfully, but these errors were encountered: