KZG
This is a polynomial commitment scheme due to Kate, Zaverucha and Goldberg. It leverages the properties of elliptic curves such as BLS12381. They have two interesting properties. First, the discrete log problem is hard. Second they have a bilinear operation called pairing, that allows for homeomorphic encryption up to one multiplication.
Setup
For KZG to work, an additional step is required at the beginning. This step is called the setup. First, everyone agrees on a group and a generator . Normally is chosen as a high-order prime subgroup of a secure elliptic curve. Then, a trusted third-party samples a random and computes the following:
Then, must be thrown away. Sometimes is called the toxic waste. If someone knew then the PCS would be insecure.
Commit
In the commitment phase wants to commit to a polynomial . To do this, it computes:
Using the homeomorphic properties of the elliptic curve, we can evaluate the encryption of any polynomial at , by just knowing the encryptions of .
Open
The verifier asks for . The prover wants to send , without revealing additional information about (hiding). Also, he wants to convince that he's still using the same polynomial (binding). To do this, computes an auxiliary polynomial . Then, just like in the commitment step it computes:
Then outputs where .
Verify
The verifier accepts if the following is true:
This expression is equivalent to:
Because of the bilinearity, the pairings can be transformed to multiplications in the "plaintext" domain. Also, the multiplications in can be transformed to additions. Then we have that the latter equation holds if and only if the following holds:
This will hold if and only if so the verifier is convinced.