Hi there, it's Agnish again. After racking my head over ALOT of topics, and even more github issues, I am finally able to narrow down, what I REALLY want to contribute and work on for this EPF Cohort.
So, this week I have dived deep into Verkle trees and how the roadmap of Stateless Ethereum is being planned. I'm doing an overall update of whatever I've learnt in this domain for the past week.
I started off with Vitalik's first Verkle Tree post, he repeatedly referred to the first by Verkle Tree paper by Kuszmaul back in 2018. He also discussed about the merits of VKT over Merkle trees with the most important ones being :
index of the of the particular child
and it's path leading towards the root
.So here's a basic comparison table stating the exhaustive details of PROOF SIZES
for both MKT and VKTs:
Trie | Specifics in each proof | Levels | Proof Size | Cryptographic Reqs |
---|---|---|---|---|
Merkle Patricia Trie | leaf data + 15 siblings, 32 bytes for each level | ~7 | ~3.5 MB for 1,000 leaves | Collision-resistant hash functions |
Verkle Trie | leaf data + Polynomial Comm + value + index of child, which is 32 bytes , another 32 bytes + 1 byte + small constant size data |
~4 | ~150 KB for 1,000 leaves | Earlier (for Eth1 State): KZG Polynomial Comms (based on Billinear Pairings) with BLS12_381 curve, Now (for Eth2): Pedersen Commitments with Bandersnatch/Banderwagon |
In real world scenarios, we can use a polynomial commitment
as a vector commitment
to generate proof for the root of a Verkle Trie.
Polynomial Commitments let's us hash a polynomial, and make a proof for it's evaluation and any
point, usually we call that an opening
.
First we need to agree upon a standardized set of coordinates, let us call it
This method is used to interpolate a given dataset and find the lowest possible degree polynomial that passes through the points of the dataset.
The Lagrange Interpolation for points/nodes
where,
To understand this better, you can tweak with this, Desmos graphing calculator.
Here, I have plotted 4 arbitrary points,
This was the given polynomial, with
And hence, the curve would look like this:
This Lagrange Interpolation method can be used for computing polynomial commitments for both KZG and Bulletproof-style commitments (IPA).
VKT for Eth1 was largely based on KZG Polynomial Commitment Schemes. Initially, in a Merkle Tree of depth d
, we could compute a commitment to a vector for elements in the Merkle Tree, which is,
By the definition of Polynomial Commitments, we define a polynomial
Also, here the degree of the polynomial is the depth of the tree
Let
for any setup
Now, let us assume that we have a trusted setup, so that for some secret
Now, with ecc it's impossible to find out what actually is from the trusted setup group elements. It's a number in the finite field, but the prover cannot actually know the original number. They can only perform a certain set of group operations.
Hence, given that if
Hence this can be represented as a group element.
In this way, everyone can evaluate a polynomial without knowing really what
Let
These entire process DOES NOT need a trusted setup ceremony like KZG.
Note that here
As any element
The commiter commits herself to an
Such a commitment can be again revealed later by revealing
I am yet to read more about the merits of Bandersnatch Modulus over BLS12_381 curve, how it is a 42%
improvement over the Jubjub curve and how it's implemented using the GLV multi-scalar multiplication method, and the deeper math behind how Multiproofs are computed using Inner Product Arguments.
Hoping to cover all of that by this week! I hope to dive deeper and work on the Hyperledger Besu implementation Verkle Tries in this github repo.
I hope draft improvements of this Github repo in my project proposal as well. Also, looking forward to understanding more on State Expiry, Address Size Extensioning for several periods of data on Ethereum, and finally Portal Networks.
Happy Reading!