Contracts

BlockManager is a contract that manages the roots (transfer roots) of multiple transfers committed to a Merkle tree (referred to as an airdrop) in the form of blocks. Operators are required to deposit an amount equivalent to the total value of the airdrop in advance.

RootManager is a contract that oversees all Zero-Knowledge Proofs (ZKPs) utilized in Plasma Next. Within Plasma Next, two types of ZKPs are essential: (a) ZKPs that verify the total amount of airdrops a user has received, and (b) ZKPs that confirm the occurrence of an airdrop. To enhance efficiency, multiple (a) and (b) ZKPs are committed to a Merkle Tree and aggregated into a single ZKP through Recursive ZKP. The Merkle Tree for (a) is referred to as the withdraw Merkle tree, while that for (b) is referred to as the evidence Merkle Tree. Since these ZKPs' public inputs are L2 block hashes, the RootManager queries the BlockManager for block hashes via getBlockHash.

The Main Payment Channel manages payment channels. When closing a payment channel, it queries RootManager with verifyWithdrawMerkleProof to validate the total amount of airdrops used for deposits in the payment channel. It also inquires about additional conditions for settlement from ZKPTLC.

ZKPTLC is a contract that imposes additional conditions on the closing of payment channels. While developers can freely create ZKPTLCs, the default ZKPTLC used in Plasma Next is designed to verify that an operator has airdropped to a receiver. This verification can be conducted by querying RootManager with verifyEvidenceMerkleProof.

The Withdraw Contract supports withdrawals not mediated by payment channels. In scenarios where an operator goes down or censors users, withdrawals can be executed trustlessly through the Withdraw Contract. For withdrawals, it queries RootManager with verifyWithdrawMerkleProof to verify the total amount of airdrops received.

Last updated