# Fraud Proofs

{% embed url="<https://twitter.com/VitalikButerin/status/1164113090843164674>" %}

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`[here](https://github.com/plasma-group/pigi/blob/master/packages/contracts/contracts/RollupChain.sol#L132-L208).

Learn more about Optimistic Rollup:‌

* ​[Ethereum Smart Contracts in L2: Optimistic Rollup](https://medium.com/plasma-group/ethereum-smart-contracts-in-l2-optimistic-rollup-2c1cef2ec537)​
* ​[The Dawn of Hybrid Layer 2 Protocols](https://vitalik.ca/general/2019/08/28/hybrid_layer_2.html)
* ​[Minimal Viable Merged Consensus](https://ethresear.ch/t/minimal-viable-merged-consensus/5617)
* [Optimistic Rollup Github Code](https://github.com/plasma-group/pigi/blob/master/packages/contracts/contracts/RollupChain.sol)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://unipig.plasma.group/optimistic-rollup-1/fraud-proofs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
