aries-cloudagent-python icon indicating copy to clipboard operation
aries-cloudagent-python copied to clipboard

Issue during didcomm json-ld credential selection for proof

Open Sshovon opened this issue 7 months ago • 0 comments

I am using acapy v1.2.0 Following is the proof request record.

{
  "state": "request-received",
  "created_at": "2025-05-12T11:41:22.638007Z",
  "updated_at": "2025-05-12T11:41:22.638007Z",
  "trace": false,
  "pres_ex_id": "bde8c6b8-bb40-452b-b7fd-af3f90cdc768",
  "connection_id": "9389c210-c5f7-4c2b-a1c3-2c6aacdadab9",
  "thread_id": "ba4e86de-a024-4e1b-92a6-0012bdd2463a",
  "initiator": "external",
  "role": "prover",
  "pres_request": {
    "@type": "https://didcomm.org/present-proof/2.0/request-presentation",
    "@id": "ba4e86de-a024-4e1b-92a6-0012bdd2463a",
    "will_confirm": true,
    "formats": [
      {
        "attach_id": "dif",
        "format": "dif/presentation-exchange/[email protected]"
      }
    ],
    "request_presentations~attach": [
      {
        "@id": "dif",
        "mime-type": "application/json",
        "data": {
          "json": {
            "options": {
              "challenge": "a7f638f8-4236-4c46-817a-c5de0a5462aa",
              "domain": "OEP9OxTUfDbK"
            },
            "presentation_definition": {
              "id": "1b5164ad-b265-40d9-ade0-b3fd1e3ebfa8",
              "name": "age-proof",
              "purpose": "age verification",
              "format": {
                "ldp_vp": {
                  "proof_type": "Ed25519Signature2018"
                }
              },
              "input_descriptors": [
                {
                  "id": "126e4696-0d77-4f6a-b29b-54824393522f",
                  "name": "age-proof",
                  "schema": {
                    "oneof_filter": [
                      [
                        {
                          "uri": "https://www.w3.org/2018/credentials#VerifiableCredential"
                        }
                      ]
                    ]
                  },
                  "constraints": {
                    "fields": [
                      {
                        "path": [
                          "$.credentialSubject.name"
                        ],
                        "purpose": "age verification"
                      },
                      {
                        "path": [
                          "$.credentialSubject.age"
                        ],
                        "purpose": "age verification"
                      }
                    ]
                  }
                }
              ]
            }
          }
        }
      }
    ]
  },
  "by_format": {
    "pres_request": {
      "dif": {
        "options": {
          "challenge": "a7f638f8-4236-4c46-817a-c5de0a5462aa",
          "domain": "OEP9OxTUfDbK"
        },
        "presentation_definition": {
          "id": "1b5164ad-b265-40d9-ade0-b3fd1e3ebfa8",
          "name": "age-proof",
          "purpose": "age verification",
          "format": {
            "ldp_vp": {
              "proof_type": "Ed25519Signature2018"
            }
          },
          "input_descriptors": [
            {
              "id": "126e4696-0d77-4f6a-b29b-54824393522f",
              "name": "age-proof",
              "schema": {
                "oneof_filter": [
                  [
                    {
                      "uri": "https://www.w3.org/2018/credentials#VerifiableCredential"
                    }
                  ]
                ]
              },
              "constraints": {
                "fields": [
                  {
                    "path": [
                      "$.credentialSubject.name"
                    ],
                    "purpose": "age verification"
                  },
                  {
                    "path": [
                      "$.credentialSubject.age"
                    ],
                    "purpose": "age verification"
                  }
                ]
              }
            }
          ]
        }
      }
    }
  },
  "auto_verify": false,
  "auto_remove": false
}

For this proof request if I run present-proof-2.0/records/{proof_ex}/credentials, then I get following output which returns all credential from the wallet even if it doesn't match the input descriptor query. It seems the the filter is not working..

[
  {
    "@context": [
      "https://www.w3.org/2018/credentials/v1",
      "https://w3c-ccg.github.io/citizenship-vocab/contexts/citizenship-v2.jsonld"
    ],
    "type": [
      "VerifiableCredential",
      "Person"
    ],
    "issuer": "did:key:z6MkkPqVPoDBT6HiEUJnbHbfpg4XUhyrJzo6DcF9kVUUL4PV",
    "issuanceDate": "2025-05-12T11:48:28.911Z",
    "credentialSubject": {
      "familyName": "Doe",
      "givenName": "John",
      "gender": "male",
      "type": [
        "Person"
      ],
      "id": "did:key:z6MkqFwPMJCh3BwEKD2XJNa5hTk33NvLcemxt5iBQhhUaRvQ"
    },
    "proof": {
      "type": "Ed25519Signature2018",
      "proofPurpose": "assertionMethod",
      "verificationMethod": "did:key:z6MkkPqVPoDBT6HiEUJnbHbfpg4XUhyrJzo6DcF9kVUUL4PV#z6MkkPqVPoDBT6HiEUJnbHbfpg4XUhyrJzo6DcF9kVUUL4PV",
      "created": "2025-05-12T11:50:45+00:00",
      "jws": "eyJhbGciOiAiRWREU0EiLCAiYjY0IjogZmFsc2UsICJjcml0IjogWyJiNjQiXX0..hZL9g1N2uG0u4vU3G8tVWkAmneHEKtCKssJ3FGR5SF4a1a6Jo8tBQfShatiRGOrn0J9Zt_T_jTd26OelN0bXCA"
    },
    "record_id": "767461ef2b5e4a3cb8930eaf90f35926"
  },
  {
    "@context": [
      "https://www.w3.org/2018/credentials/v1",
      "https://maroon-certain-beetle-286.mypinata.cloud/ipfs/QmcnGkNmsxALTwGNgJ8sTai9eY2Hfsw9KdNoKF8hiQtCYU"
    ],
    "type": [
      "VerifiableCredential",
      "KYC"
    ],
    "issuer": "did:key:z6MkkPqVPoDBT6HiEUJnbHbfpg4XUhyrJzo6DcF9kVUUL4PV",
    "issuanceDate": "2025-05-12T11:41:16.227Z",
    "credentialSubject": {
      "name": "Satoshi Nakamoto",
      "age": "30",
      "type": [
        "KYC"
      ],
      "id": "did:key:z6MkqFwPMJCh3BwEKD2XJNa5hTk33NvLcemxt5iBQhhUaRvQ"
    },
    "proof": {
      "type": "Ed25519Signature2018",
      "proofPurpose": "assertionMethod",
      "verificationMethod": "did:key:z6MkkPqVPoDBT6HiEUJnbHbfpg4XUhyrJzo6DcF9kVUUL4PV#z6MkkPqVPoDBT6HiEUJnbHbfpg4XUhyrJzo6DcF9kVUUL4PV",
      "created": "2025-05-12T11:50:45+00:00",
      "jws": "eyJhbGciOiAiRWREU0EiLCAiYjY0IjogZmFsc2UsICJjcml0IjogWyJiNjQiXX0..EVtq4-FaVj9fJX2s4zNqyvuLd3uXbilqiOPTKg1stgcEulIjnyC6E_din4L2_1xnl-CyBA7OEGsd_TQvtEuKBA"
    },
    "record_id": "9a055f3ae6104c05902d791ea6e75fb7"
  }
]

Can anyone please let me know what's the issue here or if I am doing anything wrong in the process ?

Sshovon avatar May 12 '25 12:05 Sshovon