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

W3C: Reworked predicates representation - no mapping #303

Conversation

Artemkaaas
Copy link
Contributor

@Artemkaaas Artemkaaas commented Jan 15, 2024

@TimoGlastra @andrewwhitehead @swcurran

This is an alternative implementation for w3c predicate representation as boolean values to using explicit mapping like was done in PR: #302

I feel like it should work and we can close another PR.

anoncreds-clsignatures requires passing of predicate name, type, value for doing verification of each cl sub-proof.
If we pass a different predicate value, verification will fail.
It can cause an issue when a request contains multiple predicates with the same attribute name. Due to this, we used an explicit mapping.

In proper way, this information (predicate name /type/value) should be taken from the proof request.
But as we do verification for each request attribute/predicate that presentation contains a verifiable credential providing requested data, we can just take attributes/predicates from inside of sub proof itself at the sub proof verification step .

The function to verify requested predicate check the following:

  1. w3c credential contains a predicate attribute in credential subject
  2. cl sub_proof contains sub_proof for the requested predicate (same name, value, type)
  3. credential matches to restrictions

This PR: depends on this change in CL AnonCreds library: hyperledger/anoncreds-clsignatures-rs#38

Signed-off-by: artem.ivanov <artem.ivanov@dsr-corporation.com>
…sentation

Signed-off-by: artem.ivanov <artem.ivanov@dsr-corporation.com>

# Conflicts:
#	src/data_types/w3c/proof.rs
Signed-off-by: artem.ivanov <artem.ivanov@dsr-corporation.com>
Cargo.toml Outdated
@@ -27,7 +27,7 @@ vendored = ["anoncreds-clsignatures/openssl_vendored"]
w3c = ["base64", "chrono", "rmp-serde"]

[dependencies]
anoncreds-clsignatures = "0.3.0"
anoncreds-clsignatures = { git = "https://github.com/DSRCorporation/anoncreds-clsignatures-rs.git", branch = "feat/expose-proof-predicates" }
Copy link
Member

Choose a reason for hiding this comment

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

0.3.1 has been released

Suggested change
anoncreds-clsignatures = { git = "https://github.com/DSRCorporation/anoncreds-clsignatures-rs.git", branch = "feat/expose-proof-predicates" }
anoncreds-clsignatures = "0.3.1"

Signed-off-by: artem.ivanov <artem.ivanov@dsr-corporation.com>
Signed-off-by: artem.ivanov <artem.ivanov@dsr-corporation.com>
@TimoGlastra
Copy link
Member

Merging for now so we can create a pre-release. @andrewwhitehead if you have any comments, we can addreess them in a follow up pr

@TimoGlastra TimoGlastra merged commit 66d567b into hyperledger:main Jan 16, 2024
26 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