w3c-ccg / vp-request-spec

Specification for a query language to request Verifiable Presentations from wallets etc.
https://w3c-ccg.github.io/vp-request-spec/
Other
9 stars 3 forks source link

Add support for QueryByFrame to allow support of requests with JSON-LD Frames #8

Closed kdenhartog closed 2 months ago

kdenhartog commented 3 years ago

This query type is being designed with JSON-LD BBS+ Signatures in mind where we want to be able to use a JSON-LD frame to request specific attributes in a query which is provided in the form of a JSON-LD frame.

An example of this query type would look like the following:

{
   "query":[
      {
         "type":"QueryByFrame",
         "credentialQuery":[
            {
               "reason":"Please provide your Passport details.",
               "frame":{
                  "@context":[
                     "https://www.w3.org/2018/credentials/v1",
                     "https://schema.org",
                     "https://w3c-ccg.github.io/ldp-bbs2020/context/v1"
                  ],
                  "type":[
                     "VerifiableCredential",
                     "PassportCredential"
                  ],
                  "credentialSubject":{
                     "@explicit":true,
                     "givenName":{ },
                     "birthDate":{ }
                  }
               },
               "trustedIssuer":[
                  {
                     "issuer":"did:key:zUC7FLNC876WXsNTYP5FaWssvNWpiB5unYwVEXuZgcWCWzUHUCamoVwD7q3MSM84JqEANV5RnjzXsfLx77b4vCV3uEBQbaob1dYk2NtUGhguY7JP64BmvWCfNJ1h9wUgaZtLMNN",
                     "required":true
                  }
               ],
               "required":true
            }
         ]
      }
   ]
}

Are there any sorts of other considerations that we should take into account when adding this query type @dlongley @msporny @dmitrizagidulin ?

llorllale commented 3 years ago

@kdenhartog Looks like a good start.

I'm not an expert on JSONLD. Is there a way to translate the frame back into JSONLD credential field definitions in order to properly inform the user what is being requested of them?

kdenhartog commented 3 years ago

I'm not sure what you mean by "JSONLD credential field definitions". Could you provide an example of what you're trying to accomplish?

llorllale commented 3 years ago

@kdenhartog I don't have an example on hand but what I mean is for the agent software to inform the user of the individual pieces of data being requested, as opposed to just the entire credential. So instead of just informing the user "this Verifier would like you to disclose your driving license" the software could instead display "this Verifier would like you to disclose the date of birth from your driving license".

kdenhartog commented 3 years ago

That sounds a bit like a concern for a UI/UX layer, so I'm a bit confused still what changes you're asking for at this layer here. Seems like everything you'd need at this layer for can be found in the frame, so I'm not sure what more needs to be included.

troyronda commented 3 years ago

@kdenhartog Is there an update on this item - are you planning a PR to the spec?

kdenhartog commented 3 years ago

Yeah I'll get to making a PR on this eventually. I'm caught up at the moment so won't get around to it right away. We've begun implementing this already and there's definitely some edge cases that need to be speced out, but in general it works.

sudeshrshetty commented 3 years ago

@kdenhartog correct me if my understanding is wrong. You are adding frame object to existing QueryByExample structure so that given frame can be applied on credential search result for selective disclosure. QueryByExample + frame --> QueryByFrame

kdenhartog commented 3 years ago

Yup that's basically it 👍 Sounds like you guys figured it out. The edge cases we've ran into are basically what happens when you provide bad frames. For example, if the bbs context isn't included the proof gets dropped.

kdenhartog commented 3 years ago

Noting here for later when I define this. We should align the trustedIssuer field on QueryByExample and QueryByFrame so that they are both defined within the CredentialQuery object rather than today where QueryByExample defines it within the example object.

msporny commented 2 months ago

The group discussed this on the 2024-07-30 telecon:

The latest vc-di-bbs specification does not use query by frame, nor do any of the latest queries use query by frame (JSON Pointers are used instead). Query By Example is used to generate JSON Pointers which are then used for selective disclosure (and it is expected that this pattern is broadly useful/used for other selective disclosure and unlinkable disclosure use cases).

This issue has been overtaken by events, closing.