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

[proposal] W3C VC format is not checked for EIP712 credentials #1100

Open
mirceanis opened this issue Jan 11, 2023 · 3 comments
Open

[proposal] W3C VC format is not checked for EIP712 credentials #1100

mirceanis opened this issue Jan 11, 2023 · 3 comments
Labels
enhancement New feature or request pinned don't close this just for being stale

Comments

@mirceanis
Copy link
Member

Is your feature request related to a problem? Please describe.
JWT and JSON-LD credentials modules are both able to verify the W3C VC data model when verifying a credential or presentation.
This functionality is not fully implemented in the credentials-eip712 module.

Describe the solution you'd like
VC format should be validated by default when verifying

@mirceanis mirceanis added enhancement New feature or request pinned don't close this just for being stale labels Jan 11, 2023
@phoniks
Copy link

phoniks commented Mar 8, 2024

If I'm understanding this issue correctly, it sounds like the data model is validated for both JWT and JSON-LD credentials/presentations already and we want to implement the same functionality for eip712 credentials. In looking at the repo, I was able to find the following modules which I think are the 3 relevant ones:

  1. https://github.com/decentralized-identity/veramo/tree/next/packages/credential-eip712
  2. https://github.com/decentralized-identity/veramo/tree/next/packages/credential-ld
  3. https://github.com/decentralized-identity/veramo/tree/next/packages/credential-w3c

My assumption is that I should be able to look at 2 & 3 as examples of how to implement the validation of the data model for 1. Does this seem like an accurate assumption? Can anyone point to where exactly the validation takes place in the modules that already have this functionality?

@mirceanis or @italobb ?

@nickreynolds
Copy link
Contributor

@phoniks so the "credential-w3c" package actually handles all credential types and then sends the credential to the appropriate plugin for verification. You can see this in credential-w3c/src/action-handler.ts verifyCredential. Using the credential-ld package as a comparison would be a good idea, though.

However, to really understand how the verification works, you'll have to see that the credential-ld package actually uses another package to verify credentials, specifically @digitalcredentials/vc (you can see this in credential-ld/src/ld-credential-module.ts line 175).

So, I think what this issue is really asking you to do, is to add some of the work being done in that package ( https://github.com/digitalcredentials/vc/blob/51d1f3fd8a578864c2ea1e22de1f9dd7227ed99d/lib/index.js#L298 ) into the credential-eip712 verifyCredential function. This may be as simple as adding the checks seen in _checkCredential ( https://github.com/digitalcredentials/vc/blob/51d1f3fd8a578864c2ea1e22de1f9dd7227ed99d/lib/index.js#L612 )

@phoniks
Copy link

phoniks commented Mar 28, 2024

Thanks @nickreynolds - this is super helpful context. I think it should be enough for me to be able to put together a PR and get some feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned don't close this just for being stale
Projects
None yet
Development

No branches or pull requests

3 participants