Skip to content

Add ZKJWTUtils #182

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

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Add ZKJWTUtils #182

wants to merge 18 commits into from

Conversation

ernestognw
Copy link
Member

@ernestognw ernestognw commented Jun 24, 2025

Similar to #96 but for ZK JWT

@ernestognw
Copy link
Member Author

Getting a:

Error HH411: The library solidity-stringutils, imported from @zk-email/zk-jwt/src/utils/JwtRegistry.sol, is not installed. Try installing it using npm.

It may be worth to submit a pr to ZK JWT to replace this library with OZ if possible. Most likely using the Bytes library

@ernestognw ernestognw marked this pull request as ready for review July 26, 2025 00:26
@ernestognw ernestognw requested a review from a team as a code owner July 26, 2025 00:26
@ernestognw ernestognw marked this pull request as draft July 26, 2025 15:19
@ernestognw ernestognw marked this pull request as ready for review July 28, 2025 18:24
@ernestognw
Copy link
Member Author

It seems ready imo. I couldn't get the testInvalidJWTProof to pass. It'll always revert with fuzzing. It seems that this comes from differences between the JwtGroth16Verifier used under the hood vs the Groth16Verifier used for ZKEmail.

I think we should discuss whether how to remove the try/catch block in isValidZKJWT or also add it to isValidZKEmail

@ernestognw
Copy link
Member Author

Next steps include:

  1. Generate a real proof fixture to test against
  2. Create a SignerZKJWT
  3. Create a ERC7913ZKJWTVerifier

For 1, I've been trying to run the following on the zk-jwt repository and I can't generate a proof, only the public inputs:

yarn gen-input --input-file input.json --account-code "0x1162ebff40918afe5305e68396f0283eb675901d0387f97d21928d423aaa0b54" --prove

@ernestognw
Copy link
Member Author

I think we should discuss #210 first. I'd like to port those changes to ZKJWTUtils as well but first we need to validate that dropping templateId is actually fine

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.

1 participant