Skip to content

Commit a4a7aa6

Browse files
authored
Merge pull request #188 from 0xPolygonID/unified-addresses
Unified addresses
2 parents 51eb1ee + cb15d55 commit a4a7aa6

File tree

2 files changed

+48
-65
lines changed

2 files changed

+48
-65
lines changed

docs/smart-contracts.md

+47-64
Original file line numberDiff line numberDiff line change
@@ -2,97 +2,80 @@
22
id: smart-contracts
33
title: Smart Contracts
44
sidebar_label: Smart Contracts
5-
description: Smart Contracts used by the Polygon ID solution.
5+
description: Smart Contracts used by the Privado ID
66
keywords:
77
- docs
88
- polygon id
99
- smart
1010
- contract
1111
---
1212

13-
<a href="https://github.com/0xPolygonID/contracts" target="_blank">Polygon ID Smart Contracts - Github</a>
1413

15-
:::caution
16-
\*Polygon Mumbai testnet has been deprecated
17-
:::
18-
19-
## State Contract addresses
20-
21-
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:
22-
23-
- Testnet(amoy) -> `0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124`
24-
- Mainnet -> `0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D`
25-
- Testnet(mumbai)**\*** -> `0x134B1BE34911E39A8397ec6289782989729807a4`
14+
<a href="https://github.com/iden3/contracts" target="_blank">Privado ID Smart Contracts - Github</a>
2615

27-
:::info
28-
Check a contract codebase and algorithms of work <ins>[docs](https://docs.iden3.io/contracts/state/)</ins>, <ins>[repository](https://github.com/iden3/contracts/tree/master/contracts/state)</ins>.
29-
:::
16+
As part of our unified address methodology, we deployed contracts via the CREATE2 EVM opcode. This method ensures that the final address of the contract depends on the contract's initialization bytecode and a salt. To support deployments across various networks, we utilized [CreateX](https://createx.rocks/) contract factories. Specifically, the [deployCreate2](https://github.com/pcaversaccio/createx/blob/main/src/CreateX.sol#L332) method was used to handle the deployments.
3017

31-
## IdentityTreeStore contract (On-chain RHS)
3218

33-
| Network | Address |
34-
| :----------------------: | :----------------------------------------: |
35-
| **Polygon Mainnet** | 0xbEeB6bB53504E8C872023451fd0D23BeF01d320B |
36-
| **Polygon Amoy testnet** | 0x3d3763eC0a50CE1AdF83d0b5D99FBE0e3fEB43fb |
37-
| Polygon Mumbai testnet\* | 0x16A1ae4c460C0a42f0a87e69c526c61599B28BC9 |
19+
## Networks
20+
We have deployed contracts across the following mainnets and testnets so far:
3821

39-
## UniversalVerifier contract
22+
**Mainnets**:
4023

41-
| Network | Address |
42-
| :----------------------: | :----------------------------------------: |
43-
| **Polygon Mainnet** | 0x394d1dad46907bd54d15926A1ab4535EF2BF47b1 |
44-
| **Polygon Amoy testnet** | 0x1B20320042b29AE5c1a3ADc1674cb6bF8760530f |
24+
- [Ethereum](https://etherscan.io/address/0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896)
25+
- [Polygon POS](https://polygonscan.com/address/0x624ce98d2d27b20b8f8d521723df8fc4db71d79d)
26+
- [Polygon zkEVM](https://zkevm.polygonscan.com/address/0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896)
27+
- [Linea](https://lineascan.build/address/0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896)
28+
- Privado Mainnet
4529

46-
## Validator addresses
30+
**Testnets**:
4731

48-
Current addresses on **Polygon Mainnet** (V2.0.1 V2 validators):
32+
- [Ethereum Sepolia](https://sepolia.etherscan.io/address/0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896)
33+
- [Polygon Amoy](https://amoy.polygonscan.com/address/0x1a4cc30f2aa0377b0c3bc9848766d90cb4404124)
34+
- [Polygon zkEVM Cardona](https://cardona-zkevm.polygonscan.com/address/0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896)
35+
- [Linea-Sepolia](https://sepolia.lineascan.build/address/0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896)
36+
- Privado Testnet
4937

50-
| | Sig | MTP |
51-
| :---------------: | :---------------------------------------------------------------: | :--------------------------------------------------------------: |
52-
| **Verifier** | 0xa0495df44ABBDbfCD1da30638869A3307BF21532 | 0x068b3dDE10b55643b55aA4820c7a977dEEEc3c07 |
53-
| **Validators** | 0xEF8540a5e0F4f53B436e7C3A273dCAe1C05d764D | 0x03Ee09635E9946165dd9538e9414f0ACE57e42e1 |
54-
| **ERC20 example** | 0xB9Ac8e785f854f9B76bBF6d495213d58226DE813 (request id = 1 (sig)) | 0xB9Ac8e785f854f9B76bBF6d495213d58226DE813 (request id = 2 (mtp) |
38+
## Unified contract addresses
5539

56-
Current addresses on **Polygon Amoy** testnet. (V2.0.1 V2 validators)
40+
:::warning *EXCEPTIONS
41+
It’s important to note that the State contracts for the following two networks are exceptions. These contracts were already deployed at these addresses, and they are not being redeployed because they contain a significant amount of historically collected data. Redeploying them to a unified address would result in data loss, which we aim to avoid:
42+
- Polygon Amoy State Contract: <ins>[0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124](https://amoy.polygonscan.com/address/0x1a4cc30f2aa0377b0c3bc9848766d90cb4404124)</ins>
43+
- Polygon Mainnet State Contract : <ins>[0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D](https://polygonscan.com/address/0x624ce98d2d27b20b8f8d521723df8fc4db71d79d)</ins>
5744

58-
| | Sig | MTP |
59-
| :---------------: | :---------------------------------------------------------: | :---------------------------------------------------------: |
60-
| **Verifier** | 0x35178273C828E08298EcB0C6F1b97B3aFf14C4cb | 0x789D95794973034BFeDed6D4693e7cc3Eb253B3a |
61-
| **Validators** | 0x8c99F13dc5083b1E4c16f269735EaD4cFbc4970d | 0xEEd5068AD8Fecf0b9a91aF730195Fef9faB00356 |
62-
| **ERC20 example** | 0x2b23e5cF70D133fFaA7D8ba61E1bAC4637253880 (request id = 1) | 0x2b23e5cF70D133fFaA7D8ba61E1bAC4637253880 (request id = 2) |
45+
:::
6346

64-
Current addresses on **Polygon Mumbai** testnet**\***. (V2.0.1 V2 validators):
47+
| Smart Contract Type | Unified Address |
48+
| :----------------------: | :----------------------------------------: |
49+
| **STATE* ** | 0x3C9acB2205Aa72A05F6D77d708b5Cf85FCa3a896 |
50+
| **VALIDATOR_MTP** | 0x27bDFFCeC5478a648f89764E22fE415486A42Ede |
51+
| **VALIDATOR_SIG** | 0x59B347f0D3dd4B98cc2E056Ee6C53ABF14F8581b |
52+
| **VALIDATOR_V3** | 0xd179f29d00Cd0E8978eb6eB847CaCF9E2A956336 |
53+
| **UNIVERSAL_VERIFIER** | 0xfcc86A79fCb057A8e55C6B853dff9479C3cf607c |
54+
| **IDENTITY_TREE_STORE** | 0x7dF78ED37d0B39Ffb6d4D527Bb1865Bf85B60f81 |
6555

66-
| | Sig | MTP |
67-
| :---------------: | :---------------------------------------------------------: | :---------------------------------------------------------: |
68-
| **Verifier** | 0x81ef49013627F363570a1C60B0D2215E23651B01 | 0xe5DB0489979C5671D9785cF1cBA9D9028041c9Bf |
69-
| **Validators** | 0x59f2a6D94D0d02F3a2F527a8B6175dc511935624 | 0xb9b51F7E8C83C90FE48e0aBd815ef0418685CcF6 |
70-
| **ERC20 example** | 0x3a4d4E47bFfF6bD0EF3cd46580D9e36F3367da03 (request id = 1) | 0x3a4d4E47bFfF6bD0EF3cd46580D9e36F3367da03 (request id = 2) |
7156

72-
Current addresses for V3 beta circuit on **Polygon Amoy** testnet. (2.0.1-beta.1 V3 validator):
57+
:::info
58+
State Contracts are used for publishing data on the blockchain in scenarios such as issuing MTP-type credentials, generating on-chain proofs, enforcing credential revocations, and providing a timestamping service for tracking expirations during on-chain proof verifications.
59+
Check the contract codebase and algorithms of work <ins>[docs](https://docs.iden3.io/contracts/state/)</ins>, <ins>[repository](https://github.com/iden3/contracts/tree/master/contracts/state)</ins>.
60+
:::
7361

74-
| | V3 validator 2.0.1-beta.1 |
75-
| :------------------: | :--------------------------------------------------------------------------------------------------------: |
76-
| **Verifier** | 0x07Bbd95505c44B65D7FA3B08dF6F5859373Fa1DC |
77-
| **Validators** | 0xa5f08979370AF7095cDeDb2B83425367316FAD0B |
78-
| **ERC20 SD example** | 0xc5Cd536cb9Cc3BD24829502A39BE593354986dc4 (request id = 3) |
79-
| **ERC20 example** | 0xc5Cd536cb9Cc3BD24829502A39BE593354986dc4 (request id = 100 - 1100 merklized / 10000 - 65000 nonmerklized |
62+
:::info Stateless Contract Libraries
63+
We have released a set of reusable stateless contracts, deployed to unified addresses, that can be integrated into any contract. These can be used for standalone deployments of contracts from the ecosystem.
8064

81-
Current addresses for V3 beta circuit on **Polygon Mumbai** testnet**\***. (2.0.1-beta.1 V3 validator):
65+
- SMT_LIB: 0x682364078e26C1626abD2B95109D2019E241F0F6
66+
- POSEIDON_1: 0xC72D76D7271924a2AD54a19D216640FeA3d138d9
67+
- POSEIDON_2: 0x72F721D9D5f91353B505207C63B56cF3d9447edB
68+
- POSEIDON_3: 0x5Bc89782d5eBF62663Df7Ce5fb4bc7408926A240
69+
- POSEIDON_4: 0x0695cF2c6dfc438a4E40508741888198A6ccacC2
8270

83-
| | V3 validator 2.0.1-beta.1 |
84-
| :------------------: | :--------------------------------------------------------------------------------------------------------: |
85-
| **Verifier** | 0xDE27fc243Bf4eDAaB72E1008c9828C480582f672 |
86-
| **Validators** | 0x3412AB64acFf5d94Da4914F176A43aCbDdC7Fc4a |
87-
| **ERC20 SD example** | 0x36eB0E70a456c310D8d8d15ae01F6D5A7C15309A (request id = 3) |
88-
| **ERC20 example** | 0x36eB0E70a456c310D8d8d15ae01F6D5A7C15309A (request id = 100 - 1100 merklized / 10000 - 65000 nonmerklized |
71+
These libraries can be leveraged for various purposes, such as building custom verifiers, state management, or identity trees, allowing for flexible integration into other projects. By using these pre-deployed contracts, developers can significantly reduce the gas costs typically incurred during deployment.
72+
:::
8973

90-
:::note
74+
:::info
9175
More about <ins>[v3 circuit](./verifier/v3-circuit)</ins>.
9276

9377
Check the examples of deployment for <ins>[ v3 validator](https://github.com/0xPolygonID/contracts/blob/main/scripts/deployV3Validator.ts)</ins>
9478
:::
95-
9679
## CredentialAtomicQuerySigValidator
9780

9881
<a href="https://github.com/iden3/contracts/blob/master/contracts/validators/CredentialAtomicQuerySigValidator.sol" target="_blank">CredentialAtomicQuerySigValidator.sol - Github</a>
@@ -101,8 +84,8 @@ The CredentialAtomicQuerySigValidator contract is used to verify any credential-
10184

10285
The core of the contract is its <a href="https://github.com/iden3/contracts/blob/master/contracts/validators/CredentialAtomicQuerySigValidator.sol#L53" target="_blank">verify</a> function that takes the proof generated by a user and executes a set of verifications:
10386

104-
- Verifies that the proof is valid. This verification is actually performed inside the
105-
<a href="https://github.com/iden3/contracts/blob/master/contracts/lib/VerifierSig.sol" target="_blank">verifierSig</a> contract which is automatically generated using circom.
87+
- Verifies that the proof is valid. This verification is actually performed inside the
88+
<a href="https://github.com/iden3/contracts/blob/master/contracts/lib/groth16-verifiers/Groth16VerifierSig.sol" target="_blank">Groth16VerifierSig</a> contract which is automatically generated using circomlibjs library.
10689
- Verifies that the input used to generate the proof matches the query associated to that specific Request.
10790
- Verifies that the user's and the Issuer's identity states are valid based on the State Contract.
10891

docs/verifier/on-chain-verification/overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ main()
627627
});
628628
```
629629

630-
The contract is now correctly deployed on Amoi Polygon Testnet and the query has been set up, congratulations! Now it is time to launch the airdrop!
630+
The contract is now correctly deployed on Polygon Amoy Testnet and the query has been set up, congratulations! Now it is time to launch the airdrop!
631631

632632
### Add the Proof Request Inside a QR Code
633633

0 commit comments

Comments
 (0)