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

fix(anoncreds): combine creds into one proof #1893

Conversation

TimoGlastra
Copy link
Contributor

Combines attributes and predicates from the same credential into one proof. This way the verifier can assert that e.g. a predicate of age > 15 and attribute of name are from the same cred.

Based on discussion in hyperledger/anoncreds-rs#292

Would be great if there's a bit more control of it in the proof request syntax, as you now have to parse the presentation/proof structure to know whether multiple attributes/predicates come from the same credential (which I suspect no-one does, so request a predicate and attribute at the same time is actually not very secure it seems as you don't know whether they are from the same cred).

const existingCredentialIndex = credentials.findIndex(
(credential) =>
credential.credentialId === attribute.credentialId &&
attribute.timestamp === credential.credentialEntry.timestamp
Copy link
Contributor

Choose a reason for hiding this comment

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

Won't the credentialId suffice? Why is the timestamp included?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't 100 sure, but as we create the revocation state based on the timestamp, it would be possible to have different requirements.

E.g. age > 15 nonRevoked between 100 and 1000 (timestamp)
and name = Berend. nonRevoked between 10.000 and 100.000 (timestamp)..

These would create different revocation states, and therefore I decided to also include timestamp. It's very very rare to have different timestamps, but this at least makes sure the presentation is valid

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah okay, makes sense! good catch!

Signed-off-by: Timo Glastra <[email protected]>
@TimoGlastra TimoGlastra enabled auto-merge (squash) June 7, 2024 08:41
@TimoGlastra TimoGlastra merged commit d5ead99 into openwallet-foundation:main Jun 7, 2024
12 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