Skip to content

Commit

Permalink
Merge pull request #141 from 0xPolygonID/fix-mumbai-amoy
Browse files Browse the repository at this point in the history
Update: examples and configs (mumbai -> amoy ; verifier demo -> schema builder)
  • Loading branch information
0xpulkit authored Apr 19, 2024
2 parents e9fcb0e + 17db3fd commit 226a757
Show file tree
Hide file tree
Showing 53 changed files with 203 additions and 184 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The error you're experiencing is typically due to an incorrect configuration of

To resolve this issue, check your `.env-issuer` file for the `ISSUER_CREDENTIAL_STATUS_RHS_MODE` value. If it is set to `OffChain`, you must specify a valid Reverse Hash Service Endpoint in `ISSUER_CREDENTIAL_STATUS_RHS_URL`. For example, you could use our staging RHS: `https://rhs-staging.polygonid.me/`.

If your `ISSUER_CREDENTIAL_STATUS_RHS_MODE` is configured for on-chain operation, ensure you have the correct smart contract information for your network, such as Mumbai:
If your `ISSUER_CREDENTIAL_STATUS_RHS_MODE` is configured for on-chain operation, ensure you have the correct smart contract information for your network, such as Amoy:
- `ISSUER_CREDENTIAL_STATUS_ONCHAIN_TREE_STORE_SUPPORTED_CONTRACT`=0x3d3763eC0a50CE1AdF83d0b5D99FBE0e3fEB43fb
- `ISSUER_CREDENTIAL_STATUS_RHS_CHAIN_ID`=80002

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ keywords:
What steps should I take if an error message says there's no identity found for a given DID?

```bash
time=2023-11-27T12:29:51.334Z level=ERROR msg="error getting identity by DID" err="no rows in result set" did=did:polygonid:polygon:mumbai:2qHm5f6GZsJdLxpmGNCnn6TckCJWzhGmUUWebpFy5c
time=2023-11-27T12:29:51.334Z level=ERROR msg="issuer DID must exist" did="{Method:polygonid ID:polygon:mumbai:2qHm5f6GZsJdLxpmGNCnn6TckCJWzhGmUUWebpFy5c IDStrings:[polygon mumbai 2qHm5f6GZsJdLxpmGNCnn6TckCJWzhGmUUWebpFy5c] Params:[] Path: PathSegments:[] Query: Fragment:}"
time=2023-11-27T12:29:51.334Z level=ERROR msg="error getting identity by DID" err="no rows in result set" did=did:polygonid:polygon:amoy:2qHm5f6GZsJdLxpmGNCnn6TckCJWzhGmUUWebpFy5c
time=2023-11-27T12:29:51.334Z level=ERROR msg="issuer DID must exist" did="{Method:polygonid ID:polygon:amoy:2qHm5f6GZsJdLxpmGNCnn6TckCJWzhGmUUWebpFy5c IDStrings:[polygon amoy 2qHm5f6GZsJdLxpmGNCnn6TckCJWzhGmUUWebpFy5c] Params:[] Path: PathSegments:[] Query: Fragment:}"
```

## Answer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Yes, credentials issued in any environment—on-chain or off-chain—can be veri

Regarding cross-chain verification, while a universal, out-of-the-box solution for state validation across chains does not yet exist, leveraging existing bridging technologies offers a viable pathway. These technologies facilitate the transfer of issuer identity states and GIST roots between networks, enabling credentials issued on one blockchain to be verified on another. This approach significantly enhances the interoperability and flexibility of the credential verification process, making it possible to verify credentials across different blockchain ecosystems.

Additionally, off-chain cross verification is also supported. At the SDK level, it is possible to configure connections to any EVM-based blockchain RPC and implement a custom wallet. Within the Polygon ID app, both Polygon mainnet and Mumbai testnet networks are directly supported, allowing for versatile off-chain verification configurations that accommodate various blockchain environments.
Additionally, off-chain cross verification is also supported. At the SDK level, it is possible to configure connections to any EVM-based blockchain RPC and implement a custom wallet. Within the Polygon ID app, both Polygon mainnet and Amoy testnet networks are directly supported, allowing for versatile off-chain verification configurations that accommodate various blockchain environments.

The capability for cross-environment and cross-chain verification greatly expands the utility of digital credentials. It encourages a more interconnected and adaptable framework for the issuance and verification of credentials, supporting a wide range of use cases and applications in a decentralized digital world.

Expand Down
2 changes: 1 addition & 1 deletion docs/issuer-node/install-gcm.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To install the issuer node through the [Google Cloud Marketplace](https://consol

:::note

In the following examples, you will see a checkbox labeled "Issuer Network Main Net". If this checkbox is selected, the issuer node will be configured for the **Polygon Main network**, and in the Ethereum URL field, you should enter the RPC URL for that network. If you do not select this checkbox, the issuer node will be deployed on the Mumbai network, and the Ethereum URL field should contain the RPC URL for the **Polygon Mumbai network**.
In the following examples, you will see a checkbox labeled "Issuer Network Main Net". If this checkbox is selected, the issuer node will be configured for the **Polygon Main network**, and in the Ethereum URL field, you should enter the RPC URL for that network. If you do not select this checkbox, the issuer node will be deployed on the Amoy network, and the Ethereum URL field should contain the RPC URL for the **Polygon Amoy network**.

:::

Expand Down
24 changes: 12 additions & 12 deletions docs/issuer-node/issue-credential-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ curl --location 'http://localhost:3001/v1/identities' \
"didMetadata":{
"method": "polygonid",
"blockchain":"polygon",
"network": "mumbai"
"network": "amoy"
}
}';

# Expected Output:
# {"identifier":"did:polygonid:polygon:mumbai:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE","state":{"claimsTreeRoot":"eb3d346d16f849b3cc2be69bfc58091dfaf6d90574be26bb40222aea67e08505","createdAt":"2023-03-22T22:49:02.782896Z","modifiedAt":"2023-03-22T22:49:02.782896Z","state":"b25cf54e7e648a263658416194c41ef6ae2dec101c50dfb2febc5e96eaa87110","status":"confirmed"}}
# {"identifier":"did:polygonid:polygon:amoy:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE","state":{"claimsTreeRoot":"eb3d346d16f849b3cc2be69bfc58091dfaf6d90574be26bb40222aea67e08505","createdAt":"2023-03-22T22:49:02.782896Z","modifiedAt":"2023-03-22T22:49:02.782896Z","state":"b25cf54e7e648a263658416194c41ef6ae2dec101c50dfb2febc5e96eaa87110","status":"confirmed"}}
```

### (Optional) View Existing DIDs (connections)
Expand All @@ -72,12 +72,12 @@ curl --location --request GET 'http://localhost:3001/v1/identities' \
"did_metadata":{
"method": "polygonid",
"blockchain":"polygon",
"network": "mumbai"
"network": "amoy"
}
}';

# Expected Output (Results may vary based on number of DIDs created):
# ["did:polygonid:polygon:mumbai:2qMd3PtcVbzDNQZBiSDctaigbQtYW9KTqrLFoUm4Ur","did:polygonid:polygon:mumbai:2qMeNWv9xSSvWyBpn5tDojzQ8sga4VtrfuAkV65zQa","did:polygonid:polygon:mumbai:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE","did:polygonid:polygon:mumbai:2qLR2qA22RemPeQDsQwdrrMU3SM9CNLnRBhmQtzo5v","did:polygonid:polygon:mumbai:2qHYtws8GQN3RniHLjPf5GuZUZtcD37o1MUgUmw287"]
# ["did:polygonid:polygon:amoy:2qMd3PtcVbzDNQZBiSDctaigbQtYW9KTqrLFoUm4Ur","did:polygonid:polygon:amoy:2qMeNWv9xSSvWyBpn5tDojzQ8sga4VtrfuAkV65zQa","did:polygonid:polygon:amoy:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE","did:polygonid:polygon:amoy:2qLR2qA22RemPeQDsQwdrrMU3SM9CNLnRBhmQtzo5v","did:polygonid:polygon:amoy:2qHYtws8GQN3RniHLjPf5GuZUZtcD37o1MUgUmw287"]
```

### Creating Credentials
Expand All @@ -103,14 +103,14 @@ The issuer node DID can be retrieved by looking at `.env-api` for `ISSUER_API_UI
:::

```bash
curl --location 'http://localhost:3001/v1/did:polygonid:polygon:mumbai:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE/claims' \
curl --location 'http://localhost:3001/v1/did:polygonid:polygon:amoy:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE/claims' \
--header 'Authorization: Basic dXNlci1pc3N1ZXI6cGFzc3dvcmQtaXNzdWVy' \
--header 'Content-Type: application/json' \
--data '{
"credentialSchema":"https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json",
"type": "KYCAgeCredential",
"credentialSubject": {
"id": "did:polygonid:polygon:mumbai:2qEsg1AeTohAq6Euc3hBaDapfLVfQiWS7DUfvutYEq",
"id": "did:polygonid:polygon:amoy:2qEsg1AeTohAq6Euc3hBaDapfLVfQiWS7DUfvutYEq",
"birthday": 19960424,
"documentType": 2
}
Expand All @@ -133,11 +133,11 @@ You can always check the created credentials on the Issuer Node UI.
Using the previously generated credential ID from [Creating Credentials](#creating-credentials).

```bash
curl --location --request GET 'http://localhost:3001/v1/did:polygonid:polygon:mumbai:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE/claims/b1eab5be-dea3-11ed-8f7d-0242ac1e0005' \
curl --location --request GET 'http://localhost:3001/v1/did:polygonid:polygon:amoy:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE/claims/b1eab5be-dea3-11ed-8f7d-0242ac1e0005' \
--header 'Authorization: Basic dXNlci1pc3N1ZXI6cGFzc3dvcmQtaXNzdWVy';

# Expected Output:
# {"@context":["https://www.w3.org/2018/credentials/v1","https://schema.iden3.io/core/jsonld/iden3proofs.jsonld","https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld"],"credentialSchema":{"id":"https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json","type":"JsonSchemaValidator2018"},"credentialStatus":{"id":"https://unique-forwaring-or-public-url.ngrok-free.app/v1/did%3Apolygonid%3Apolygon%3Amumbai%3A2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahUQ/claims/revocation/status/2512063162","revocationNonce":2512063162,"type":"SparseMerkleTreeProof"},"credentialSubject":{"birthday":19960424,"documentType":2,"id":"did:polygonid:polygon:mumbai:2qEsg1AeTohAq6Euc3hBaDapfLVfQiWS7DUfvutYEq","type":"KYCAgeCredential"},"id":"http://localhost:3001/v1/did:polygonid:polygon:mumbai:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE/claims/b1eab5be-dea3-11ed-8f7d-0242ac1e0005","issuanceDate":"2023-04-19T11:16:56.433871253Z","issuer":"did:polygonid:polygon:mumbai:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE","proof":[{"type":"BJJSignature2021","issuerData":{"id":"did:polygonid:polygon:mumbai:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE","state":{"claimsTreeRoot":"78b7651adb5d063553f7fdc11d279a3e307880aef6dec2b347abf0df53a11d27","value":"....
# {"@context":["https://www.w3.org/2018/credentials/v1","https://schema.iden3.io/core/jsonld/iden3proofs.jsonld","https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld"],"credentialSchema":{"id":"https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json","type":"JsonSchemaValidator2018"},"credentialStatus":{"id":"https://unique-forwaring-or-public-url.ngrok-free.app/v1/did%3Apolygonid%3Apolygon%3Aamoy%3A2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahUQ/claims/revocation/status/2512063162","revocationNonce":2512063162,"type":"SparseMerkleTreeProof"},"credentialSubject":{"birthday":19960424,"documentType":2,"id":"did:polygonid:polygon:amoy:2qEsg1AeTohAq6Euc3hBaDapfLVfQiWS7DUfvutYEq","type":"KYCAgeCredential"},"id":"http://localhost:3001/v1/did:polygonid:polygon:amoy:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE/claims/b1eab5be-dea3-11ed-8f7d-0242ac1e0005","issuanceDate":"2023-04-19T11:16:56.433871253Z","issuer":"did:polygonid:polygon:amoy:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE","proof":[{"type":"BJJSignature2021","issuerData":{"id":"did:polygonid:polygon:amoy:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE","state":{"claimsTreeRoot":"78b7651adb5d063553f7fdc11d279a3e307880aef6dec2b347abf0df53a11d27","value":"....
```

### Issuing Credential To Polygon ID Wallet User
Expand All @@ -155,11 +155,11 @@ To learn how to issue credentials to a Polygon ID Wallet User, please refer to t
In order to get the credential on the Polygon ID App, the credential QR Code payload is needed.

```bash
curl --location 'http://localhost:3001/v1/did:polygonid:polygon:mumbai:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE/claims/b1eab5be-dea3-11ed-8f7d-0242ac1e0005/qrcode' \
curl --location 'http://localhost:3001/v1/did:polygonid:polygon:amoy:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE/claims/b1eab5be-dea3-11ed-8f7d-0242ac1e0005/qrcode' \
--header 'Authorization: Basic dXNlci1pc3N1ZXI6cGFzc3dvcmQtaXNzdWVy';

# Expected Output:
# {"body":{"credentials":[{"description":"https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld#KYCAgeCredential","id":"b1eab5be-dea3-11ed-8f7d-0242ac1e0005"}],"url":"http://localhost:3001/v1/agent"},"from":"did:polygonid:polygon:mumbai:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE","id":"c01b66f1-d10b-4591-9dd6-8a94db1c112a","thid":"c01b66f1-d10b-4591-9dd6-8a94db1c112a","to":"did:polygonid:polygon:mumbai:2qEsg1AeTohAq6Euc3hBaDapfLVfQiWS7DUfvutYEq","typ":"application/iden3comm-plain-json","type":"https://iden3-communication.io/credentials/1.0/offer"}
# {"body":{"credentials":[{"description":"https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json-ld/kyc-v3.json-ld#KYCAgeCredential","id":"b1eab5be-dea3-11ed-8f7d-0242ac1e0005"}],"url":"http://localhost:3001/v1/agent"},"from":"did:polygonid:polygon:amoy:2qPdb2hNczpXhkTDXfrNmmt9fGMzfDHewUnqGLahYE","id":"c01b66f1-d10b-4591-9dd6-8a94db1c112a","thid":"c01b66f1-d10b-4591-9dd6-8a94db1c112a","to":"did:polygonid:polygon:amoy:2qEsg1AeTohAq6Euc3hBaDapfLVfQiWS7DUfvutYEq","typ":"application/iden3comm-plain-json","type":"https://iden3-communication.io/credentials/1.0/offer"}
```

Take this JSON data, copy, and paste into [https://qr.io](https://qr.io).
Expand All @@ -170,7 +170,7 @@ With the Polygon ID app, open it up and scan the QR code.

!["Polygon ID App Adding Credential"](/img/polygonid-app-claim.png)

### Verifying Credential
<!-- ### Verifying Credential
:::note
Expand All @@ -186,6 +186,6 @@ A quick way to validate this KYCAge Claim is to use [https://verifier-demo.polyg
!["Polygon ID App Generating Proof"](/img/polygonid-app-proof.png)
!["Verifier Proof Verified"](/img/verifier-success-verified.png)
!["Verifier Proof Verified"](/img/verifier-success-verified.png) -->

---
9 changes: 4 additions & 5 deletions docs/issuer-node/issuer-node-api/identity/apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ An example of a `didMetaData` passed in the request body of the `Create Identity
"didMetadata":{
"method": "polygonid",
"blockchain":"polygon",
"network": "mumbai",
"network": "amoy",
"type": "BJJ"
}
}
Expand All @@ -64,8 +64,7 @@ A few variations of the metadata can be:
- network:

- "main"
- "mumbai"
- "goerli"
- "amoy"
- "unknown"

- type:
Expand All @@ -83,7 +82,7 @@ Read more about Identity types on <ins>[Iden3 Docs](https://docs.iden3.io/gettin

The Issuer Node responds by sending a response message that contains:

- `identifier`: Identifier of the Issuer in the standard DID format. For example: `did:polygonid:polygon:mumbai:2qNBWSAsyvaGBpqQVHk3E4cgChaN6ogaZnYCQUyoRQ`
- `identifier`: Identifier of the Issuer in the standard DID format. For example: `did:polygonid:polygon:amoy:2qNBWSAsyvaGBpqQVHk3E4cgChaN6ogaZnYCQUyoRQ`

- `identity state`: It is the state of the identity and contains fields that include `claimsTreeRoot` (Verifiable Credentials are added to the Claims Tree and its root is calculated), `state` (state of identity), and `status` (whether the status of the identity state is confirmed or pending). `identity state` also contains the timestamp when the identity was created (`createdAt`) or updated(`modifiedAt`).

Expand All @@ -101,7 +100,7 @@ The Issuer Node responds by sending a response message that contains:

- `identifier`: Identifier of the Issuer in the standard DID format. For example:

`did:polygonid:polygon:mumbai:2qNBWSAsyvaGBpqQVHk3E4cgChaN6ogaZnYCQUyoRQ`
`did:polygonid:polygon:amoy:2qNBWSAsyvaGBpqQVHk3E4cgChaN6ogaZnYCQUyoRQ`

<a href="https://self-hosted-platform.polygonid.me/#get-/v1/identities" target="_blank">API Reference</a>

Expand Down
36 changes: 22 additions & 14 deletions docs/issuer/issuer-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import TabItem from '@theme/TabItem';

This guide will show you how to configure your Issuer Node.

:::caution
*Polygon Mumbai testnet has been deprecated
:::

## Revocation Status

The revocation status is a core part of the credential, as it is the verifier's way of checking whether or not a credential has been revoked by the issuer. The Issuer Node offers three different ways to check the revocation status of a credential:
Expand Down Expand Up @@ -85,20 +89,21 @@ ISSUER_CREDENTIAL_STATUS_RHS_CHAIN_ID=80002

</TabItem>

<TabItem value="Polygon Mumbai">

<TabItem value="Polygon Main">

```bash
ISSUER_CREDENTIAL_STATUS_ONCHAIN_TREE_STORE_SUPPORTED_CONTRACT=0x16A1ae4c460C0a42f0a87e69c526c61599B28BC9
ISSUER_CREDENTIAL_STATUS_RHS_CHAIN_ID=80001
ISSUER_CREDENTIAL_STATUS_ONCHAIN_TREE_STORE_SUPPORTED_CONTRACT=0xbEeB6bB53504E8C872023451fd0D23BeF01d320B
ISSUER_CREDENTIAL_STATUS_RHS_CHAIN_ID=137
```

</TabItem>

<TabItem value="Polygon Main">
<TabItem value="Polygon Mumbai*">

```bash
ISSUER_CREDENTIAL_STATUS_ONCHAIN_TREE_STORE_SUPPORTED_CONTRACT=0xbEeB6bB53504E8C872023451fd0D23BeF01d320B
ISSUER_CREDENTIAL_STATUS_RHS_CHAIN_ID=137
ISSUER_CREDENTIAL_STATUS_ONCHAIN_TREE_STORE_SUPPORTED_CONTRACT=0x16A1ae4c460C0a42f0a87e69c526c61599B28BC9
ISSUER_CREDENTIAL_STATUS_RHS_CHAIN_ID=80001
```

</TabItem>
Expand Down Expand Up @@ -168,21 +173,22 @@ ISSUER_API_IDENTITY_METHOD={polygonid | custom method}

</TabItem>

<TabItem value="Polygon Mumbai">

<TabItem value="Polygon Main">

```bash
ISSUER_API_IDENTITY_BLOCKCHAIN=polygon
ISSUER_API_IDENTITY_NETWORK=mumbai
ISSUER_API_IDENTITY_NETWORK=main
ISSUER_API_IDENTITY_METHOD={polygonid | custom method}
```

</TabItem>

<TabItem value="Polygon Main">
<TabItem value="Polygon Mumbai*">

```bash
ISSUER_API_IDENTITY_BLOCKCHAIN=polygon
ISSUER_API_IDENTITY_NETWORK=main
ISSUER_API_IDENTITY_NETWORK=mumbai
ISSUER_API_IDENTITY_METHOD={polygonid | custom method}
```

Expand Down Expand Up @@ -231,29 +237,31 @@ Create Identity Payload example:

</TabItem>

<TabItem value="Polygon Mumbai">

<TabItem value="Polygon Main">

```json
{
"didMetadata": {
"method": "polygonid",
"blockchain": "polygon",
"network": "mumbai",
"network": "main",
"type": "BJJ"
}
}
```

</TabItem>

<TabItem value="Polygon Main">

<TabItem value="Polygon Mumbai*">

```json
{
"didMetadata": {
"method": "polygonid",
"blockchain": "polygon",
"network": "main",
"network": "mumbai",
"type": "BJJ"
}
}
Expand Down
Loading

0 comments on commit 226a757

Please sign in to comment.