You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/smart-contracts.md
+47-64
Original file line number
Diff line number
Diff line change
@@ -2,97 +2,80 @@
2
2
id: smart-contracts
3
3
title: Smart Contracts
4
4
sidebar_label: Smart Contracts
5
-
description: Smart Contracts used by the Polygon ID solution.
5
+
description: Smart Contracts used by the Privado ID
6
6
keywords:
7
7
- docs
8
8
- polygon id
9
9
- smart
10
10
- contract
11
11
---
12
12
13
-
<ahref="https://github.com/0xPolygonID/contracts"target="_blank">Polygon ID Smart Contracts - Github</a>
14
13
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:
<ahref="https://github.com/iden3/contracts"target="_blank">Privado ID Smart Contracts - Github</a>
26
15
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.
|**ERC20 example**| 0xB9Ac8e785f854f9B76bBF6d495213d58226DE813 (request id = 1 (sig)) | 0xB9Ac8e785f854f9B76bBF6d495213d58226DE813 (request id = 2 (mtp) |
38
+
## Unified contract addresses
55
39
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>
|**ERC20 example**| 0x3a4d4E47bFfF6bD0EF3cd46580D9e36F3367da03 (request id = 1) | 0x3a4d4E47bFfF6bD0EF3cd46580D9e36F3367da03 (request id = 2) |
71
56
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>.
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.
80
64
81
-
Current addresses for V3 beta circuit on **Polygon Mumbai** testnet**\***. (2.0.1-beta.1 V3 validator):
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
+
:::
89
73
90
-
:::note
74
+
:::info
91
75
More about <ins>[v3 circuit](./verifier/v3-circuit)</ins>.
92
76
93
77
Check the examples of deployment for <ins>[ v3 validator](https://github.com/0xPolygonID/contracts/blob/main/scripts/deployV3Validator.ts)</ins>
@@ -101,8 +84,8 @@ The CredentialAtomicQuerySigValidator contract is used to verify any credential-
101
84
102
85
The core of the contract is its <ahref="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:
103
86
104
-
- Verifies that the proof is valid. This verification is actually performed inside the
105
-
<ahref="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
+
<ahref="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.
106
89
- Verifies that the input used to generate the proof matches the query associated to that specific Request.
107
90
- Verifies that the user's and the Issuer's identity states are valid based on the State Contract.
0 commit comments