KZG Commitment Scheme
One of the most widely used polynomial commitment schemes is the KZG commitment scheme. The scheme was originally published in 2010 by Kate, Zaverucha, and Goldberg.
KZG is used in Ethereum’s Proto-Danksharding, and is also used in Scroll’s proof system.
This article will give an overview of the KZG commitment scheme.
Preliminaries and notation
Recall the premise of polynomial commitment schemes. We have some polynomial that we would like to commit to. We’ll assume the polynomial has a degree less than .
KZG commitments rely on elliptic curve pairings. Let and be two elliptic curve groups of order , with a non-trivial bilinear mapping . Let be a generator of , and a generator of . We will use the notation and , where .
1. Trusted setup
Before computing any KZG commitments, a one-time trusted setup must be performed. Once the trusted setup is completed, it can be reused to commit and reveal as many different polynomials as desired. The trusted setup works as follows:
- Pick some random field element
- Let be the maximum degree of the polynomials we want to commit to
- The trusted setup will only enable commitments to polynomials of degree
- Compute and , and release these values publicly.
Note that should not be revealed - it is a secret parameter of the setup, and should be discarded after the trusted setup ceremony is completed so that nobody can figure out its value.
There are established methods of conducting trusted setup ceremonies with weak trust assumptions (1-out-of-N trust assumption) using multi-party computation (MPC). For more on how trusted setups work, see this post by Vitalik.
2. Committing to a polynomial
- Given a polynomial
- Compute and output the commitment
- Although the committer cannot compute directly (since he doesn’t know ), he can compute it using the output of the trusted setup:
- Although the committer cannot compute directly (since he doesn’t know ), he can compute it using the output of the trusted setup:
3. Prove an evaluation
- Given an evaluation
- Compute and output the proof
- Where
- This is called the “quotient polynomial.”Note that such a exists if and only if . The existence of this quotient polynomial therefore serves as a proof of the evaluation.
- Where
4. Verify an evaluation proof
- Given a commitment , an evaluation , and a proof
- Verify that
- Some algebra shows that this is equivalent to checking that the quotient polynomial is correctly formed at :
- The bilinear mapping enables us to check this property without knowing the secret setup parameter
- Once this verification is complete, we can conclude that (with overwhelmingly high probability) the quotient polynomial is correctly formed, and therefore that the evaluation is correct.
Learn more
- https://dankradfeist.de/ethereum/2020/06/16/kate-polynomial-commitments.html
- https://alinush.github.io/2020/05/06/kzg-polynomial-commitments.html
- https://www.iacr.org/archive/asiacrypt2010/6477178/6477178.pdf