Fraud Proofs
Last updated
Was this helpful?
Last updated
Was this helpful?
Challenges are the only time when OR transactions actually get executed on-chain. In order to prove the invalidity of a state root, a challenger needs to submit (on-chain) the invalid transition and the transition immediately before it. The challenger also provides the contract with all of the parts of the previous state that will be changed by applying the OR transactions of the invalid transition (e.g. if we have a transaction sending 1 ETH from Alice to Bob, we would include Alice and Bob's balances). All of these pieces of evidence together constitute what is called a "fraud proof".
Upon receiving the fraud proof, the rollup contract will first verify that the two transitions were sequential and included in rollup blocks. It will then store the state from the previous transition and apply each of the OR transactions from the invalid transition. The contract will compute the state root of the resulting state and compare it to the originally submitted invalid state root. If the two state roots are the same, then the challenger has just wasted a lot of gas fees challenging a valid transition. If the two state roots are different, then the challenger will be rewarded the deposit of whoever submitted the OR block containing the invalid state root.
For more details, check out the code for verifying fraud proofs in Rollup.sol
.
Learn more about Optimistic Rollup:‌
​​
​
​