Skip to main content

Smart Contracts

Polygon ID Smart Contracts - Github

Blockchain addresses

For situations where one needs to publish data on the blockchain, such as creating an MTP-type credential, generating on-chain proofs and making credential revocations effective, it is important to have the following Smart Contracts addresses:

  • Testnet(mumbai) -> 0x134B1BE34911E39A8397ec6289782989729807a4
  • Mainnet -> 0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D
info

Check a contract codebase and algorithms of work docs, repository.

Validator addresses

Current addresses on Polygon Mumbai testnet. (V1.0.1)

SigMTP
Verifier0x8024014f73BcCAEe048784d835A36c49e96F28060xF71d97Fc0262bB2e5B20912a6861da0B617a07Aa
Validators0x1E4a22540E293C0e5E8c33DAfd6f523889cFd8780x0682fbaA2E4C478aD5d24d992069dba409766121
ERC20 example0xD75638D319B1aE2a9491DC61f87a800AD362D168 (request id = 1)0xD75638D319B1aE2a9491DC61f87a800AD362D168 (request id = 2)

Current addresses on Polygon Main (V1.0.1)

SigMTP
Verifier0xaf48CC9C2Ef728b7c4A903c9f5472498f8AED5E10x1008De1794be8fAba4fc33db6dff59B1d1Ac3a64
Validators0x35178273C828E08298EcB0C6F1b97B3aFf14C4cb0x8c99F13dc5083b1E4c16f269735EaD4cFbc4970d
ERC20 example0xa5f08979370AF7095cDeDb2B83425367316FAD0B (request id = 1 (sig))0xa5f08979370AF7095cDeDb2B83425367316FAD0B (request id = 2 (mtp)
note

The Smart Contracts above are updated and the legacy mumbai/main contracts should not be used anymore. However, if needed, support is still provided: v.1.1.1.

CredentialAtomicQuerySigValidator

CredentialAtomicQuerySigValidator.sol - Github

The CredentialAtomicQuerySigValidator contract is used to verify any credential-related zk proof generated by user using the credentialAtomicQuerySigV2OnChain circuit. The contract only verifies proofs based on credential of type Signature

The core of the contract is its verify function that takes the proof generated by a user and executes a set of verifications:

  • Verifies that the proof is valid. This verification is actually performed inside theverifierSig contract which is automatically generated using circom.
  • Verifies that the input used to generate the proof matches the query associated to that specific Request.
  • Verifies that the user's and the Issuer's identity states are valid based on the State Contract.

The CredentialAtomicQuerySigValidator executes the same set of verifications of the Verification Library. The former is required when performing on-chain verification while the latter is required for off-chain verification.

CredentialAtomicQueryMTPValidator

CredentialAtomicQueryMTPValidator.sol - Github

Performs the same set of verifications of the CredentialAtomicQuerySigValidator but for credential of type MTP.

Further protocol related contracts can be found at Iden3 - Smart Contracts

CredentialAtomicQueryV3 Validator

Also now there deployed v3 validator on mumbai network. It is base on CredentialAtomicQueryV3 circuit.

Features of v3 validator:

  • both mtp and sig proof verification
  • ethereum controlled identities support
  • selective disclosure support

Current addresses for V3 beta circuit on Polygon Mumbai testnet. (1.0.0-beta.0 V3 validator)

V3 validator 1.0.0-beta.0
Verifier0x3dE74ffCf9Fc0AA6c9fD73b511342a0E653B4129
Validators0xCBde9B14fcF5d56B709234528C44798B4ea64761
ERC20 SD example0xD0Fd3E9fDF448e5B86Cc0f73E5Ee7D2F284884c0 (request id = 3)
ERC20 0xD0Fd3E9fDF448e5B86Cc0f73E5Ee7D2F284884c0 (request id = 100 - 650 merklized (step 50) / 10000 - 65000 nonmerklized (step 5000))
note

More about v3 circuit.

Check the examples of deployment for v3 validator