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