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

add identityManager v3 with modified verifyProof impl #164

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

karankurbur
Copy link

@karankurbur karankurbur commented Jan 28, 2025

Context:
We are looking at ways to reduce the calldata posted from World Chain -> l1 blobs/calldata to reduce cost and increase scalability. A large percentage of World Chain transactions have a ZKP which can be compressed from 8 uints to 4 uints. The Sempahore Verifier contract has a verifyCompressedProof function that can be called directly. We want to create a backwards compatible way to reduce the proof size as well as introduce an explicit function for verifying compressed proofs. We make this backwards compatible by checking the last four uints, if they are all 0 we can assume this proof is compressed and we should call the appropriate function. The addeded verifyCompressedProof should be used in all new smart contracts.

Changes

  • Create WorldIDIdentityManagerImplV3.sol with updated verifyProof implementation. If the last 4 uints in the proof are 0, it will call SempahoreVerifier.verifyCompressedProof
  • Add verifyCompressedProof function
  • Update unit tests to explicitly specify IdentityManagerv2

Deployment

  • No additional initializer methods
  • Deploy the v3 contract and update through the UUPS proxy via upgradeTo on WorldIDIdentityManager

@karankurbur karankurbur marked this pull request as ready for review January 28, 2025 20:36
@karankurbur karankurbur changed the title add indentityManager v3 with modified verifyProof impl add identityManager v3 with modified verifyProof impl Jan 28, 2025
Copy link
Contributor

@0xOsiris 0xOsiris left a comment

Choose a reason for hiding this comment

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

Do we want to also expose a verifyCompressedProof function that can just take as calldata the compressed proof in the upgrade?

@0xForerunner
Copy link

Do we want to also expose a verifyCompressedProof function that can just take as calldata the compressed proof in the upgrade?

Seems like a good idea I think.

@karankurbur karankurbur force-pushed the karan-verify-compressed-proof branch from 187a731 to 0115c67 Compare January 29, 2025 06:23
@karankurbur karankurbur force-pushed the karan-verify-compressed-proof branch from 2570455 to bb48d8a Compare January 29, 2025 06:30
@karankurbur karankurbur requested a review from 0xOsiris January 29, 2025 16:05
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.

3 participants