-
Notifications
You must be signed in to change notification settings - Fork 112
Limit JSON-LD optionality to enhance developer experience #948
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
Comments
To refine the set of concrete proposals from #929, here is a cut at some reasoning with concrete proposals that might help: At present, the developer experience with Verifiable Credentials could be improved because:
Given these concerns above, perhaps we can consider the following:
Some concrete proposals that we could put in front of the group are: PROPOSAL: Verifiable Credentials that utilize PROPOSAL: Verifiable Credentials that utilize PROPOSAL: Verifiable Credentials that utilize And the proposals to help make development easier for developers coming from a JSON background: PROPOSAL: As an initial iteration on the idea, the Verifiable Credentials specification will define an "developer-mode" JSON-LD Context ( PROPOSAL: A conforming processor SHOULD raise an error if a VC that utilizes |
In order to understand the implications of the above, we have 3 cases to consider
Are the implications as follows?
|
@David-Chadwick wrote:
That is not what this issue is about. The discussion on NOT using However, on the topic of using full URLs everywhere -- no, we shouldn't do that, because that leads to non-idiomatic JSON (which we're trying to avoid). We want to promote the use of idiomatic JSON as much as possible, and the following is probably not going to go over very well with JSON developers: {
"id": "http://example.edu/credentials/3732",
"type": [
"VerifiableCredential",
"https://example.org/examples#UniversityDegreeCredential"
],
"credentialSubject": [{
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21"
"https://example.org/examples#degree": [{
"http://schema.org/name": [{
"type": "http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",
"value": "Bachelor of Science and Arts"
}],
"type": ["https://example.org/examples#BachelorDegree"]
}],
}
],
}
No, for the same reason as the example above demonstrates. During development, per these set of proposals, you can do this: {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/developer-mode/v1"
],
... That's it... you have well formed JSON /and/ JSON-LD, though the semantics are all undefined. Developers can play around w/ their credential until they feel they've got it right. At some point, when they go to production, they need to define an To put it another way, if you don't want global semantics, you don't need to use VCs... just shove your data into a plain JSON JWT and you're done.
Sure, but this class of developers are not our concern. This class of developers are already happy using Verifiable Credentials as-is and we don't require any changes for them. What's being proposed is the following (note, this is a bog standard example from the VC Data Model spec). You don't need to use full URLs everywhere, nor do you need to use a JSON-LD processor to execute business logic based on data in the VC. We should make it more clear in the spec what you have to be sure of as a JSON-only developer (as discussed in #929) -- either make sure you're using some market-vertical standard JSON-LD Contexts OR vet them yourself to make sure they use {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/examples/v1"
],
"id": "http://example.edu/credentials/3732",
"type": ["VerifiableCredential", "UniversityDegreeCredential"],
"issuer": "https://example.edu/issuers/565049",
"issuanceDate": "2010-01-01T00:00:00Z",
"credentialSubject": {
"id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
"degree": {
"type": "BachelorDegree",
"name": "Bachelor of Science and Arts"
}
}
} Does that help refine the idea, @David-Chadwick ? |
@msporny I take your answer to the case 1 developers to be "if you dont want to use |
hm @msporny I'm not sure making it more restrictive answers the concerns I would have as a new developer. I may be missing large chunks of "context" here but my take woudl be that having a few standard templates (think If these defaults become widely used you could formalize them but it seems to me the thing needed first before making rules is to try out some default templates and see what devs do with them? Am I missing something? For me as a relatively new vc dev, this discussion so far doesn't seem clarifying but adds new confusion - oh, this thing that's documented, but I can't do it? |
I'm a -1 to "developer contexts".... thats what community groups are for. I'm also a -1 to requiring specific URLs, because it sets a precedent that is counter to developer expectations with respect to inlining and conversion to RDF without the need to either:
|
The issue was discussed in a meeting on 2022-10-19
View the transcript3.1. followup of the TPAC discussion on JSON/JSON-LD.Manu Sporny: original issue has come from TPAC, but it seemed as if there were two separate issues.. See github issue vc-data-model#947. Manu Sporny: first one requests @context to be optional. See github issue vc-data-model#948. Manu Sporny: so that a JSON only developer wont need to worry about JSON-LD processing.
Manu Sporny: intention is that you wont need a JSON-LD processor to use @context. Brent Zundel: folks should read the original issue for background and good information. |
(Adding a comment so that I'm notified of discussion on this issue) |
I'm against adding anything over and above JWT processing, so a big -1 to this approach |
I don't think this should be a "developer context", but rather one that clearly signals that you are opting into using undefined / ambiguous terms. We can come up with some name for it that is amenable to all. I'm in agreement that we should help developers by having a context that defines an "undefined terms" So, +1 to helping developers who want to opt-in to using a standard "undefined terms" |
I have to say that this doesn't make any sense to me. JWT is already a standard, so I would expect someone to just go use JWT if that's exactly what they want -- rather than trying to make VCs become the same thing with a different name. |
A bit of history might help. X.500 defined the schema for directory entries, so that every entry was well formed and software could check that the attributes that were present in an entry were allowed to be present. But developers (and administrators) got frustrated that they had to be continually changing the schema when they wanted to add a new attribute to a directory entry. So the unregistered object class was born. (see https://sec.cs.kent.ac.uk/x500book/Chapter.3/Chapter3c.htm). It seems that from a pragmatic perspective, some folks want the equivalent unregistered |
Yes, and this is a good reason to separate this feature into its own context so that people can opt into using it rather than making it in core -- where everyone has to use it. I think it's a good compromise for this group to specify that context (and its URL) so that everyone who chooses that approach does it the same way and it's easily detectable. |
@nadalin @Sakurann @selfissued, @OR13, @mprorock, @gvelez17 -- what about something like this?
or this (@mprorock):
That's all you'd need to include for a VC-JWT, nothing else, to use JSON-only mode. That would still be compatible w/ JSON-LD, but you wouldn't have to process it. It's an opt-in feature. Not saying it's perfect, but is it something you could live with? It would mean you wouldn't have to define any new JSON-LD Context. |
@manu as long as it is still OPTIONAL and only meant to be compatible w/JSON-LD |
Im +1 for having a special context for opting in out on the JSON-LD. But I also feel that we should really have a clear message to the verifiers that this is not in global context, so handle the VC with care. I hope these two issues will align on something: #953 |
The issue was discussed in a meeting on 2023-01-11
View the transcript3.5. Limit JSON-LD optionality to enhance developer experience (issue vc-data-model#948)See github issue vc-data-model#948. Brent Zundel: Next issue is 948. Limit JSON-LD to enhance developer experience.. Manu Sporny: There are other things we can do..
|
To review where we are on this issue:
This effectively happens by default, now that there is a base
This effectively happens for the vast majority of use cases, now that there is a base
This effectively happens by default, now that there is a base
This is unlikely to happen given where the WG is currently, but JSON-LD processors are exploring the ability to raise warnings/errors when
PR #1050 has been raised to address this issue. Given everything above, and given that |
PR #1050 has been merged, closing. |
It has been suggested that there could be limits imposed on the use of JSON-LD for Verifiable Credentials that would enhance the developer experience. These changes would be normative changes to the current specification. This issue has been raised to discuss if this is a good idea and the mechanism(s) that could be used to accomplish the task.
The text was updated successfully, but these errors were encountered: