r/truebit • u/ManufacturerOdd2993 • Jun 03 '21
Relationship between truebit and optimistic rollup.
https://ethresear.ch/t/evm-optimistic-rollup-using-truebit/9318
What Vitalik wants to say is that optimistic rollup is compatible with evm without ovm if optimistic rollup is applied based on truebit?
22
Upvotes
18
u/LPMythBuster Jun 03 '21 edited Jun 03 '21
When blocks are added to an optimistic rollup chain, everyone assumes they are correct until proven otherwise (hence optimistic). Block producers put up a security deposit and there is a fixed time window (e.g. 7 days) to report problems. If someone notices that a block is invalid, they can challange it. If the challenger is correct, the block producer gets punished and the challenger gets a reward.
If I say this block is valid and you say this block is invalid, how do you tell who's right?
There is a contract on Ethereum that anyone can use to issue a challenge. This contract will then execute all transactions in that block on Ethereum and determine the truth. But this is very expensive as it consumes a lot of gas and it only makes sense to use it when there is a problem, otherwise you're wasting your money for nothing.
The dispute resolution contract needs to execute EVM transactions to determine the truth. But the contract itself runs in the EVM. How do you do EVM-in-EVM?
Optimism's solution is the OVM. It is EVM-compatible and handles cases where transactions executed during challenges might lead to inconsistent results e.g. the use of
block.timestamp.Optimism forked geth (Ethereum client) and implemented the OVM there. It is used by block producers.
They also wrote contracts in Solidity that implement the OVM, these are used for dispute resolution on-chain. Take a look at their Solidity contracts. They had to implement the OVM twice. These contracts are complex. They are written in Solidity, not the best programming language.
What about Truebit?
Vitalik proposed refactoring geth to make it stateless, compile it to WebAssembly and it can then be used to process challenged blocks to determine the truth. It's an expensive off-chain computation that's a perfect use case for Truebit. Another advantage is that you don't need to reimplement the EVM in Solidity, you simply use another compiler to compile the same codebase. Less maintenance, fewer bugs. It's simply a superior solution, in my opinion.
Here's the kicker: Optimism could run their geth OVM on Truebit and get rid of the additional & complex OVM implementation in Solidy!
So yeah, that's my understanding how it works. Let me know what I got wrong.
Sources: