w3c-ccg / vp-request-spec

Specification for a query language to request Verifiable Presentations from wallets etc.

Home Page:https://w3c-ccg.github.io/vp-request-spec/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

kdenhartog opened this issue · comments

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 ?

@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?

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

@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".

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.

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

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.

@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

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.

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.