Skip to main content

Polygon ID State Replication

Polygon ID is a self-sovereign identity protocol that allows users to use zero-knowledge proofs to interact with smart contracts based on rich Verifiable Credentials. However, the on-chain usage is limited to the chain to which the credentials are anchored. To explore the synergy between the protocols, a demo that showcases cross-chain Zero-Knowledge Proofs using existing Polygon ID identities was built.

The goals of this demo are:

  • Enable usage of Polygon ID ZK proofs on Ethereum Mainnet;
  • Use the Polygon chain as the single source of truth;
  • Keep the gas costs for syncing the state reasonably low;

The Iden3 Identity State(pictured below) is proposed to make the ZK Proofs feasible on other chains. However, replicating each state change to each supported chain is unreliable and costly.

On-demand state replication using Rarimo's cross-chain infrastructure is proposed to mitigate these issues. Rarimo oracles will replicate the complete identity state history to a State Contract on the Rarimo Protocol chain. State Contracts on the other chains will be modified to accept lazy state updates. The updates will be secured by Rarimo's TSS instead of the state transition proofs used by Iden3.

In order to prove a statement on the Ethereum chain, the relayer will fetch a state update transaction from the Rarimo API and submit it just before the user submits the ZKP. This way, the state will be used only when it's needed.

The user then generates a ZKP using the Polygon ID Wallet app and submits it to the verifier contract using Metamask.

Demo walkthrough

To complete the demo and claim a soulbound token on Ethereum's Sepolia Testnet, follow these steps:

  1. Install Polygon ID Wallet from AppStore or Play Market and create an identity;
  2. Get a KYC Age credential by scanning a QR code here with your Polygon ID Wallet. Then, wait 2 minutes for the identity provider state to be committed and propagated on-chain;
  3. Open the Demo DApp and scan the QR-code with your Polygon ID Wallet. Confirm the proof generation;
  4. Once the DApp receives the proof, submit it to the Verifier Contract using MetaMask;