There are three steps in user state transition (see user state transition proof), and they should be performed in order.
Start user state transition
/*** @dev User submit a start user state transition proof* publicSignals[0] = [ blindedUserState ]* publicSignals[1] = [ blindedHashChain ]* publicSignals[2] = [ globalStateTree ]* @param publicSignals The public signals of the start user state transition proof* @param proof The The proof of the start user state transition proof*/functionstartUserStateTransition(uint256[] memory publicSignals,uint256[8] memory proof) external
After start user state transition proof event is emitted, the proof will be assign a proof index, which will be attached to updateUserStateRoot function.
The proof index can be queried by proof hash. And the proof hash can be computed by
/*** @dev User submit a process attestations proof* publicSignals[0] = [ outputBlindedUserState ]* publicSignals[1] = [ outputBlindedHashChain ]* publicSignals[2] = [ inputBlindedUserState ]* @param publicSignals The public signals of the process attestations proof* @param proof The process attestations proof*/functionprocessAttestations(uint256[] memory publicSignals,uint256[8] memory proof) external
/*** @dev User submit the latest user state transition proof* publicSignals[0] = [ newGlobalStateTreeLeaf ] * publicSignals[1: numEpochKeyNoncePerEpoch] = [ epkNullifiers ] * publicSignals[1+ numEpochKeyNoncePerEpoch] = [ transitionFromEpoch ] * publicSignals[2+ numEpochKeyNoncePerEpoch: 3+ numEpochKeyNoncePerEpoch] = [ blindedUserStates ] * publicSignals[4+ numEpochKeyNoncePerEpoch] = [ fromGlobalStateTree ] * publicSignals[5+ numEpochKeyNoncePerEpoch: 4+2*numEpochKeyNoncePerEpoch] = [ blindedHashChains ] * publicSignals[5+2*numEpochKeyNoncePerEpoch] = [ fromEpochTree ] * @param publicSignals The the public signals of the user state transition proof* @param proof The proof of the user state transition proof* @param proofIndexRecords The proof indexes of the previous start transition proof and process attestations proofs*/functionupdateUserStateRoot(uint256[] memory publicSignals,uint256[8] memory proof,uint256[] memory proofIndexRecords) external
The proofIndexRecords is the proof indexes of all startTransitionProof and processAttestationsProof that are submitted sequentially. See Start user state transition and Process attestations.