Skip to main content

World ID State Replication

World ID is an identity protocol that relies on biometrics and zero-knowledge proofs to enable privacy-preserving personhood verification. It's a vital component of the WorldCoin ecosystem.

WorldCoin keeps a Merkle tree of all existing identities on Ethereum Mainnet. The root of this tree is used in on-chain zero-knowledge proofs. Thus, it must be replicated to any chain where users want to use their World ID.

World ID state bridge

To enable cross-chain usage, WorldCoin has implemented the World ID State Bridge.

WorldIDIdentityManager contract on Ethereum Mainnet calls propagateRoot() methods on the state bridge contracts that, in turn, leverage the L1-L2 messaging to propagate the latest state. Currently, the replication is supported for Polygon(PoS), Optimism, and Base chains. This elegant solution doesn't require any off-chain infrastructure or additional effort from the DApp developers.

However, this approach also has some limitations:

  • It can only be scaled to Ethereum's L2s like Polygon and Optimism because it relies on the L1-L2 communication protocols
  • Gas fees for propagateRoot() calls are paid by the WorldIDIdentityManager owner and are paid on the Ethereum Mainnet, which is expensive
  • L1-L2 communication protocols have a latency of up to 40 minutes when propagating the messages to the L2 (depending on its finality model)

Rarimo's cross-chain state replication on-demand

Rarimo has faced the same challenges when implementing its cross-chain identity protocol. As a result, an on-demand cross-chain state replication protocol was created.

In a nutshell, it's a hub-and-spoke where the source chain is the single source of truth. Each target chain has a lightweight state contract updated on-demand when a user wants to submit proof. The state updates are protected from spoofing by a decentralized network of oracles observing the state updates on the source chain and a decentralized network of validators that secures these updates with a threshold signature(TSS).

Let's look at its inner workings in more detail by following the state replication from Ethereum to Polygon:

The key benefits of this solution are:

  • Decentralization and resilience. There's not a single point of centralization in the entire flow;
  • Security. The destination chains are protected from state spoofing by a decentralized network of oracles and validators with material incentives(PoS);
  • Cost efficiency. The solution can be scaled to any number of destination chains because the lightweight state contracts are only updated on demand. The use of TSS makes the state updates as cheap as checking a single ECDSA signature. The fees can be paid either by the user or a relayer service;
  • State relevancy. The on-demand approach ensures that the state is always recent on any target chain;
  • Support for any EVM-compatible destination chains. WASM-based options can be reasonably easily added upon a request;