Skip to content

State Contract


State.sol - Github

The State Contract stores the Global Identity State Tree. The GIST State represents a snapshot of the states of all the identities operating in the system. The design of the State Contract allows identities to authenticate themselves using Identity Profiles

Every time that an identity is updated, for example when a credential is issued using SMT Proof or revoked, it needs to perform a State Transition. This process consists of generating a zk-proof or a digitally signed message that proves that the identity is authorized to perform the state transition. Then State contract verifies the proof on-chain via its transitState (for zk-proofs) or transitStateGeneric (generic as name suggests) function.

Note that the actual zk-proof verification is performed by calling the verifyProof function inside the verifier.sol from the transitState function inside the State Contract.

Whenever an identity is updated, the State contract updates the corresponding leaf of the GIST Tree. This process is managed by the SMTLib which is a Sparse Merkle Tree implementation that manages the GIST Tree and keeps track of its history.

The verifier.sol contract is automatically generated using circom and can be used as a standalone contract to verify state transition zk-proof. State implements further logic once the proof is verified (such as updating the GIST State).

State contract addresses

IdentityTreeStore.sol - Github

The identity tree store contract is responsible for storing revocation and roots tree nodes of Identity. In case when identity is using onchain RHS and Iden3OnchainSparseMerkleTreeProof2023 credential status.

IdentityTreeStore contract addresses (On-chain RHS)