Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: AnonCreds revocation registry and statuslist #1954

Conversation

Tommylans
Copy link
Contributor

The implementation is based on the logic described in the cheqd documentation about the registry and the status list https://docs.cheqd.io/product/advanced/anoncreds/revocation-status-list#tying-creddef-revregdef-and-statuslist-objects-together

Copy link

changeset-bot bot commented Jul 17, 2024

🦋 Changeset detected

Latest commit: 71a4192

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@credo-ts/cheqd Patch
@credo-ts/action-menu Patch
@credo-ts/anoncreds Patch
@credo-ts/askar Patch
@credo-ts/bbs-signatures Patch
@credo-ts/core Patch
@credo-ts/drpc Patch
@credo-ts/indy-sdk-to-askar-migration Patch
@credo-ts/indy-vdr Patch
@credo-ts/node Patch
@credo-ts/openid4vc Patch
@credo-ts/question-answer Patch
@credo-ts/react-native Patch
@credo-ts/tenants Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

const response = await cheqdDidResolver.resolveResource(
agentContext,
`${revocationRegistryId}&resourceType=anonCredsStatusList&resourceVersionTime=${timestamp}`
`${parsedDid.did}?resourceType=anonCredsStatusList&resourceVersionTime=${timestamp}&resourceName=${revocationRegistryDefinitionName}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the revocation registry definition name need to be unique? couldn't we use the revocationRegistryId as the name of the status list?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the documentation of cheqd about anoncreds revocation. The statuslist and the revocation registry definition name needs to be the same as the credential definition name. Which is currently the case in the implementation.

if (response.resourceState.state !== 'finished')
throw new CredoError(response.resourceState.reason ?? 'Unknown error')

// It's not possible to get the timestamp from the response, so we set it to the current time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not? The timestamp is important for some pieces, so I think we need to get the timestamp is will be used when you resolve the status list (then we can get the timestamp using response.resourceMetadata.created.getTime()?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cheqd sdk currently doesn't return the creation date when you create a new resource, but it's returned when you are querying a resource. So the only way is to query it just after creation? Also when you look at the raw response of the cheqd sdk of the creation it doesn't return a creation.

But for fetching the statuslist it only needs a timestamp which is close to the resource it doesn't really have to be exact.

So what do you think we should do in this case?

@TimoGlastra TimoGlastra enabled auto-merge (squash) July 17, 2024 15:02
@TimoGlastra TimoGlastra merged commit 1e9260a into openwallet-foundation:main Jul 17, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants