# The Beginning Hi everyone, this is week 1-3 update for me, [Ifeoluwa](https://x.com/owanikin). (Apologies for not dropping weekly updates, I'll ensure to drop them weekly as we go on). After going through alot of the project ideas for inspiration, the Grandine project ideas on PeerDAS & Rust-KZG jumped right at me. So I spent alot of time in the past ~2weeks on PeerDAS & KZG related topics. I jumped on the [ACD call, where peerDAS](https://www.youtube.com/live/LpY1JQHl9EY) was discussed and listened to a couple other talks listed in the links section. ### General Background To scale Ethereum we need to increase the chain's capacity, reducing the workload on each node, and making transactions cheaper. Currently, this is done via Danksharding => Proto-Danksharding (EIP-4844), PeerDAS... **EIP-4844**, introduces a new transaction type called a "blob-carrying transaction," which carries larger data blobs (around 128kB). Instead of simply hashing the data blob, it is treated as a polynomial using a polynomial commitment, with the commitment accessible from the execution layer. This approach allows for efficient property verification without revealing the entire blob. Polynomial commitments enable data availability sampling (DAS), allowing validators to verify a blob's correctness and availability without downloading the entire data set. **PeerDAS** (Peer Data Availability Sampling) is a networking protocol for Ethereum that ensures blob data availability by sampling only a subset of the data. It uses gossip for distribution, discovery to find peers with specific data, and peer requests for sampling. Larger amounts of data can then be processed and validated without fully verifying every piece. To efficiently do this, we make use of probabilistic sampling and Reed-Solomon coding. Reed-Solomon coding extends data with polynomials, enabling the reconstruction of the entire data set from just a portion, which is stored in blobs instead of blocks. PeerDAS has peers attest to these blobs, ensuring they are distributed and received across the network. Using Reed-Solomon code and KZG cryptography, PeerDAS guarantees that even if part of the data is missing, the available portion ensures the complete data set's availability. ### Mathematical Background Polynomial Commitments let's us hash a polynomial, and make a $proof$ for it's evaluation at any point, usually we call that an opening. For example the committer should be able to prove that $Ο•(a)=b$ without revealing exactly what $Ο•(x)$ is. We want to use it prove that we have some polynomial which satisfies certain properties (in this case, that it passes through a certain point $( π‘Ž , 𝑏 )$)all without revealing what the polynomial is! To construct our KZG polynomial commitment scheme, we need: **Step 1. (A trusted setup):** * With a $g$ generator of some pairing-friendly elliptic curve group $G$ * $l$ being the maximum degree of the polynomials we want to commit to * Pick some random field element $Ο„βˆˆF p$ * Compute $(g,g ^Ο„,g ^{Ο„^2},...,g ^{Ο„^l})$ and release it publicly. Note that $Ο„$ should not be revealed - it is a secret parameter of the setup, and should be discarded after the setup ceremony such that nobody can figure out its value. **Step 2. (Commit to polynomial):** * Given a polynomial $Ο•(x)=\sum_{i=0} ^l ​ Ο• _i ​ x ^i$ * Compute and output commitment $c=g ^{Ο•(Ο„)}$ a. Although the committer cannot compute $g ^{Ο•(Ο„)}$ directly since he doesn't know $Ο„$, he can compute it using the output of the setup $(g,g ^Ο„,g ^{Ο„^2},...,g ^{Ο„^l})$: * $$ \prod_{i=0}^ l( g^{\tau^i} )^{Ο• i} = g\sum_{i=0} ^l ​ Ο• _i ​ Ο„ ^i = g ^{Ο•(Ο„)} ​ $$ **Step 3. (Prove an evaluation):** * Given an evaluaion $Ο•(a)=b$ * Compute and output proof $Ο€=g ^{q(Ο„)}$ * Where $q(x):= {xβˆ’a \over Ο•(x)βˆ’b}$ * This is call the "quotient polynomial". Note tht a $q(x)$ exists if and only if $Ο•(a)=b$. The existence of this quotient polynomial therefore serves as a proof of the evaluation. **Step 4. (Verify an evaluation):** * Given a commitment $c=g ^{Ο•(Ο„)}$, an evaluation $Ο•(a)=b,$ and a proof $Ο€=g ^{q(Ο„)}$ * Verify that $e({c \over g^b}, {g}) = e(Ο€, {g^Ο„ \over g^a})$, where $e$ is a non-trivial [bilinear mapping](https://en.wikipedia.org/wiki/Bilinear_map). * Some algebra shows that this equivalent to checking that the property in **Step 3** holds at $Ο„$: $$q(\tau):= {Ο•(\tau)βˆ’b \over \tauβˆ’a}$$ * The bilinear mapping enables us to check this property without knowing the secret setup parameter $\tau$. * Once this verification is complete, we can conclude that (with overwhemingly high probabiity) the quotient polynomial is correct, and therefore the evaluation is correct. **Next Steps** I'm convinced that i'll be working on PeerDAS related projects with **Grandine** mentioned below: * Rust-kzg - implement/update [PeerDAS related cryptography](https://github.com/ethereum/consensus-specs/blob/dev/specs/_features/eip7594/polynomial-commitments-sampling.md) in [Rust-kzg](https://github.com/grandinetech/rust-kzg), optimize MSM's and the rest of resource-intensive operations. * PeerDAS improvements - the spec is still maturing for PeerDAS so there are a lot of changes and improvements that need to be implemented in Grandine; I'll be spending this week on the Grandine codebase and see how projects listed can be implemented. #### Links https://www.youtube.com/watch?v=fCIPNxGXmmE https://www.youtube.com/watch?v=fCIPNxGXmmE https://www.youtube.com/watch?v=OYRmvloABbQ https://www.youtube.com/watch?v=8L2C6RDMV9Q https://notes.ethereum.org/@vbuterin/proto_danksharding_faq https://hackmd.io/@vbuterin/sharding_proposal#ELI5-data-availability-sampling https://www.youtube.com/watch?v=LmQTRGqUL9s https://scroll.io/blog/kzg?ref=blog.axiom.xyz https://research.polytope.technology/polynomial-commitments https://ethresear.ch/t/easy-proof-of-equivalence-between-multiple-polynomial-commitment-schemes-to-the-same-data/8188/3 https://www.youtube.com/watch?v=_zK_KhHW6og https://hackmd.io/@tazAymRSQCGXTUKkbh1BAg/Sk27liTW9 https://notes.ethereum.org/-G3DfSN7QTCK58P_o3gTCA https://dankradfeist.de/ethereum/2020/06/16/kate-polynomial-commitments.html https://medium.com/@VitalikButerin/exploring-elliptic-curve-pairings-c73c1864e627