Skip to content

Commit

Permalink
Merge pull request #153 from 0xPolygonID/sync-develop-and-main
Browse files Browse the repository at this point in the history
Sync develop and main
  • Loading branch information
amonsosanz authored May 13, 2024
2 parents 6baeea5 + 15f844a commit 592fa76
Show file tree
Hide file tree
Showing 81 changed files with 1,389 additions and 1,359 deletions.
1 change: 0 additions & 1 deletion .github/workflows/deployment_new_aws_account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ env:
AWS_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
ECR_REPOSITORY: devs-ecr
ECS_SERVICE: devs-ecs-service
ECS_CLUSTER:

jobs:
deploy_prod:
Expand Down
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@ keywords:

## Question

Why do I encounter an error stating "unexpected status code: 404" when trying to create an identity, specifically while publishing the state to the Reverse Hash Service?
Why do I encounter an error stating "unexpected status code: 404" when trying to create an identity, specifically while publishing the state to the RHS?

## Answer

The error you're experiencing is typically due to an incorrect configuration of `ISSUER_CREDENTIAL_STATUS_RHS_MODE` and an invalid `ISSUER_CREDENTIAL_STATUS_RHS_URL`. This occurs when `ISSUER_CREDENTIAL_STATUS_RHS_MODE` is set to `OffChain`, but the provided RHS URL is not a valid endpoint.

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:

- `ISSUER_CREDENTIAL_STATUS_ONCHAIN_TREE_STORE_SUPPORTED_CONTRACT`=0x76EB7216F2400aC18C842D8C76739F3B8E619DB9
- `ISSUER_CREDENTIAL_STATUS_RHS_CHAIN_ID`=8001
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

Choosing `ISSUER_CREDENTIAL_STATUS_RHS_URL=None` indicates that the issuer node will handle revocation credential status resolution internally, and no further RHS setup is required.

Expand All @@ -35,5 +34,4 @@ For a comprehensive understanding and configuration guidance, please review the
Wrong answer:

Simply replace the RHS URL with the Issuer Node URL or remove the `ISSUER_CREDENTIAL_STATUS_RHS_URL` from your .env-issuer file without adjusting the `ISSUER_CREDENTIAL_STATUS_RHS_MODE` setting or ensuring the RHS endpoint's validity.

</div>
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 @@ -16,7 +16,7 @@ How can I configure and use the Issuer Node on the Polygon mainnet?

## Answer

The Issuer Node is designed to operate on EVM-compatible networks, supporting both testnets and mainnet environments. It comes pre-configured for use on the Polygon/Mumbai networks, with contracts readily available for those networks. For deployment on other blockchains, you will need to manually deploy the necessary contracts.
The Issuer Node is designed to operate on EVM-compatible networks, supporting both testnets and mainnet environments. It comes pre-configured for use on the Polygon/Amoy networks, with contracts readily available for those networks. For deployment on other blockchains, you will need to manually deploy the necessary contracts.

To configure the Issuer Node for mainnet operation, adjust the following environment variables within your `.env-issuer` file:

Expand Down
1 change: 0 additions & 1 deletion docs/faqs/content/issuer-node-reusing-issuer-did.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ If you **have not deleted the database** and wish to reuse a previously configur
Wrong answer:

If you want to reuse a previously used DID, it's sufficient to manually edit the database entries to reflect the old DID, bypassing the need to update environment files or restart any services. This direct database manipulation ensures immediate reuse of the DID without considering system synchronization or security implications.

</div>
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
4 changes: 2 additions & 2 deletions docs/issuer-node/install-kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export ISSUERNAME="My Issuer"
export ISSUER_ETHERUM_URL="https://polygon-network.XXXX"
export INGRESS_ENABLED=true
export VAULT_PWD=password
export RHS_MODE=None
export RHS_MODE=None
export RHS_URL="https://reverse-hash-service.com"
```

Expand Down Expand Up @@ -142,7 +142,7 @@ export ISSUERNAME="My Issuer"
export ISSUER_ETHERUM_URL="https://polygon-network.XXXX"
export INGRESS_ENABLED=false
export VAULT_PWD=password
export RHS_MODE=None
export RHS_MODE=None
export RHS_URL="https://reverse-hash-service.com"
```

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) -->

---
Loading

0 comments on commit 592fa76

Please sign in to comment.