alastria / alastriaID-truffle-contracts

Alastria ID truffle Smart Contracts
MIT License
2 stars 5 forks source link

DeleteSubjectCredential when used does not remove the credential from the subjectCredentialList #64

Closed MisiakGeo closed 1 year ago

MisiakGeo commented 1 year ago

Hello all, When the DeleteSubjectCredential smart contract function (located here is used, the credential is marked as DeletedBySubject (assigning the status of the credential equals to 3), but it is not removed from the subjectCredentialList. After a successful deletion by the subject, the subjectCredentialList retains the removed credential. Shouldn't the removed credentials also been removed from the list too? Thank you very much

rober12 commented 1 year ago

Good morning MisiakGeo,

The way it works is correct because what you are looking for is a logical deletion, i.e. that the credential is marked as no longer valid, but not that it is completely removed from the subjectCredentialList. What we are interested in is that it is reflected in blockchain that the credential has a revoked status by the subject or by the issuer, but not that the credential is deleted. The credential continues to exist but is revoked by one of the actors.

However, this information will no longer be stored in the new version that is being worked on to avoid storing information in the blockchain of users due to the design of the model. See the new version of the smart contract here (https://github.com/alastria/alastriaID-truffle-contracts/blob/develop/contracts/registry/AlastriaCredentialRegistry.sol#L63)

Thank you.

MisiakGeo commented 1 year ago

Good moring @rober12, Thank you very much. This action is indeed much better not to store the credential list at all.