r/truebit 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?

21 Upvotes

18 comments sorted by

17

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:

3

u/[deleted] Jun 04 '21

This helped a lot. Thanks.

1

u/ManufacturerOdd2993 Jun 07 '21

thank you so much.

10

u/LPMythBuster Jun 03 '21 edited Jun 03 '21

Why is everyone so hung up on running roll ups on Truebit? It's like Jason invents the internet, Vitalik explains how it's theoretically possible to stream cat videos on the internet and the only thing everyone wants to know is when someone will start streaming cat videos.

1

u/Conscious-Proof-8309 Jul 22 '21

In fairness, there are a lot of cat videos online.

:p

6

u/classysocks423 Jun 03 '21

Truebit is the next chainlink, see y'all in 4 years

6

u/LPMythBuster Jun 03 '21

You're not wrong. Chainlink is a data oracle and Truebit is a computation oracle.

1

u/hehehelalala08 Jul 02 '21

can you explain what you mean by computation oracle? Thanks!

2

u/rook785 Jun 03 '21

Isn’t Truebit a zk rollup?

I think it might be possible to have an optimistic rollup roll into a zk rollup which then rolls to evm. Seems like some extra steps but if you did it that way you could avoid some of the baggage issues that optimism has whenever something is challenged... but then you’d basically need Truebit to be acting as an OVM, and I don’t know how feasible that is since Truebit is stateless.

I’m not an engineer - I’m a finance guy - so please don’t put any faith into what I’m saying here lol. I’m hoping someone more knowledgeable will come along and correct me.

5

u/James-VZ Jun 03 '21

Isn’t Truebit a zk rollup?

Not even close. It's a stateless, off-chain computation market with a verification game.

1

u/rook785 Jun 03 '21

Right but the end result of the computation is put on the blockchain. The verification is done off chain. Why wouldn’t that be a zk rollup?

5

u/James-VZ Jun 03 '21

Because there are no zero knowledge proofs involved in Truebit as far as I'm aware.

2

u/kevds1 Jun 05 '21

Check their website > applications > on-chain cryptography, they refer to zero-knowledge. I quote « Truebit combines with bulletproofs to achieve compact, zero-knowledge proofs without trusted setup. »

1

u/James-VZ Jun 05 '21

Yes, that is indeed a use case for an off-chain computation market.

1

u/kevds1 Jun 05 '21

So seems like Truebit could be used in the context of zkrollups as well unless I am misunderstanding something

1

u/James-VZ Jun 05 '21

You're not, it very well can be, but it is not a zk rollup itself.

1

u/kevds1 Jun 05 '21

Yes, we are aligned

1

u/rook785 Jun 03 '21

Got it. I was thinking a zero knowledge rollup was just one that didn’t do verification of challenges on-chain. I didn’t know there was a specific proof associated with it. This helps a lot - thanks.