credentialSchema is not shared with the verifier
When the presented BBS+ credential includes the credentialSchema property, It is not added to the presentation exchange record as expected.
Reproduction steps:
- Add
credentialSchemaproperty 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
credentialSchemaproperty but includes all others inside the ˙by_format.pres.dif.verifiableCredential˙ array.
@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"
}
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 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
@TimoGlastra @shaangill025 Thank you for taking a look. Are there any updates regarding the issue?