hyperledger / aries-cloudagent-python

Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.
https://wiki.hyperledger.org/display/aries
Apache License 2.0
403 stars 510 forks source link

Proof request specifying value #2064

Closed santidediego closed 1 year ago

santidediego commented 1 year ago

If the holder has different credentials in his wallet with different values for a same attribute, such as: attr1:value, attr1:value2, is there a way for a verifier to create a proof request specifying the value of the requested attribute? so the holder can proof that he has, for example, attr1:value2 without having to manually select the credential he want to use.

I am looking for something in the proof request like:

"requested_attributes": {
        "attr1": {
          "name": "attr1",
          "value": "value2"
          "restrictions": [
           ...
          ]
        },
...

Or, may be it should be done through a predicate?

swcurran commented 1 year ago

You can have a restriction in the form: "attr::degree::value" : "Maths" where degree is the name of the field, and Maths is the value you want to match. ACA-Py requires that the attribute be revealed in the referent that has the restriction, to make sure that the holder does not use a credential that doesn't meet the restriction. "restrictions" are not cryptographic checks -- any restrictions are checked against data in the presentation (e.g. schema_name, schema_id, etc.).