User State Transition
Why users have to perform user state transition?
User state transition is used to
- Make sure users process their attestations correctly including the bad reputation.
- Generate a new user state in a new epoch to prove the latest reputation.
After user performs user state transition, he can
- Prove the latest reputation status.
- Generate new epoch key proofs to receive attestations in the latest epoch.
Workflow of a user state transition
1. User computes epoch key of the latest transition (or sign up) epoch
2. Update user state tree
3. Check if epoch tree root matches computed hashchains and epoch keys
4. Compute a new global state tree leaf
const newLeaf = hash(idCommitment, userStateTreeRoot)
5. Call UniRep smart contract to insert a new global state tree leaf
User performs user state transition by calling updateUserStateRoot()
- User will attach a User State Transition Proof when calling
updateUserStateRoot
. Others can make sure if the user state transition is correct by verifying the User State Transition Proof. - Once the user performed user state transition, his user state will be inserted into the global state tree of the latest epoch.
- So if a user does not perform user state transition during an epoch, his user state will not be in the global state tree of that epoch.
info