credo-ts icon indicating copy to clipboard operation
credo-ts copied to clipboard

feature: Actively check revocation status of anoncreds credential

Open icc-romeu opened this issue 1 year ago • 5 comments
trafficstars

Hi,

I was wondering whether there is some way of getting the revocation status of an Indy credential. I saw there is a revocationNotification in the CredentialExchangeRecord attributes but, is there an option to actively check whether a credential has been revoked?

icc-romeu avatar May 13 '24 07:05 icc-romeu

Maybe this can be helpful, having an observable event

GHkrishna avatar Jun 09 '24 12:06 GHkrishna

Hey @icc-romeu,

Sorry for the late reply, i missed your issue.

What you can do is get the credential, extract the revocationRegistryId and fetch the status list (using anoncreds api), then look up the index of the credential (revocationIndex i think) in the status list.

We could also add a convenience method for this

TimoGlastra avatar Jun 09 '24 16:06 TimoGlastra

Thx for the reply @TimoGlastra. Because if you miss the revocation notification, credential seems to be ok, but it's not.

I think it would be awesome to create a convenience method for it. In the meantime, I will do as suggested.

icc-romeu avatar Jun 11 '24 13:06 icc-romeu

For the sake of completion, just in case someone wants to do the same, this is what I am doing. Not 100% sure it is ok but it works on my side for Anoncreds:

      const credential = await agent.credentials.getById(id);

      const meta: Metadata<AnonCredsCredentialMetadata> = credential.metadata;
      const rev = meta.data['_anoncreds/credential'];
      const revocationRegistryId = rev.revocationRegistryId;
      const credentialRevocationId = rev.credentialRevocationId;

      const revocationStatus = await fetchRevocationStatusList(
        agent.context,
        revocationRegistryId,
        dayjs().unix(),
      );

icc-romeu avatar Jun 18 '24 07:06 icc-romeu

Thanks for the example, I've reopened the issue as a feature request so we can add a method to the AnonCredsApi

TimoGlastra avatar Jun 18 '24 08:06 TimoGlastra