taiko-mono icon indicating copy to clipboard operation
taiko-mono copied to clipboard

feat: skip checking withdrawalsRoot in circuits and client

Open dantaik opened this issue 1 year ago • 4 comments

As of now, the withdrawalsRoot in Taiko blockheader is the hash of a list of EthDeposits from L1 to L2. In both circuits and client, we check this value is correctly calculated and matches the actual EthDepoisits.

To simpify the code is to enforce withdrawalsRoot to have the value of the empty MPT withdrawals root (not 0x0) . In the circuits, verify the hash of the list of EthDeposits actually match the value used by the protocol to calculate the right metahash.

Screenshot 2023-05-22 at 22 41 52

dantaik avatar May 22 '23 14:05 dantaik

To simpify the code is to enforce withdrawalsRoot to have the value of 0x1 (not 0x0)

If we set it to some constant value, I think better to use the empty MPT withdrawals root as the constant because then the block header still looks like a standard Ethereum one.

Brechtpd avatar May 22 '23 15:05 Brechtpd

An updated diagram based on the above idea is here: https://github.com/taikoxyz/taiko-mono/blob/prover_req_diagram_depositsRoot/packages/protocol/docs/how_taiko_proves_blocks.md

dantaik avatar May 22 '23 15:05 dantaik

FYI right now the empty hash for the withdrawals is the empty code hash, not empty MPT withdrawals hash. https://github.com/taikoxyz/taiko-mono/issues/13795

cyberhorsey avatar May 22 '23 18:05 cyberhorsey

FYI right now the empty hash for the withdrawals is the empty code hash, not empty MPT withdrawals hash. #13795

yep its because the empty code hash is equal to keccak256(zero bytes) which is the current protocol implementation, if we don't want do the keccak256 hash for the withdrawals anymore in protocol, we need to change back to the empty MPT withdrawals hash.

davidtaikocha avatar May 23 '23 02:05 davidtaikocha

I think we can just leave the implementation as-is?

dantaik avatar Jul 15 '23 07:07 dantaik