owned this note
owned this note
Published
Linked with GitHub
# DIF PE - ACA-Py Status
* Supported in 0.7.0 release
* [RFC 0510](https://github.com/hyperledger/aries-rfcs/tree/master/features/0510-dif-pres-exch-attach)
**PE Spec Overview**
* Verifier specifies the requirement within `presentation_definition` which includes list of `input_descriptors` with `constraints` to describe credentials for the proof.
* `input_descriptors.schema.uri` - Can contain schema URI such as `https://bank-schemas.org/1.0.0/accounts.json` or `JSON-LD expanded_type` such as `https://w3id.org/citizenship#PermanentResidentCard`
```
{
"id": "32f54163-7166-48f1-93d8-ff217bdb0654",
"input_descriptors": [
{
"id": "pr_input_1",
"schema": [
{
"uri": "https://www.w3.org/2018/credentials#VerifiableCredential"
},
{
"uri":"https://w3id.org/citizenship#PermanentResidentCard"
}
],
"constraints": {
"limit_disclosure": "required",
"fields": [
{
"path": [
"$.credentialSubject.givenName"
],
"filter": {
"type": "string",
"enum": [
"JOHN",
"CAI"
]
}
}
]
}
}
]
}
```
* format can be used to specify `claim_formats` that the verifier can process
```
"format": {
"ldp_vp": {
"proof_type": ["BbsBlsSignature2020"]
}
},
```
**ACA-Py Workflow**
* Holder's Credential
```
{
"contexts": [
"https://w3id.org/citizenship/v1",
"https://w3id.org/security/bbs/v1",
"https://www.w3.org/2018/credentials/v1"
],
"expanded_types": [
"https://w3id.org/citizenship#PermanentResidentCard",
"https://www.w3.org/2018/credentials#VerifiableCredential"
],
"schema_ids": [],
"issuer_id": "did:key:zUC759BfTbM6Qm78GJ9Tw1UzRKvHZMx1NcG82MT9ri3Sm8iVEm6WQy2hhab3AyrABat87bVsfxrb4oBzp7SKxXABYT4mpd3E5YEgopoeA4MzApcodgbHCAxYQWca57ArUuZ78K8",
"subject_ids": [
"did:key:zUC76jfaQNda3SCSnTgTUDure4a7jCzTnN4NLo7QfUGFTA3JcHE6rutaco2o2hdT3SoNp1ANSTL9Z3MYen6jwcjSod4RsziHf3fV1LPdy74MoCEgeP8VFCV9ntwVkrtvFQo66sD"
],
"proof_types": [
"BbsBlsSignature2020"
],
"cred_value": {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/citizenship/v1",
"https://w3id.org/security/bbs/v1"
],
"id": "https://issuer.oidp.uscis.gov/credentials/83627469",
"type": [
"VerifiableCredential",
"PermanentResidentCard"
],
"issuer": "did:key:zUC759BfTbM6Qm78GJ9Tw1UzRKvHZMx1NcG82MT9ri3Sm8iVEm6WQy2hhab3AyrABat87bVsfxrb4oBzp7SKxXABYT4mpd3E5YEgopoeA4MzApcodgbHCAxYQWca57ArUuZ78K8",
"issuanceDate": "2010-01-01T19:53:24Z",
"expirationDate": "2029-12-03T12:19:52Z",
"credentialSubject": {
"id": "did:key:zUC76jfaQNda3SCSnTgTUDure4a7jCzTnN4NLo7QfUGFTA3JcHE6rutaco2o2hdT3SoNp1ANSTL9Z3MYen6jwcjSod4RsziHf3fV1LPdy74MoCEgeP8VFCV9ntwVkrtvFQo66sD",
"type": [
"PermanentResident",
"Person"
],
"givenName": "JOHN",
"familyName": "SMITH",
"gender": "Male",
"image": "data:image/png;base64,iVBORw0KGgokJggg==",
"residentSince": "2015-01-01",
"lprCategory": "C09",
"lprNumber": "999-999-999",
"commuterClassification": "C1",
"birthCountry": "Bahamas",
"birthDate": "1958-07-17"
},
"proof": {
"type": "BbsBlsSignature2020",
"proofPurpose": "assertionMethod",
"verificationMethod": "did:key:zUC759BfTbM6Qm78GJ9Tw1UzRKvHZMx1NcG82MT9ri3Sm8iVEm6WQy2hhab3AyrABat87bVsfxrb4oBzp7SKxXABYT4mpd3E5YEgopoeA4MzApcodgbHCAxYQWca57ArUuZ78K8#zUC759BfTbM6Qm78GJ9Tw1UzRKvHZMx1NcG82MT9ri3Sm8iVEm6WQy2hhab3AyrABat87bVsfxrb4oBzp7SKxXABYT4mpd3E5YEgopoeA4MzApcodgbHCAxYQWca57ArUuZ78K8",
"created": "2021-06-23T17:23:58.714749",
"proofValue": "iIhvXQIcjbngimSAbkcxvGrtbNNM2ZAYc7ii9o5taral792pA6QS9QNEEPGVsdM5NWBDogZ1YQzYQ0bMePfZMOAmeQgjxC43mUMTTTqhb9dvj2z22NEdpftI9yteHGnhlXKdYJipT3NcbBnRzjyziQ=="
},
"identifier": "83627465",
"description": "Government of Example Permanent Resident Card.",
"name": "Permanent Resident Card"
},
"given_id": "https://issuer.oidp.uscis.gov/credentials/83627469",
"cred_tags": {},
"record_id": "c8ebdb76a7464c928683de3d4fe52602"
}
```
* Verifier sends request - `/present-proof-2.0/send-request`
```
{
"comment": "string",
"connection_id": "d2e37cb4-312f-4f43-8883-795d9844ecf9",
"presentation_request": {
"dif": {
"options": {
"challenge": "3fa85f64-5717-4562-b3fc-2c963f66afa7",
"domain": "4jt78h47fh47"
},
"presentation_definition": {
"id": "32f54163-7166-48f1-93d8-ff217bdb0654",
"input_descriptors": [
{
"id": "pr_input_1",
"schema": [
{
"uri": "https://www.w3.org/2018/credentials#VerifiableCredential"
},
{
"uri":"https://w3id.org/citizenship#PermanentResidentCard"
}
],
"constraints": {
"limit_disclosure": "required",
"fields": [
{
"path": [
"$.credentialSubject.givenName"
],
"filter": {
"type": "string",
"enum": [
"JOHN",
"CAI"
]
}
}, {
"path": [
"$.credentialSubject.familyName"
]
}
]
}
}
]
}
}
}
}
```
* Holder can look up which credentials apply to the `presentation_request` - `/present-proof-2.0/records/{pres_ex_id}/credentials`
`/credentials/w3c` can be used to access all stored w3c credentials
This info can be used to further filter which credentials should be applied when processing an `input_descriptor`.
```
[
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/citizenship/v1",
"https://w3id.org/security/bbs/v1"
],
"id": "https://issuer.oidp.uscis.gov/credentials/83627469",
"type": [
"VerifiableCredential",
"PermanentResidentCard"
],
"issuer": "did:key:zUC759BfTbM6Qm78GJ9Tw1UzRKvHZMx1NcG82MT9ri3Sm8iVEm6WQy2hhab3AyrABat87bVsfxrb4oBzp7SKxXABYT4mpd3E5YEgopoeA4MzApcodgbHCAxYQWca57ArUuZ78K8",
"issuanceDate": "2010-01-01T19:53:24Z",
"expirationDate": "2029-12-03T12:19:52Z",
"credentialSubject": {
"id": "did:key:zUC76jfaQNda3SCSnTgTUDure4a7jCzTnN4NLo7QfUGFTA3JcHE6rutaco2o2hdT3SoNp1ANSTL9Z3MYen6jwcjSod4RsziHf3fV1LPdy74MoCEgeP8VFCV9ntwVkrtvFQo66sD",
"type": [
"PermanentResident",
"Person"
],
"givenName": "JOHN",
"familyName": "SMITH",
"gender": "Male",
"image": "data:image/png;base64,iVBORw0KGgokJggg==",
"residentSince": "2015-01-01",
"lprCategory": "C09",
"lprNumber": "999-999-999",
"commuterClassification": "C1",
"birthCountry": "Bahamas",
"birthDate": "1958-07-17"
},
"proof": {
"type": "BbsBlsSignature2020",
"proofPurpose": "assertionMethod",
"verificationMethod": "did:key:zUC759BfTbM6Qm78GJ9Tw1UzRKvHZMx1NcG82MT9ri3Sm8iVEm6WQy2hhab3AyrABat87bVsfxrb4oBzp7SKxXABYT4mpd3E5YEgopoeA4MzApcodgbHCAxYQWca57ArUuZ78K8#zUC759BfTbM6Qm78GJ9Tw1UzRKvHZMx1NcG82MT9ri3Sm8iVEm6WQy2hhab3AyrABat87bVsfxrb4oBzp7SKxXABYT4mpd3E5YEgopoeA4MzApcodgbHCAxYQWca57ArUuZ78K8",
"created": "2021-06-23T17:23:58.714749",
"proofValue": "iIhvXQIcjbngimSAbkcxvGrtbNNM2ZAYc7ii9o5taral792pA6QS9QNEEPGVsdM5NWBDogZ1YQzYQ0bMePfZMOAmeQgjxC43mUMTTTqhb9dvj2z22NEdpftI9yteHGnhlXKdYJipT3NcbBnRzjyziQ=="
},
"identifier": "83627465",
"description": "Government of Example Permanent Resident Card.",
"name": "Permanent Resident Card",
"record_id": "c8ebdb76a7464c928683de3d4fe52602"
}
]
```
* `/present-proof-2.0/records/{pres_ex_id}/send-presentation`
Filtering mentioned above can be done by mapping which `record_id` should be applied for a `descriptor_id`
```
{
"dif": {
"record_ids": {
"<input descriptor id_1>": [
"<record id_1>",
"<record id_2>"
],
"<input descriptor id_2>": [
"<record id>"
]
}
}
}
```
To process the `presentation_request` as it is
```
{
"dif": {
}
}
```
* Presentation received
```
{
...,
"pres": {
"dif": {
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/security/bbs/v1"
],
"type": [
"VerifiablePresentation"
],
"verifiableCredential": [
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://w3id.org/citizenship/v1",
"https://w3id.org/security/bbs/v1"
],
"id": "https://issuer.oidp.uscis.gov/credentials/83627469",
"type": [
"PermanentResidentCard",
"VerifiableCredential"
],
"credentialSubject": {
"id": "did:key:zUC76jfaQNda3SCSnTgTUDure4a7jCzTnN4NLo7QfUGFTA3JcHE6rutaco2o2hdT3SoNp1ANSTL9Z3MYen6jwcjSod4RsziHf3fV1LPdy74MoCEgeP8VFCV9ntwVkrtvFQo66sD",
"type": [
"Person",
"PermanentResident"
],
"familyName": "SMITH",
"givenName": "JOHN"
},
"issuanceDate": "2010-01-01T19:53:24Z",
"issuer": "did:key:zUC759BfTbM6Qm78GJ9Tw1UzRKvHZMx1NcG82MT9ri3Sm8iVEm6WQy2hhab3AyrABat87bVsfxrb4oBzp7SKxXABYT4mpd3E5YEgopoeA4MzApcodgbHCAxYQWca57ArUuZ78K8",
"proof": {
"type": "BbsBlsSignatureProof2020",
"nonce": "3E98dW4wvDtZawXmW9K1xMyaEYPhpwGsk1GYGcf4naTo8CZugu013CvFbFZI13/WigY=",
"proofValue": "ABkBuAavqYfjCCtQQEm57OXixnTBcDTDMdnuP1qnbCNoCBab/Y5Z9VLlZJR9viT5kkEpUAj0jaxu5MdtE3h3ROg77GLQPIQuHirteAHQjUpDo76t4L95IZujd6rBHUwaIAkn3myGp2i15rzlEZanvT13WoLAjjlQrMxpJpnplCqGRpRkaVKH8Wof9j2US8+sf2Pf+2pUAAAAdKhoFW89yj1LxvC7dlj9dXlgB6yelnRVxSmVw3z8fGGioRy8kcFYEEpiWeazTZGPLQAAAAJCbgPHfq9hsHtoQXxjJ+wu737tZP3GkNp9VxQwcyfjK3I6BLAfXNxbGSfixtsVZHu6+ERbR163dP3Mpbop687YuS8Sb1DD3YmERbHN/qChrqveFzpKHwyu7yHn0/g3H/3scc/0i4/U28A4b51WRJnnAAAADk/spWtDyLKmFDjpyP8vNiVlsAPCiFWTrYCwylr1C+YKBw+jSyajfGoxr8TIWWWuDDI5pu/UMNqbFpxXruvn2oxdcoF6kQrxETlyaC1H1ycVcOsXAHZpe9FHJVeLpj1+YEmfmWoihgcOan1YwjfbkBn0heDdz6HR4IcViYx0+9DDMnd2RLNJRPuvDNR2XLHYJhMEG6MzZ1v1PRglRUOpZfkdPa3dqNpilyROzBOKDZ1wOzL30Ut4/A8Tswl+APiH7WaK7cH19sVP78L3onrXXVmxoH+JO2wpTlo0m6zdjPPGHGQ89x/7EIHdZVQM5ZedF3s4FHrWIN3Ndbnt0mAJ45EnxfFr5lNDOTqwlydHBeBwcRg2gKQkTHjzVt2/3aKomlDpb98jtT75gFiu0BaYFuQybyaO2ijd2LwsAjyeZ4HrGLgougqEbHd5XPCy9riICWc2ZklZXFvUMemUwJDRiapjDkAq01ZIuDcRRREuphGmHNdKsGKu+KHRg4idaI3ODlw3PWjGkl26eU9d15otDYJVDrowFpwWe5dwiuZjgRJiaegxluc5gmp9LmVsI22XPrq7z8uHDlCUk3CYgJWxDX8=",
"verificationMethod": "did:key:zUC759BfTbM6Qm78GJ9Tw1UzRKvHZMx1NcG82MT9ri3Sm8iVEm6WQy2hhab3AyrABat87bVsfxrb4oBzp7SKxXABYT4mpd3E5YEgopoeA4MzApcodgbHCAxYQWca57ArUuZ78K8#zUC759BfTbM6Qm78GJ9Tw1UzRKvHZMx1NcG82MT9ri3Sm8iVEm6WQy2hhab3AyrABat87bVsfxrb4oBzp7SKxXABYT4mpd3E5YEgopoeA4MzApcodgbHCAxYQWca57ArUuZ78K8",
"proofPurpose": "assertionMethod",
"created": "2021-06-23T17:23:58.714749"
}
}
],
"presentation_submission": {
"id": "3ac08da7-0503-4220-8daa-400411e1f761",
"definition_id": "32f54163-7166-48f1-93d8-ff217bdb0654",
"descriptor_map": [
{
"id": "pr_input_1",
"format": "ldp_vp",
"path": "$.verifiableCredential[0]"
}
]
},
"proof": {
"type": "BbsBlsSignature2020",
"verificationMethod": "did:key:zUC76jfaQNda3SCSnTgTUDure4a7jCzTnN4NLo7QfUGFTA3JcHE6rutaco2o2hdT3SoNp1ANSTL9Z3MYen6jwcjSod4RsziHf3fV1LPdy74MoCEgeP8VFCV9ntwVkrtvFQo66sD#zUC76jfaQNda3SCSnTgTUDure4a7jCzTnN4NLo7QfUGFTA3JcHE6rutaco2o2hdT3SoNp1ANSTL9Z3MYen6jwcjSod4RsziHf3fV1LPdy74MoCEgeP8VFCV9ntwVkrtvFQo66sD",
"created": "2021-06-23T17:35:49.629420",
"proofPurpose": "authentication",
"challenge": "3fa85f64-5717-4562-b3fc-2c963f66afa7",
"proofValue": "lvZQLNmmnTHRa4B6KP3OeBrwHSfJuHc3hjdCVoh5hfarSgJEd3cBdB+MKnGnpsTpbVq/cTGHn7mMDUFkY7xqmbKCVhAvn/kj3t5XBrn8dJRnQ1uhw80Fo/uu/vSacCS1JPwKGJjjEby9A36Yk3wIKw=="
}
}
}
},
"verified": "True",
...
}
```
**What all is supported**
* `submission_requirements`
* `from` and `from_nested` are supported
* Multiple requirements in `submission_requirements` - All of the requirements must be met
* `from_nested` - either/or
* `"rule": "all"` is supported to ensure all requirements are satisfied
* `"rule": "pick"` with `count`, `min` and `max` properties is supported to ensure number of requirements as specified are satisfied
```
"submission_requirements":[
{
"rule": "pick",
"count": 1,
"from_nested": [
{
"rule": "all",
"from": "A"
},
{
"rule": "pick",
"count": 1,
"from": "B"
}
]
}
],
```
* `filter` operator/properties
* `exclusiveMinimum` - >
* `exclusiveMaximum` - <
* `minimum` - >=
* `maximum` - <=
* `const` - ==
* `not`
* `enum` - in-set
* `limit_disclosure` property within `constraints`, only `BbsBlsSignature2020` credentials are derivable.
* `Ed25519Signature2018` and `BbsBlsSignature2020` proof format on presentations
* Verify received `presentation_submission` against the `presentation_request`. Includes both `filter` check and `limit_disclosure` by evaluating the revealed attrs.
**What is not supported**
* `statuses` property within `constraints`
* `is_holder` property within `constraints`, currently signing all presentations with `credentialSubject.id` [Priority]
* `predicate` property within `fields`
* Processing multi-claim envelope format - no `path_nested` in the `presentation_submission.descriptor_map`
* `JsonWebSignature2020` proof format on presentations