Smart Contracts

Architecture Diagram

State

  • This contract is incharge of storing and updating the current state of users (mostly for issuers).

  • When validators want to verify a proof, this contract is called to provide the relevant information (state of the issuer, state of the user, ...).

  • To update the current state, user must send a proof to prove that the next state statisfy the state transition circuit.

QueryMTPValidator

  • Users using Merkle Tree Proof use this contract to verify their proof.

  • When verify, this contract first get the issuer and user state from State contract and compare them with the input. If they don't match then the proof is invalid. If the current state match with the input then the validator will call the QueryMTPVerifier to verify the correctness of the proof.

QuerySigValidator

  • Users using Signature Proof use this contract to verify their proof.

  • Similar with the QueryMTPValidator, but instead of QueryMTPVerifier, this will call the QuerySigVerifier.

QueryMTPVerifier

  • This contract is automatically generated from the CredentialAtomicQueryMTP circuit by circom.

  • It is used to verify QueryMTP zkp.

QuerySigVerifier

  • This contract is automatically generated from the CredentialAtomicQuerySig circuit by circom.

  • It is used to verify QuerySig zkp.

StateTransitionVerifier

  • This contract is automatically generated from the StateTransition circuit by circom.

  • It is used to verify StateTransition zkp.

Deployed Contracts

ContractAddress

State

0x3181f6B8AB0e3027766dCd9Ebe26a6285e1ACb95

StateTransitionVerifier

0x625dbffbfef3A15409541cfeC62B8Cc27aCd6147

QueryMTPValidator

0x19C1F35cB4faFDbFAAC4833407eC96ef24A42140

QueryMTPVerifier

0x5e90FdBD4538E770DE3E014a412Cfdaa0E381591

QuerySigValidator

0x432DCD0c3362C2dd6b206092A5C6A6b9CAA0de7A

QuerySigVerifier

0x3035767bC767fC11a797AA7482F4430a023A8984

Last updated