Closed auer-martin closed 5 months ago
I suppose that id
property here attributeRawValues: { id: 'http://example.com' ... }
is not part of credential definition.
attributeRawValues
must match to credential definition. This is why you are getting the error.
Adding such non-anoncreds properties should be handled outside anoncreds library as @TimoGlastra mentioned here: https://github.com/hyperledger/anoncreds-rs/pull/273#discussion_r1422071313
@Artemkaaas I think there is still logic in place that strips out the id. I think we should remove all special handling for the id property.
If you look at the credential subject, it separates the id from the other attributes, and then only the attributes are used in the actual credenital.: https://github.com/hyperledger/anoncreds-rs/blob/8c7a83a563cb318ba169d3515988b30fc031d85d/src/data_types/w3c/credential.rs#L51
In the current implementation of the W3C credentials, there is a issue with the credential subject id property.
When converting a credential from JSON to a W3cCredential, the subject id property of the credential is not set correctly.
When the credential is processed, we get the following error: " Invalid state: Credential attribute 'id' value not provided".
@Artemkaaas can you take a look at this?