4

I am mostly interested in why 7-day fraudulent proof checks exist.

Let's say on L1, I got 10 ETH and I deposited it on L2 as WETH. Now, 10 ETH is locked on L1's bridge contract and 10 WETH is on L2 on my address.

Now, after 3 days have passed, My L2 balance is 5WETH as I transfered another 5 to some other L2 addresses. Now, I initiate the transaction which says to withdraw 5 WETH. State root will be also generated.

What I am curious about is a good scenario with an example where malicious actor (sequencer) can somehow hack the system if fraudulent proof check(7-day check) didn't exist

1

2 Answers 2

4

Since L1 contract doesn't verify anything about submitted blocks apart from some basic stuff, a malicious sequencer can do all kinds of nasty stuff, like for example adding an invalid transaction that mints infinite WETH to his own wallet. He than can submit a withdraw transaction and take all WETH from L1 contract.

Fraud proofs are used to prevent that from happening. If someone detects an invalid L2 state transition, he/she can submit a fraud proof that invalidates new state and slashes the sequencer. 1 week interval is needed to give enough time to detect it and submit the fraud proof. Lower intervals are dangerous because weird circumstances like an extreme network congestion or block stuffing or miners acting weird can prevent users from submitting fraud proofs (this is one of the points where security of an L2 is lower than L1).

4
+100

There are many details to optimistic rollups. Nika's example can be used to explain some of the main ideas.

10 ETH is locked on L1

Note that the L1 rollup contract does not know that the 10 ETH belongs to Nina. The bridge contract on L1 is different from the L1 rollup contract. The L1 rollup contract is basically what sequencers update, and is also what verifies challenges / fraud proofs and reverts incorrect updates.

The L1 rollup contract has the state root of L2, which is the Merkle hash of the L2 state trie.

Sequencers post (L2 state root) updates to the L1 rollup contract. Optimistic rollups have their name because the L1 rollup contract is optimistic in its belief about sequencer updates. The L1 rollup contract believes all updates to be correct... unless a fraud proof is submitted which proves an update to be incorrect, which in that case the update is reverted and the sequencer loses its bond.

Becoming a sequencer requires a bond on L1 so that they can get penalized for posting incorrect updates to the L1 rollup contract.

10 WETH is on L2 on my address

Usually what you deposit on L1 is what you get on L2, so more accurately in this example, Nika has 10 ETH on L2. This means that the L2 state trie has a balance of 10 ETH for Nika.

What happens if there's no fraud proof / challenge / dispute period?

Eve, an evil sequencer, can attempt all kinds of fraud. Here are 2 simple frauds:

She can create a leaf in the L2 state trie that assigns her a balance of 10 ETH (or more). (Nika and Eve both have 10.)

Or instead of her L2 state trie having a balance of 10 ETH for Nika, Eve could have that balance under her account. (Nika has 0, Eve has 10.)

Eve will try to trick the L1 rollup contract to accept a fraudulent L2 stateroot. If she is able to do that, the L1 rollup contract will believe she has balances on L2, and will allow her to withdraw those from the L1 rollup contract.

The challenge period exists so that a verifier (anyone) can submit a fraud proof to the L1 rollup contract, and have Eve's malicious update reverted, and receive part of Eve's bond as a reward.

Dispute periods don't have to be 7 days. The main danger with short periods is censorship attacks. An example of such an attack is someone filling up the blockchain for the entire dispute period, so that the fraud proof is not processed in time by the L1 rollup contract. Each day in the dispute period makes such attacks more expensive.


For a more complicated fraud, Eve could construct an L2 state trie where the contract storage of the WETH contract [on L2] assigns her a balance of 10 WETH (or more). Or she could claim that a transfer to Nika, was to Eve instead. Or that Nika sent Eve funds.

The article @Paul's comment mentions, also suggests reading An Incomplete Guide to Rollups.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.