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

credentialSchema is not shared with the verifier

Open acuderman opened this issue 4 years ago • 4 comments

When the presented BBS+ credential includes the credentialSchema property, It is not added to the presentation exchange record as expected.

Reproduction steps:

  • Add credentialSchema property to the credential with value:
"credentialSchema": {
    "id": "https://example.com/schema",
    "type": "JsonSchemaValidator2020",
}
  • Run demo agents:
./run_demo faber --did-exchange --cred-type json-ld --wallet-type askar
./run_demo alice --wallet-type askar
  • Issue credential and send proof request
  • Fetch v2 presentation exchange record on the verifier(Faber) agent
  • Observe that the presentation exchange record does not include the credentialSchema property but includes all others inside the ˙by_format.pres.dif.verifiableCredential˙ array.

acuderman avatar Dec 02 '21 09:12 acuderman

@TimoGlastra I have discovered an issue with pyld normalize which is used to generate document_statements here: https://github.com/hyperledger/aries-cloudagent-python/blob/fa749d249a38ab2e5df96d4992ea2ced542290a5/aries_cloudagent/vc/ld_proofs/suites/bbs_bls_signature_proof_2020.py#L97

For this credential (link), the document_statements generated by pyld is missing this:

<https://example.com/schema> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://json-ld.org/playground/JsonSchemaValidator2020> .

Due to this, the derived credential's credentialSchema is as following:

"credentialSchema": "https://example.com/schema"

Against expected

"credentialSchema": {
    "id": "https://example.com/schema",
    "type": "JsonSchemaValidator2020"
}

shaangill025 avatar Dec 06 '21 16:12 shaangill025

Hmm, haven't tested with credential schemas when writing this. @shaangill025 could you add test that reproduces this error? That will make it easy for me to debug

TimoGlastra avatar Dec 06 '21 16:12 TimoGlastra

@TimoGlastra This test reproduces the issue: https://github.com/hyperledger/aries-cloudagent-python/blob/1f59a056bbf7a489fcefb25510a16832fc165ee5/aries_cloudagent/vc/ld_proofs/suites/tests/test_bbs_bls_signature_2020.py#L89

shaangill025 avatar Dec 06 '21 18:12 shaangill025

@TimoGlastra @shaangill025 Thank you for taking a look. Are there any updates regarding the issue?

acuderman avatar Jan 05 '22 12:01 acuderman