The plasma contracts also stores the verification keys of the snarks of 3 different programs: P_transfer , P_deposit , and P_exits for 3 different kinds of state changes. These verification keys allow the plasma contract verifying that the state changes for a new block are actually valid ones.
Plasma コントラクトは、3 種類の state 変更に対応する異なるプログラム：P_transferP_depositP_exitsの SNARKs に対応する verification key も保持している。これらの verification key により、Plasma コントラクトは新しいブロックに対応する state 変更が正当かどうかを検証することができる。
Let us call the program checking the correctness of a state transition based on transfer P_transfer :
transfer に基づいて state 遷移の正しさをチェックするプログラムを P_transfer と呼ぶ。
P_transfer(StateRootHash_i, current block, [witness transactions data]) = (StateRootHash_(i+1))
A transaction is a value transfer from one leaf to another leaf. P_transfer checks the following:
・Leaf of sending account exists
・Leaf of sending account has the needed balance for transfer
・The transfer transaction is signed by the private key associated with the public key stored in the sending leaf and the transaction is intended for the current block height
・Subtracts balance from sending leaf, updates the blockheight of last transfer , updates the StateRootHash
The information of several deposits, which are sent to the plasma contract, can be hashed together to a DepositHash by the plasma contract. By requiring the snark proof to take the DepositHash as a public variable, we can enforce the snark proof to process all deposits.
The same can be done for exits: All exit requests can be collected by the plasma contract. The user submits the exit request to the plasma contract by submitting his address and the height at which he would like to withdraw. This height is in most cases the first unavailable block. The operator is required to react upon each exit request by submitting the withdraw-able balance of the requested height from the plasma chain. Then these information [address, balance, StateRootHash of block of height for request] are hashed together in an ExitRequestHash and by making it a public input the snark, we can enforce the snark to process this exit request.
最新の state に含まれる leaf は、現在引き出そうとしているブロック高より高い block height of last transfer を保有していないか（そうでなければ引き出し可能残高は 0）
処理済みの leaf が削除され、StateRootHash が更新されているか
Unfortunately, exits with a fraction of the balance are not supported by this protocol.
残念ながら、このプロトコルでは残高の部分的な exit はサポートされていない。
Note that the operator needs to set the withdrawal balance, as only he knows for sure the current balance. Still, the snark enforces the operator to set the correct balance, as otherwise he will not be able to find a proof. If someone makes an exit request, which is not valid, the operator will set the balance in the exit to 0. Exit request against non-occupied leaves is prevented by the plasma smart contract.
These three different programs allow the operator to append the plasma chain with 3 different block types (deposits, transfers and exits) by sending over the respective snark prover key. The plasma smart contract would enforce that registered pending exits would be processes at first, forcing the operator to submit exit blocks, before deposit or blocking transfer blocks. Likewise, if there are deposits pending for several blocks, then the plasma contract would force the plasma operator to include deposit blocks before any transfer blocks are accepted. Only if there are no pending deposits or withdrawals, then the plasma chain allows appending transfers blocks.