-
I'm submitting a ...
-
Summary
When credentials are selected with PEX.selectFrom, with a presentationDefinition with one pick submission requirement where each input_descriptor in the from group is satisfied by a different credential, selectFrom returns an object with a matches array containing only 1 element with the name of the last input_descriptor, and the vc_path of every credential that matches each input_descriptor (not just the last one), so the name of srm ends up not corresponding to every credential under each vc_path in the srm.
This issue means that, if the first "matching" verifiableCredential is used to submit a presentation, the credential used for submission does not match the requirements of the input_descriptor, so a Could not get evaluation results from presentationResult error is thrown after PEX.evaluatePresentation fails to produce an object with a value property.
I'd expect the matches array returned by selectFrom to contain 1 element per input_descriptor with a match, with each element having the name of the input_descriptor it's describing a match for, and only the vc_path of the credential(s) that match that input_descriptor.
Here's a more thorough explanation of the issue from our perspective:
- A presentation request is made to our digital wallet (which is essentially a Credo holder agent, holding exclusively SD-JWT VCs, where presentation is performed using OID4VP). The presentation definition for this request is as follows:
{
id: `OverAgeCheck`,
purpose: 'Age check',
submission_requirements: [
{
name: 'Proof of age and photo',
rule: 'pick',
count: 1,
from: 'validAgeCheckInputDescriptor'
}
],
input_descriptors: [
{
name: 'ID date of birth and photo',
id: 'IDDoB',
group: ['validAgeCheckInputDescriptor'],
constraints: {
limit_disclosure: 'required',
fields: [
{
path: ['$.vc.type.*', '$.vct', '$.type'],
filter: {
type: 'string',
const: 'ID'
}
},
{
path: ['$.Photo']
},
{
path: ['$.BirthDate']
}
]
}
},
{
name: 'Driving licence date of birth and photo',
id: 'DrivingLicenceDoB',
group: ['validAgeCheckInputDescriptor'],
constraints: {
limit_disclosure: 'required',
fields: [
{
path: ['$.vc.type.*', '$.vct', '$.type'],
filter: {
type: 'string',
const: 'DRIVING_LICENCE'
}
},
{
path: ['$.Driver_Photo']
},
{
path: ['$.Driver_Dob']
}
]
}
}
]
}
Basically, we're trying to verify the age of the wallet holder, and we'll accept relevant data from either an ID credential or a Driving Licence
- The wallet holds an ID, so it can meet the requirements of the
IDDoB input_descriptor, and it also holds a Driving Licence, so it can also meet the requirements of the DrivingLicenceDoB input_descriptor
- However, when the presentation request is resolved, we see that
resolvedPresentationRequest.presentationExchange.credentialsForRequest.requirements[0].submissionEntry array contains one object, with an inputDescriptorId of DrivingLicenceDoB, but a verifiableCredentials array that contains both the ID credential as well as the Driving Licence, which doesn't align with the more specific inputDescriptorID.
- The wallet automatically selects the first entry in the
verifiableCredentials array to use for the submission. If the first entry is the ID credential, and we attempt to call the Credo holder agent's acceptSiopAuthorizationRequest method with it, we get the Could not get evaluation results from presentationResult error from PEX, so the request cannot be accepted, because an ID can't be used to satisfy a DrivingLicenceDoB input.
In the above scenario, submissionEntry.verifiableCredentials is built by:
- Finding the correct
match from the matches array returned by PEX.selectFrom for a given input_descriptor based on said input_descriptor's name, or id if it had no name.
- Finding each matching
verifiableCredential in the verifiableCredential array returned by PEX.selectFrom based on the vc_paths in the match for this input_descriptor
Possibly relevant links to code:
Happy to try and provide more info/apply any changes.
For now, we have a workaround where the wallet always selects the last element in submissionEntry.verifiableCredentials for use in a submission, instead of the first, but this isn't a true solution given the presence of the underlying problem.
@TimoGlastra tagging you after our chat about this this morning
I'm submitting a ...
Summary
When credentials are selected with
PEX.selectFrom, with apresentationDefinitionwith onepicksubmission requirement where eachinput_descriptorin thefromgroup is satisfied by a different credential,selectFromreturns an object with amatchesarray containing only 1 element with the name of the lastinput_descriptor, and thevc_pathof every credential that matches eachinput_descriptor(not just the last one), so thenameofsrmends up not corresponding to every credential under eachvc_pathin thesrm.This issue means that, if the first "matching"
verifiableCredentialis used to submit a presentation, the credential used for submission does not match the requirements of theinput_descriptor, so aCould not get evaluation results from presentationResulterror is thrown afterPEX.evaluatePresentationfails to produce an object with avalueproperty.I'd expect the
matchesarray returned byselectFromto contain 1 element perinput_descriptorwith a match, with each element having thenameof theinput_descriptorit's describing a match for, and only thevc_pathof the credential(s) that match thatinput_descriptor.Here's a more thorough explanation of the issue from our perspective:
Basically, we're trying to verify the age of the wallet holder, and we'll accept relevant data from either an ID credential or a Driving Licence
IDDoBinput_descriptor, and it also holds a Driving Licence, so it can also meet the requirements of theDrivingLicenceDoBinput_descriptorresolvedPresentationRequest.presentationExchange.credentialsForRequest.requirements[0].submissionEntryarray contains one object, with aninputDescriptorIdofDrivingLicenceDoB, but averifiableCredentialsarray that contains both the ID credential as well as the Driving Licence, which doesn't align with the more specificinputDescriptorID.verifiableCredentialsarray to use for the submission. If the first entry is the ID credential, and we attempt to call the Credo holder agent'sacceptSiopAuthorizationRequestmethod with it, we get theCould not get evaluation results from presentationResulterror fromPEX, so the request cannot be accepted, because anIDcan't be used to satisfy aDrivingLicenceDoBinput.In the above scenario,
submissionEntry.verifiableCredentialsis built by:matchfrom thematchesarray returned byPEX.selectFromfor a giveninput_descriptorbased on saidinput_descriptor'sname, oridif it had no name.verifiableCredentialin theverifiableCredentialarray returned byPEX.selectFrombased on thevc_paths in thematchfor thisinput_descriptorPossibly relevant links to code:
Credo->PEX.selectFromduring presentation request resolutionmapMatchingDescriptors, which appears to be where we go from multipleinput_descriptorswith a matching credential for each to onesrmwith the name of 1input_descriptorbut including thevc_paths of all matching credentials for allinput_descriptors, so I think this is where a fix could be applied (but I'm not familiar enough with the codebase to know with any certainty)getSubmissionForInputDescriptor, wheresubmissionEntry.verifiableCredentialsis generated using the results ofPEX.selectFromHappy to try and provide more info/apply any changes.
For now, we have a workaround where the wallet always selects the last element in
submissionEntry.verifiableCredentialsfor use in a submission, instead of the first, but this isn't a true solution given the presence of the underlying problem.@TimoGlastra tagging you after our chat about this this morning