Introduction to KZG (Kate) commitments
How to hash polynomials
Dankrad Feist
Ethereum Foundation (Eth2.0 Research)
Outline
Motivation: Data availability sampling and Erasure coding
Data Availability Sampling
Erasure coding
d0
d1
d2
d3
e0
e1
e2
e3
Original data
Polynomial extension (degree 3)
Merkle roots as Data Availability Roots
Root
d0
d1
d2
d3
e0
e1
e2
e3
But if we just use Merkle roots, then we still need to worry about the extension being correct
d0
d1
d2
d3
e0
e1
e2
e3
Original data
Polynomial extension (degree 3)
I’ll just make up the extension!!! They will never be able to reconstruct the data!!!
What if we could find a kind of commitment (“Merkle root”) that always commits to a polynomial?
Finite fields
Finite fields: Definition
Finite fields: Let’s look at 𝔽5
0 | - | |
1 | 1 | 1 * 1 = 1 |
2 | 3 | 2 * 3 = (6 = ) 1 |
3 | 2 | 3 * 2 = (6 = ) 1 |
4 | 4 | 4 * 4 = (16 = ) 1 |
“Hashing polynomials”
Reminder: polynomials
Polynomial commitments:
“Hash function” for polynomials
Polynomial hashes: The “random evaluation”
Polynomial hashes: Properties of “random evaluation”
The problem with “random evaluation”
Elliptic curves to the rescue
KZG commitments
we define the KZG commitment to f as
KZG (Kate) commitments
Quick recap: pairings
Doing multiplications using pairings
Doing polynomial multiplications using pairings
is a polynomial exactly if f(z) = y.
Restating, there exists a polynomial q(X) that fulfills the equation
if and only if f(z) = y
The last missing piece: Polynomial quotients
and send [q(s)]1
e([f(s)-y]1, [1]2) = e([q(s)]1,[s-z]2) = [q(s) * (s-z)]T = [f(s) - y]T
The KZG proof
Recap: KZG commitment
Further reading materials