-
Notifications
You must be signed in to change notification settings - Fork 111
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
Reference and Attachment properties - add a clear way to reference and attach data into credentials #126
Comments
I'm a general -1 to the "catch-all bucket" pattern. It usually an anti-pattern to create predicates that have no clear semantics -- and then to embed the actual semantics within objects in the bucket. It does not adhere to the graph model. This isn't strictly always the case -- and there can be fairly generic categories of relationships that work out, but I think the above is too generic and wouldn't be a step in the right direction. That doesn't mean it isn't a good attempt at trying to tease out how to remedy some issues we have in the data model. To elaborate on the issue with the "bucket" model take a look at, for example, the "purpose" field above. This field is actually defining the relationship between the credential and the referenced object but appears within the object instead of as a link from the credential to the object. From a graph modeling perspective, it should really be a predicate/property/key that relates it to the credential rather than being a one-off property on the reference object itself. What if you want to use a reference object for a different purpose? Who defines what that purpose is? The answer is the entity that establishes the relationship (i.e. the credential here). In a graph model, this is through predicates (the properties/keys in the JSON syntax). Therefore that predicate should define how X has chosen to relate itself to Y. Having this as a general model that one can assume without special contextual rules is powerful. To be more clear, we have this: A credential C with a "reference" to some document D. Why is it referenced? We don't know. We have to look at D to figure that out ... because D defines how it can be related to anything else and it does it with a special property of its own -- which is an inversion of how relationships typically work. Instead, if C has an "evidence" relationship with document D, then we know right away that D is something that was used as evidence to create C. We don't even have to know anything about D yet to understand that. The semantics are clear -- the relationship between C and D is clear. Now -- if we're looking for evidence, we know exactly where to look ... at objects that are related to C via the "evidence" field. This is what an application that would use evidence would want to do and would be looking for -- and it wouldn't need to waste its time with anything else. Another way of looking at this is to take the above modeling change to the extreme. Suppose we just created a single field "data" in a credential (the ultimate "catch-all bucket"). Then we put every object that C is related to into that field. From there, each object could define what its possible relationships are, potentially each in its own special way. This, of course, is a mess in a graph model -- and the reason why the "bucket" approach is usually an anti-pattern. It's better to define strong semantics for the relationships between objects and use those as the keys for referencing things. Usually, when you create a term like "reference" as a predicate, what you're saying is that you don't know the semantics. That means someone who is trying to use your data won't know either. That's a problem. Or, maybe the semantics are just hiding behind some special rules... now they have to know those special rules to unravel the mystery -- and code up every kind of special rule they want to use. That approach creates unnecessary work for developers -- and is a major reason why everyone keeps rewriting the same applications -- just in slightly different ways. To avoid that, one thing you need is an extensible, open data model and some rules that govern it. It takes a little extra work upfront to get it right, which is one reason people don't bother. Another reason some people don't bother is because they don't need wide interoperability, which is fine. But if you do need it, and I argue that we do per our charter, doing that extra bit of work can save endless inefficiency in the longer term. Lastly, I can't emphasize enough that we've taken the approach of modeling our data as a graph. One reason for this is that, if you are careful about doing so, then your data can work with both graph-based systems and tree-based systems. If you only model things as a naive tree, you end up implicitly embedding context at every level of the tree and relationships are not explicitly linked using a general form. This means you cut out the possibility for your data model to be used as-is by graph-based systems (and there are a lot of these... including "the Web"). We can support both here -- so we should be careful not to cut either out. |
Thanks for reply @dlongley Let me provide background for this proposal and my understanding of VC standard. Hopefully it will allow to come to a common understanding and solution. My understanding of VC standard: I understand VC standard as a universal standard to sign data. Background of the proposal: For example:
Requirements:
Solutions:
Comments: My main point/request to the spec is to provide a clear way to reference and attach data into a credential (taking into the account that relationship between credential and referenced data may or may not be clearly defined). IMO, the proposed properties add an universal, standard way to reference, and attach data in credentials. Coincidently they also provide a way to bundle credentials and explain what that bundle means - this allows to drop from the spec, IMO quite confusing and hard to implement notion of Profile. To enhance interoperability we will probably need to agree on properties of attachments referenced as "Evidence", "Terms of Use" etc. |
I don't think it is either of these. It is not a universal way to digitally sign data (this is, for example, left to the Linked Data Signatures work -- or an existing standard such as JOSE if it suits your use case). This work is also not restricted to "small size" credentials, but the scope is restricted to credentials and data directly related to them. I may have more to say about the rest of your comments later -- just getting this quick opinion out there. |
I think each of the requirements you mentioned may need a separate issue (or already has one or something for it in the data model). I'm not convinced there's a general solution to this problem.
I believe we have "evidence" in the data model.
Can you open a separate issue to address these?
As argued above, I think the actual kind of relationship is important, so I don't think saying "this is related" without saying how is a good thing.
This seems to need its own issue (and some of it may be out of scope for this group).
This seems to be a general requirement ... we're using JSON and JSON-LD which are intended to make the credential readable by developers. |
Those issues are closely interwined and I think should be addressed together. I will open separate issues and reference this one to have them understood as being a part of a solution to this issue.
Why not to use proposed "reference", "reference.purpose" and "attachment" properties? Because it mixes graph-based approach with tree-based? It is simple and effective as per my reckoning.
Issue #42 is about how to render Credential, what I am proposing is to have a standard way to hash presentation that user saw during signing and reference it in the credential, or serialize presentation and attach into credential itself. The later is not elegant, but it is bulletproof against loss of data.
This requirement should be understood in the context of all other requirements. Meaning - make possible to reference and attach data in credentials and make it simple to read and understand. |
Created issues #135 and #136 to separate issues with referencing credentials vs. referencing generic data
|
Hi @Drabiv , we'd like to have you join the Working Group so we can more fully consider your suggestions. Please see #135 (comment) for details. |
@burnburn I have applied to become IE to join the group. Thank you! |
I would like to propose to add to the spec the properties Reference and Attachment and remove the notion of Profile, and properties Evidence and Term of Use.
The addition of property Reference will allow to have a universal way to reference anything that is relevant to the credential (e.g. credential's human readable presentation, other credentials, terms of use, evidences etc.) References can be external (pointing outside of credential) or internal (pointing to a node in credential (for example, to Attachment)).
The addition of property Attachment will allow to add into credential anything that might be useful for understanding claim and needs to be available inside credential for security reasons.
Attachment property will allow to drop the confusing notion of Profile making the idea that stands behind Profile (a bundle of credentials) clearer to understand and implement. It is important for many use cases when Profile has multiple subjects or subject is not clear.
The Profile will be replaced by a credential with attached credentials and Evidence and Terms of Use will be replaced by attachments with type "Evidence" and "Terms of Use".
Please, see below the example of a credential with proposed Reference and Attachment properties.
The text was updated successfully, but these errors were encountered: