Skip to content

Conversation

@2PykeETH
Copy link

@2PykeETH 2PykeETH commented Oct 1, 2025

Summary

This PR introduces the verifyAndExecute external function to the IIdentityManagerV2 interface. This addition provides a standardized entry point for verifying user proofs and executing identity-related operations, ensuring seamless integration across contracts.


Changes

  • New External Function:

    • verifyAndExecute(...) added with the following parameters:
      • address signal: Input signal for proof verification.
      • uint256 root: Merkle root to validate inclusion proofs.
      • uint256 nullifierHash: Unique nullifier for replay protection.
      • uint256[8] calldata proof: zkSNARK proof array.
      • UserType userType: Enum indicating the classification of the user.
      • uint256 expirationTimestamp: Timestamp after which verification is invalid.
  • NatSpec Documentation:

    • Clear section header and docstring to describe the function’s purpose and usage.
  • Formatting:

    • Applied forge fmt for consistent Solidity code style.

Motivation

  • Establish a consistent verification flow across all IdentityManagerV2 implementations.
  • Provide a single call that handles both verification and execution, reducing complexity for consuming contracts.
  • Enhance security guarantees by including nullifier and expiration parameters to prevent replay and stale proofs.

Next Steps

  • Implement verifyAndExecute in the main IdentityManagerV2 contract.
  • Add unit and integration tests to validate:
    • Proof validity checks.
    • Expiration handling.
    • Replay protection with nullifierHash.
  • Document expected consumer usage patterns.

@SynnekOG SynnekOG self-requested a review October 1, 2025 18:56
@SynnekOG SynnekOG added documentation Improvements or additions to documentation enhancement New feature or request labels Oct 1, 2025
@SynnekOG SynnekOG merged commit accc0ca into CrediChain:main Oct 1, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants