nimbus-eth1 icon indicating copy to clipboard operation
nimbus-eth1 copied to clipboard

Get ahead on statelessness/Verkle

Open AdamSpitz opened this issue 1 year ago • 1 comments

This is a pie-in-the-sky kind of thing; obviously it'll be quite a long time before the Ethereum protocol ends up moving to Verkle. But I feel like this is a feature where we might want to get ahead of the curve and champion it; statelessness is a good fit for Nimbus's positioning as a low-resource-requirement client.

Anyway, the goal here is: make a Verkle-enabled (probably stateless) version of nimbus-eth1 that can participate in the Verkle-tree Kaustinen testnet.

Some background that I got from talking to Guillaume:

  • There's no spec for this stuff yet, only his Go code. So we'd have to port that code to Nim. The hardest part of this will (he thinks) probably be the cryptography library.
  • Guillaume doesn't yet have a stateless client; he has a version of geth that uses Verkle trees in a stateful way. Stateless would probably be easier to implement (given that we're starting from scratch), but he hasn't actually gotten around to implementing that yet; he says he'd be interested in having an actual stateless client exist, for the purpose of demoing it and trying to drum up interest in the wider Ethereum community and so on.

The idea is:

  • The CL will give the EL a couple of new fields in the execution payload; this is the Verkle witness. (See here.)
  • Then the EL will need to convert the proof into a (partial, of course) state tree. Basically we need to port the TreeFromProof function from Guillaume's go-verkle library.
  • Then the EL runs the block, using that state tree. (If any data is missing, it means the witness is invalid.) See here for some relevant code from Guillaume's geth branch. Also look at the first import in that file, here, which is the cryptography library we'd need to port.

AdamSpitz avatar Jan 27 '23 15:01 AdamSpitz

Here's the draft EIP.

AdamSpitz avatar Jan 27 '23 15:01 AdamSpitz