```json
diff --git a/docs/issuer/on-chain-issuer/on-chain-tutorial.md b/docs/issuer/on-chain-issuer/on-chain-tutorial.md
index ed799225..c3393af1 100644
--- a/docs/issuer/on-chain-issuer/on-chain-tutorial.md
+++ b/docs/issuer/on-chain-issuer/on-chain-tutorial.md
@@ -55,30 +55,25 @@ There are two main components in this application:
1. Deploy an on-chain merklized issuer contract. You can use [this sample](https://github.com/0xPolygonID/contracts/blob/main/contracts/examples/IdentityExample.sol) or create your own smart contract with custom logic.
Clone smart contracts repository:
+
```bash
git clone https://github.com/0xPolygonID/contracts.git
```
Deploy Identity Example contract:
+
```bash
export AMOY_PRIVATE_KEY={private_key} && \
export AMOY_RPC_URL={rpc_url} && \
npx hardhat run scripts/deployIdentityExample.ts --network amoy
```
-
-
+
:::note
You can find more information on how to deploy a smart contract using Hardhat [in this readme](https://github.com/iden3/contracts#readme).
:::
-
-
-
-
-
-
1. Use the utility to calculate the issuerDID from the smart contract address:
```bash
@@ -97,23 +92,23 @@ You can find more information on how to deploy a smart contract using Hardhat [<
- ```bash
- SUPPORTED_RPC="80002="
- ISSUERS_PRIVATE_KEY="="
- EXTERNAL_HOST=""
- SUPPORTED_STATE_CONTRACTS="80002=0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
- ```
+```bash
+SUPPORTED_RPC="80002="
+ISSUERS_PRIVATE_KEY="="
+EXTERNAL_HOST=""
+SUPPORTED_STATE_CONTRACTS="80002=0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124"
+```
- ```bash
- SUPPORTED_RPC="137="
- ISSUERS_PRIVATE_KEY="="
- EXTERNAL_HOST=""
- SUPPORTED_STATE_CONTRACTS="137=0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"
- ```
+```bash
+SUPPORTED_RPC="137="
+ISSUERS_PRIVATE_KEY="="
+EXTERNAL_HOST=""
+SUPPORTED_STATE_CONTRACTS="137=0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"
+```
@@ -192,7 +187,7 @@ You can use already deployed demo: https://onchain-merklized-issuer-demo.polygon
1. Visit the [Query builder website](https://schema-builder.polygonid.me/query-builder/).
-2. You now need to define the query.
+2. You now need to define the query.
- **URL**: https://gist.githubusercontent.com/ilya-korotya/b06baa37453ed9aedfcb79100b84d51f/raw/balance-v1.jsonld
- **Schema type**: BalanceCredential
@@ -211,7 +206,6 @@ You can use already deployed demo: https://onchain-merklized-issuer-demo.polygon
-
4. Click on Approve. After which, the process of generating the proof is starts:
@@ -219,6 +213,7 @@ You can use already deployed demo: https://onchain-merklized-issuer-demo.polygon
5.Finally, the proof is generated. The verifier will check the revocation status and some additional information. The proof is then sent and validated by the verifier. You will receive the following response on the Query builder website
+

-
\ No newline at end of file
+
diff --git a/docs/issuer/refresh-service/customization.md b/docs/issuer/refresh-service/customization.md
index 25e33684..4169fada 100644
--- a/docs/issuer/refresh-service/customization.md
+++ b/docs/issuer/refresh-service/customization.md
@@ -20,6 +20,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
Extend customization by incorporating custom providers and integrating them into the refresh flow.
This is the easiest way to add custom business logic to retrieve data from a data provider. Go to [setup guide](/docs/issuer/refresh-service/setup-guide/#setup-with-custom-data-provider) for more information
+
## 2. Flexible HTTP package
Utilize the [flexible HTTP package](https://github.com/0xPolygonID/refresh-service/blob/main/providers/flexiblehttp/http.go) to configure HTTP requests to a data provider. Refer to the [configuration guide](https://github.com/0xPolygonID/refresh-service/blob/main/README.md) for instructions on how to set this up.
diff --git a/docs/issuer/refresh-service/setup-guide.md b/docs/issuer/refresh-service/setup-guide.md
index 3ed247a3..4eca00ac 100644
--- a/docs/issuer/refresh-service/setup-guide.md
+++ b/docs/issuer/refresh-service/setup-guide.md
@@ -17,146 +17,165 @@ keywords:
import useBaseUrl from '@docusaurus/useBaseUrl';
> **NOTE: Current implementation of [refresh service](https://github.com/0xPolygonID/refresh-service) works only with [issuer-node](https://github.com/0xPolygonID/issuer-node/).**
->
## Preparation
+
1. Run the issuer-node locally by following the [quick-start installation guide](https://github.com/0xPolygonID/issuer-node/#quick-start-installation).
1. Clone the refresh service using the command `git clone git@github.com:0xPolygonID/refresh-service.git`.
1. Build JSON and JSONLD schemas, utilizing the provided examples:
- - [JSON](https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/non-zero-balance.json)
- - [JSONLD](https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/non-zero-balance.jsonld)
+- [JSON](https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/non-zero-balance.json)
+- [JSONLD](https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/non-zero-balance.jsonld)
- Generate custom schemas through the [schema builder](https://schema-builder.polygonid.me/builder). Additional details can be found in the [schema builder documentation](/docs/issuer/schema-builder/).
+Generate custom schemas through the [schema builder](https://schema-builder.polygonid.me/builder). Additional details can be found in the [schema builder documentation](/docs/issuer/schema-builder/).
## Setup with custom data provider
+
Consider an example of integrating [polygon scan](https://polygonscan.com/) as a data provider for the refresh service.
1. Integrate the custom data provider into the [data provider module](https://github.com/0xPolygonID/refresh-service/tree/main/providers):
- ```go
- const polygonBalanceURL = "https://api.polygonscan.com/api?module=account&action=balance&address=%s&apikey=%s"
- type BalanceResponse struct {
- Status string `json:"status"`
- Result string `json:"result"`
- Message string `json:"message"`
+```go
+const polygonBalanceURL = "https://api.polygonscan.com/api?module=account&action=balance&address=%s&apikey=%s"
+
+type BalanceResponse struct {
+ Status string `json:"status"`
+ Result string `json:"result"`
+ Message string `json:"message"`
+}
+
+func GetBalanceByAddress(address string) (map[string]any, error) {
+ resp, err := http.Get(
+ fmt.Sprintf(polygonBalanceURL, address, ""),
+ )
+ if err != nil {
+ return nil,
+ fmt.Errorf("failed to get balance: %w", err)
}
- func GetBalanceByAddress(address string) (map[string]any, error) {
- resp, err := http.Get(
- fmt.Sprintf(polygonBalanceURL, address, ""),
- )
- if err != nil {
- return nil,
- fmt.Errorf("failed to get balance: %w", err)
- }
-
- balanceResp := &BalanceResponse{}
- if err = json.NewDecoder(resp.Body).Decode(balanceResp); err != nil {
- return nil,
- fmt.Errorf("failed to decode balance response: %w", err)
- }
- defer resp.Body.Close()
-
- if balanceResp.Status != "1" {
- return nil,
- fmt.Errorf("invalid status in balance response: %s", balanceResp.Message)
- }
-
- // convert to credential subject format
- // ensure that these fields align with the attributes specified in the JSONLD schema.
- return map[string]any{
- "balance": balanceResp.Result,
- "address": address,
- }, nil
+ balanceResp := &BalanceResponse{}
+ if err = json.NewDecoder(resp.Body).Decode(balanceResp); err != nil {
+ return nil,
+ fmt.Errorf("failed to decode balance response: %w", err)
}
- ```
+ defer resp.Body.Close()
+
+ if balanceResp.Status != "1" {
+ return nil,
+ fmt.Errorf("invalid status in balance response: %s", balanceResp.Message)
+ }
+
+ // convert to credential subject format
+ // ensure that these fields align with the attributes specified in the JSONLD schema.
+ return map[string]any{
+ "balance": balanceResp.Result,
+ "address": address,
+ }, nil
+}
+```
+
1. Use the custom data provider within the refresh service:
- 1. Remove the default data provider:
- ```go
- flexibleHTTP, err := rs.providers.ProduceFlexibleHTTP(credentialType)
- if err != nil {
- return nil,
- errors.Wrapf(ErrCredentialNotUpdatable,
- "for credential '%s' not possible to find a data provider: %v", credential.ID, err)
-
- }
- updatedFields, err := flexibleHTTP.Provide(credential.CredentialSubject)
- if err != nil {
- return nil, err
- }
- ```
- 1. Use the new polygon scan data provider:
- ```go
- // confirm the credentialType matches a supported type in the refresh service,
- // and its urn:uuid aligns with the id in the JSONLD schema
- if credentialType != "urn:uuid:f50cfcf6-ded4-470e-83be-2d6820a66998" {
- return nil, errors.New("unknow credentialType")
- }
-
- updatedFields, err := polygonscan.GetBalanceByAddress(credential.CredentialSubject["address"].(string))
- if err != nil {
- return nil, err
- }
- ```
+
+ 1. Remove the default data provider:
+
+ ```go
+ flexibleHTTP, err := rs.providers.ProduceFlexibleHTTP(credentialType)
+ if err != nil {
+ return nil,
+ errors.Wrapf(ErrCredentialNotUpdatable,
+ "for credential '%s' not possible to find a data provider: %v", credential.ID, err)
+
+ }
+ updatedFields, err := flexibleHTTP.Provide(credential.CredentialSubject)
+ if err != nil {
+ return nil, err
+ }
+ ```
+
+ 1. Use the new polygon scan data provider:
+
+ ```go
+ // confirm the credentialType matches a supported type in the refresh service,
+ // and its urn:uuid aligns with the id in the JSONLD schema
+ if credentialType != "urn:uuid:f50cfcf6-ded4-470e-83be-2d6820a66998" {
+ return nil, errors.New("unknow credentialType")
+ }
+
+ updatedFields, err := polygonscan.GetBalanceByAddress(credential.CredentialSubject["address"].(string))
+ if err != nil {
+ return nil, err
+ }
+ ```
+
1. Populate the .env variables:
- ```
- export IPFS_GATEWAY_URL="https://infura..."
- export SUPPORTED_RPC="137=https://infura..."
- export SUPPORTED_STATE_CONTRACTS="137=0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"
- export SUPPORTED_ISSUERS="*=https://my-issuer-node.com"
- export ISSUERS_BASIC_AUTH="*=myuser:mypassword"
- ```
+ ```
+ export IPFS_GATEWAY_URL="https://infura..."
+ export SUPPORTED_RPC="137=https://infura..."
+ export SUPPORTED_STATE_CONTRACTS="137=0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"
+ export SUPPORTED_ISSUERS="*=https://my-issuer-node.com"
+ export ISSUERS_BASIC_AUTH="*=myuser:mypassword"
+ ```
1. Generate a blank config.yaml file:
- ```bash
- touch config.yaml
- ```
+
+```bash
+touch config.yaml
+```
+
1. Run the refresh service:
- ```bash
- source .env
- go run .
- ```
+
+```bash
+source .env
+go run .
+```
## Setup with default provider
+
To integrate [polygon scan](https://polygonscan.com/) data provider with the default data provider, follow these general steps:
+
1. Create a `config.yaml` file with the following content:
- ```yaml
- urn:uuid:f50cfcf6-ded4-470e-83be-2d6820a66998:
- settings:
- timeExpiration: 5m
- provider:
- url: https://api.polygonscan.com/api
- method: GET
- requestSchema:
- params:
- module: account
- action: balance
- address: "{{ credentialSubject.address }}" # this value will be substituted from the credentialSubject.address field
- apikey:
- headers:
- Content-Type: application/json
- responseSchema:
- type: json
- properties:
- result:
- type: string
- match: credentialSubject.balance
- ```
+
+```yaml
+urn:uuid:f50cfcf6-ded4-470e-83be-2d6820a66998:
+ settings:
+ timeExpiration: 5m
+ provider:
+ url: https://api.polygonscan.com/api
+ method: GET
+ requestSchema:
+ params:
+ module: account
+ action: balance
+ address: "{{ credentialSubject.address }}" # this value will be substituted from the credentialSubject.address field
+ apikey:
+ headers:
+ Content-Type: application/json
+ responseSchema:
+ type: json
+ properties:
+ result:
+ type: string
+ match: credentialSubject.balance
+```
+
2. Populate the .env variables:
- ```
- export IPFS_GATEWAY_URL="https://infura..."
- export SUPPORTED_RPC="137=https://infura..."
- export SUPPORTED_STATE_CONTRACTS="137=0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"
- export SUPPORTED_ISSUERS="*=https://my-issuer-node.com"
- export ISSUERS_BASIC_AUTH="*=myuser:mypassword"
- ```
+
+```
+export IPFS_GATEWAY_URL="https://infura..."
+export SUPPORTED_RPC="137=https://infura..."
+export SUPPORTED_STATE_CONTRACTS="137=0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D"
+export SUPPORTED_ISSUERS="*=https://my-issuer-node.com"
+export ISSUERS_BASIC_AUTH="*=myuser:mypassword"
+```
+
3. Run the service:
- ```bash
- source .env
- go run .
- ```
+
+```bash
+source .env
+go run .
+```
## Testing
+
1. Go to the issuer-node UI and generate a credential with refresh service section:
@@ -200,4 +219,4 @@ To integrate [polygon scan](https://polygonscan.com/) data provider with the def
-
\ No newline at end of file
+
diff --git a/docs/quick-start-demo.md b/docs/quick-start-demo.md
index 55da6d70..27ca8eeb 100644
--- a/docs/quick-start-demo.md
+++ b/docs/quick-start-demo.md
@@ -51,7 +51,6 @@ Polygon ID wallet is an implementation of the Wallet SDK, as a way of showcasing
The process from downloading to creating an identity on the Polygon ID Wallet is just as it is shown below. You need to download the app, create a wallet, set up a PIN number and the wallet is ready to be used.
-
@@ -180,8 +179,7 @@ Here are the steps to verify the credential:
})
-
-
+
4. After clicking on **Test query**, you should scan the resulting QR code and follow the instructions on the mobile app.
diff --git a/docs/smart-contracts.md b/docs/smart-contracts.md
index 3daf4560..a0dc320b 100644
--- a/docs/smart-contracts.md
+++ b/docs/smart-contracts.md
@@ -13,7 +13,7 @@ keywords:
Polygon ID Smart Contracts - Github
:::caution
-*Polygon Mumbai testnet has been deprecated
+\*Polygon Mumbai testnet has been deprecated
:::
## State Contract addresses
@@ -22,8 +22,7 @@ For situations where one needs to publish data on the blockchain, such as creati
- Testnet(amoy) -> `0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124`
- Mainnet -> `0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D`
-- Testnet(mumbai)***** -> `0x134B1BE34911E39A8397ec6289782989729807a4`
-
+- Testnet(mumbai)**\*** -> `0x134B1BE34911E39A8397ec6289782989729807a4`
:::info
Check a contract codebase and algorithms of work [docs](https://docs.iden3.io/contracts/state/), [repository](https://github.com/iden3/contracts/tree/master/contracts/state).
@@ -31,65 +30,55 @@ Check a contract codebase and algorithms of work [docs](https://docs.iden3.
## IdentityTreeStore contract (On-chain RHS)
-| Network | Address |
-|:--------------------------:|:------------------------------------------:|
-| **Polygon Mainnet** | 0xbEeB6bB53504E8C872023451fd0D23BeF01d320B |
-| **Polygon Amoy testnet** | 0x3d3763eC0a50CE1AdF83d0b5D99FBE0e3fEB43fb |
-| Polygon Mumbai testnet* | 0x16A1ae4c460C0a42f0a87e69c526c61599B28BC9 |
-
+| Network | Address |
+| :----------------------: | :----------------------------------------: |
+| **Polygon Mainnet** | 0xbEeB6bB53504E8C872023451fd0D23BeF01d320B |
+| **Polygon Amoy testnet** | 0x3d3763eC0a50CE1AdF83d0b5D99FBE0e3fEB43fb |
+| Polygon Mumbai testnet\* | 0x16A1ae4c460C0a42f0a87e69c526c61599B28BC9 |
## Validator addresses
Current addresses on **Polygon Mainnet** (V2.0.1 V2 validators):
-
-
-| | Sig | MTP |
-|:-----------------:|:-----------------------------------------------------------------:|:-----------------------------------------------------------------:|
-| **Verifier** | 0xa0495df44ABBDbfCD1da30638869A3307BF21532 | 0x068b3dDE10b55643b55aA4820c7a977dEEEc3c07 |
-| **Validators** | 0xEF8540a5e0F4f53B436e7C3A273dCAe1C05d764D | 0x03Ee09635E9946165dd9538e9414f0ACE57e42e1 |
-| **ERC20 example** | 0xB9Ac8e785f854f9B76bBF6d495213d58226DE813 (request id = 1 (sig)) | 0xB9Ac8e785f854f9B76bBF6d495213d58226DE813 (request id = 2 (mtp) |
-
+| | Sig | MTP |
+| :---------------: | :---------------------------------------------------------------: | :--------------------------------------------------------------: |
+| **Verifier** | 0xa0495df44ABBDbfCD1da30638869A3307BF21532 | 0x068b3dDE10b55643b55aA4820c7a977dEEEc3c07 |
+| **Validators** | 0xEF8540a5e0F4f53B436e7C3A273dCAe1C05d764D | 0x03Ee09635E9946165dd9538e9414f0ACE57e42e1 |
+| **ERC20 example** | 0xB9Ac8e785f854f9B76bBF6d495213d58226DE813 (request id = 1 (sig)) | 0xB9Ac8e785f854f9B76bBF6d495213d58226DE813 (request id = 2 (mtp) |
Current addresses on **Polygon Amoy** testnet. (V2.0.1 V2 validators)
-| | Sig | MTP |
-|:-----------------:|:-----------------------------------------------------------:|:------------------------------------------------------------:|
-| **Verifier** | 0x35178273C828E08298EcB0C6F1b97B3aFf14C4cb | 0x789D95794973034BFeDed6D4693e7cc3Eb253B3a |
-| **Validators** | 0x8c99F13dc5083b1E4c16f269735EaD4cFbc4970d | 0xEEd5068AD8Fecf0b9a91aF730195Fef9faB00356 |
-| **ERC20 example** | 0x2b23e5cF70D133fFaA7D8ba61E1bAC4637253880 (request id = 1) | 0x2b23e5cF70D133fFaA7D8ba61E1bAC4637253880 (request id = 2) |
-
-
-
+| | Sig | MTP |
+| :---------------: | :---------------------------------------------------------: | :---------------------------------------------------------: |
+| **Verifier** | 0x35178273C828E08298EcB0C6F1b97B3aFf14C4cb | 0x789D95794973034BFeDed6D4693e7cc3Eb253B3a |
+| **Validators** | 0x8c99F13dc5083b1E4c16f269735EaD4cFbc4970d | 0xEEd5068AD8Fecf0b9a91aF730195Fef9faB00356 |
+| **ERC20 example** | 0x2b23e5cF70D133fFaA7D8ba61E1bAC4637253880 (request id = 1) | 0x2b23e5cF70D133fFaA7D8ba61E1bAC4637253880 (request id = 2) |
-Current addresses on **Polygon Mumbai** testnet*****. (V2.0.1 V2 validators):
-
-| | Sig | MTP |
-|:-----------------:|:-----------------------------------------------------------:|:------------------------------------------------------------:|
-| **Verifier** | 0x81ef49013627F363570a1C60B0D2215E23651B01 | 0xe5DB0489979C5671D9785cF1cBA9D9028041c9Bf |
-| **Validators** | 0x59f2a6D94D0d02F3a2F527a8B6175dc511935624 | 0xb9b51F7E8C83C90FE48e0aBd815ef0418685CcF6 |
-| **ERC20 example** | 0x3a4d4E47bFfF6bD0EF3cd46580D9e36F3367da03 (request id = 1) | 0x3a4d4E47bFfF6bD0EF3cd46580D9e36F3367da03 (request id = 2) |
+Current addresses on **Polygon Mumbai** testnet**\***. (V2.0.1 V2 validators):
+| | Sig | MTP |
+| :---------------: | :---------------------------------------------------------: | :---------------------------------------------------------: |
+| **Verifier** | 0x81ef49013627F363570a1C60B0D2215E23651B01 | 0xe5DB0489979C5671D9785cF1cBA9D9028041c9Bf |
+| **Validators** | 0x59f2a6D94D0d02F3a2F527a8B6175dc511935624 | 0xb9b51F7E8C83C90FE48e0aBd815ef0418685CcF6 |
+| **ERC20 example** | 0x3a4d4E47bFfF6bD0EF3cd46580D9e36F3367da03 (request id = 1) | 0x3a4d4E47bFfF6bD0EF3cd46580D9e36F3367da03 (request id = 2) |
Current addresses for V3 beta circuit on **Polygon Amoy** testnet. (2.0.1-beta.1 V3 validator):
-| | V3 validator 2.0.1-beta.1 |
-|:--------------------:|:-----------------------------------------------------------------------------------------------------------:|
-| **Verifier** | 0x07Bbd95505c44B65D7FA3B08dF6F5859373Fa1DC |
-| **Validators** | 0xa5f08979370AF7095cDeDb2B83425367316FAD0B |
-| **ERC20 SD example** | 0xc5Cd536cb9Cc3BD24829502A39BE593354986dc4 (request id = 3) |
-| **ERC20 example** | 0xc5Cd536cb9Cc3BD24829502A39BE593354986dc4 (request id = 100 - 1100 merklized / 10000 - 65000 nonmerklized |
-
+| | V3 validator 2.0.1-beta.1 |
+| :------------------: | :--------------------------------------------------------------------------------------------------------: |
+| **Verifier** | 0x07Bbd95505c44B65D7FA3B08dF6F5859373Fa1DC |
+| **Validators** | 0xa5f08979370AF7095cDeDb2B83425367316FAD0B |
+| **ERC20 SD example** | 0xc5Cd536cb9Cc3BD24829502A39BE593354986dc4 (request id = 3) |
+| **ERC20 example** | 0xc5Cd536cb9Cc3BD24829502A39BE593354986dc4 (request id = 100 - 1100 merklized / 10000 - 65000 nonmerklized |
+Current addresses for V3 beta circuit on **Polygon Mumbai** testnet**\***. (2.0.1-beta.1 V3 validator):
-Current addresses for V3 beta circuit on **Polygon Mumbai** testnet*****. (2.0.1-beta.1 V3 validator):
-
-| | V3 validator 2.0.1-beta.1 |
-|:--------------------:|:-----------------------------------------------------------------------------------------------------------:|
-| **Verifier** | 0xDE27fc243Bf4eDAaB72E1008c9828C480582f672 |
-| **Validators** | 0x3412AB64acFf5d94Da4914F176A43aCbDdC7Fc4a |
-| **ERC20 SD example** | 0x36eB0E70a456c310D8d8d15ae01F6D5A7C15309A (request id = 3) |
-| **ERC20 example** | 0x36eB0E70a456c310D8d8d15ae01F6D5A7C15309A (request id = 100 - 1100 merklized / 10000 - 65000 nonmerklized |
+| | V3 validator 2.0.1-beta.1 |
+| :------------------: | :--------------------------------------------------------------------------------------------------------: |
+| **Verifier** | 0xDE27fc243Bf4eDAaB72E1008c9828C480582f672 |
+| **Validators** | 0x3412AB64acFf5d94Da4914F176A43aCbDdC7Fc4a |
+| **ERC20 SD example** | 0x36eB0E70a456c310D8d8d15ae01F6D5A7C15309A (request id = 3) |
+| **ERC20 example** | 0x36eB0E70a456c310D8d8d15ae01F6D5A7C15309A (request id = 100 - 1100 merklized / 10000 - 65000 nonmerklized |
:::note
More about [v3 circuit](./verifier/v3-circuit).
@@ -97,7 +86,6 @@ More about [v3 circuit](./verifier/v3-circuit).
Check the examples of deployment for [ v3 validator](https://github.com/0xPolygonID/contracts/blob/main/scripts/deployV3Validator.ts)
:::
-
## CredentialAtomicQuerySigValidator
CredentialAtomicQuerySigValidator.sol - Github
@@ -120,6 +108,3 @@ The core of the contract is its Iden3 - Smart Contracts
-
-
-
diff --git a/docs/verifier/on-chain-verification/overview.md b/docs/verifier/on-chain-verification/overview.md
index 442f630d..bea424a8 100644
--- a/docs/verifier/on-chain-verification/overview.md
+++ b/docs/verifier/on-chain-verification/overview.md
@@ -278,10 +278,7 @@ async function main() {
const verifierSymbol = "zkERC20";
const ERC20Verifier = await ethers.getContractFactory(verifierContract);
- const erc20Verifier = await upgrades.deployProxy(
- ERC20Verifier,
- [verifierName, verifierSymbol]
- );
+ const erc20Verifier = await upgrades.deployProxy(ERC20Verifier, [verifierName, verifierSymbol]);
await erc20Verifier.deployed();
console.log(verifierName, " contract address:", erc20Verifier.address);
@@ -448,7 +445,14 @@ function coreSchemaFromStr(schemaIntString) {
return SchemaHash.newSchemaHashFromInt(schemaInt);
}
-function calculateQueryHashV2(values, schema, slotIndex, operator, claimPathKey, claimPathNotExists) {
+function calculateQueryHashV2(
+ values,
+ schema,
+ slotIndex,
+ operator,
+ claimPathKey,
+ claimPathNotExists
+) {
const expValue = prepareCircuitArrayValues(values, 64);
const valueHash = poseidon.spongeHashX(expValue, 6);
const schemaHash = coreSchemaFromStr(schema);
@@ -639,5 +643,5 @@ Now that you have been able to create your first on-chain ZK-based application,
Another possibility to customize your Smart Contract involves setting different ZK requests. First of all, multiple `REQUEST_ID` must be defined inside the main Smart Contract. Therefore, the contract deployer can set a different query for each request ID and create different outcomes inside `_afterProofSubmit` according to the type of proof received. For example, an airdrop contract can verify the role of a user inside a DAO and distribute a different amount of tokens based on the role.
## Estimated Gas Costs for On-Chain Verifier
-While it is clear that gas cost is highly dependent on the complexity of the logic that you add to the `_afterProofSubmit` and `_beforeProofSubmit` functions, the sample code for the on-chain verifier in this tutorial costs approximately 700k gas to execute on-chain. The zk proof verification function specifically costs approximately 520k gas. The above estimates are accurate as of January 2024.
+While it is clear that gas cost is highly dependent on the complexity of the logic that you add to the `_afterProofSubmit` and `_beforeProofSubmit` functions, the sample code for the on-chain verifier in this tutorial costs approximately 700k gas to execute on-chain. The zk proof verification function specifically costs approximately 520k gas. The above estimates are accurate as of January 2024.
diff --git a/docs/verifier/v3-circuit.md b/docs/verifier/v3-circuit.md
index f76938ab..dcdd163b 100644
--- a/docs/verifier/v3-circuit.md
+++ b/docs/verifier/v3-circuit.md
@@ -21,15 +21,14 @@ We want to introduce new circuits - СredentialAtomicQueryV3 and CredentialAtomi
Newest version is СredentialAtomicQueryV3-beta.1
Changelog from beta.0 to beta.1
-
- 1. ValueArrSize input is introduced, which fixes behaviour for IN / NIN operations.
+
+ 1. ValueArrSize input is introduced, which fixes behaviour for IN / NIN operations.
2. Exists / Noop / Less Than Or Equal / Greater Than or Equal / Not between / Between operators support.
3. Query hash calculation algorithm changes.
4. Constraints and security optimizations.
-
-
+
:::
@@ -37,8 +36,6 @@ More about new supported operators [here](./verification-library/zk-query-langua
Link to latest sdk circuit wrappers: [js](https://github.com/0xPolygonID/js-sdk/pull/181) / [go](https://github.com/iden3/go-circuits/releases/tag/v2.1.0)
-
-
In general it's an improved version of V2 circuits with several important key features:
1. SIG and MTP checks are united in single circuit. Now you can use only one circuit without sig/mtp suffixes. Proof will be taken from user wallet and authorization response will contain information about verifiable credential proof type which has been used. It is possible to request the needed proof from user by using `proofType` property in the authorization request message. Possible values are `Iden3SparseMerkleTreeProof` and `BJJSignature2021`. If `proofType` is not provided - available proof will be used. In case there are two proofs available - MTP will be used as more prior.
diff --git a/docs/verifier/verification-library/verifier-set-up.md b/docs/verifier/verification-library/verifier-set-up.md
index ad713d8b..a2eb683f 100644
--- a/docs/verifier/verification-library/verifier-set-up.md
+++ b/docs/verifier/verification-library/verifier-set-up.md
@@ -422,10 +422,7 @@ async function callback(req, res) {
} catch (error) {
return res.status(500).send(error);
}
- return res
- .status(200)
- .set("Content-Type", "application/json")
- .send(authResponse);
+ return res.status(200).set("Content-Type", "application/json").send(authResponse);
}
```
diff --git a/docs/verifier/verification-library/zk-query-language.md b/docs/verifier/verification-library/zk-query-language.md
index 3463b40f..97e9fabe 100644
--- a/docs/verifier/verification-library/zk-query-language.md
+++ b/docs/verifier/verification-library/zk-query-language.md
@@ -77,10 +77,10 @@ const proofRequest: protocol.ZKPRequest = {
"https://raw.githubusercontent.com/0xPolygonID/tutorial-examples/main/credential-schema/schemas-examples/proof-of-humanity/proof-of-humanity.jsonld",
credentialSubject: {
isHuman: {
- $eq: 1
- }
- }
- }
+ $eq: 1,
+ },
+ },
+ },
};
```
@@ -153,10 +153,10 @@ const proofRequest: protocol.ZKPRequest = {
"https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v4.jsonld",
credentialSubject: {
birthday: {
- $lt: 20010101
- }
- }
- }
+ $lt: 20010101,
+ },
+ },
+ },
};
```
@@ -228,10 +228,10 @@ const proofRequest: protocol.ZKPRequest = {
"https://raw.githubusercontent.com/0xPolygonID/tutorial-examples/main/credential-schema/schemas-examples/employee-data/employee-data.jsonld",
credentialSubject: {
monthlySalary: {
- $gt: 1000
- }
- }
- }
+ $gt: 1000,
+ },
+ },
+ },
};
```
@@ -305,10 +305,10 @@ const proofRequest: protocol.ZKPRequest = {
"https://raw.githubusercontent.com/0xPolygonID/tutorial-examples/main/credential-schema/schemas-examples/proof-of-dao-role/proof-of-dao-role.jsonld",
credentialSubject: {
role: {
- $in: [4, 5]
- }
- }
- }
+ $in: [4, 5],
+ },
+ },
+ },
};
```
@@ -380,9 +380,9 @@ const proofRequest: protocol.ZKPRequest = {
credentialSubject: {
countryCode: {
$nin: [840, 120, 340, 509],
- }
- }
- }
+ },
+ },
+ },
};
```
@@ -426,11 +426,10 @@ Corresponding QR Code
}
}
```
+
-
-
## Not-equal - Operator 6
**Credential Schema**
@@ -455,10 +454,10 @@ const proofRequest: protocol.ZKPRequest = {
"https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v4.jsonld",
credentialSubject: {
countryCode: {
- $ne: 840
- }
- }
- }
+ $ne: 840,
+ },
+ },
+ },
};
```
@@ -502,17 +501,15 @@ Corresponding QR Code
}
}
```
+
-
-
:::info
Operators 7-11 are supported only by [V3 circuit](../v3-circuit.md)
:::
-
## Less-than-equal - Operator 7
**Credential Schema**
@@ -537,10 +534,10 @@ const proofRequest: protocol.ZKPRequest = {
"https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v4.jsonld",
credentialSubject: {
birthday: {
- $lte: 20010101
- }
- }
- }
+ $lte: 20010101,
+ },
+ },
+ },
};
```
@@ -549,7 +546,6 @@ const proofRequest: protocol.ZKPRequest = {
Please, check out our [