Commitment Schemes
Commitment schemes from pedersen to KZG

This page is under construction
Existing content is being updating and will be changed soon.
Commitment Schemes
Commitment schemes are essential for many cryptographic protocols, especially in zero-knowledge proofs where a prover needs to commit to certain values without revealing them immediately. They provide a way to “lock” a value in a way that can be verified later.
Definition (Commitment scheme). A commitment scheme is a tuple (Setup, Commit, Open) of PPT algorithms where:
-
takes security parameter (in unary) and generates public parameters ;
-
takes a secret message and outputs a public commitment and (optionally) a secret opening hint (which might or might not be the randomness used in the computation).
-
verifies the opening of the commitment to the message provided with the opening hint .
💡 Key Properties:
- 🔒 Binding: The committer cannot change the committed value after the commitment is made.
- 🔍 Hiding: The commitment does not reveal information about the committed value.
A commitment scheme is 🔒 binding if for all adversaries :
Informally, this states that a valid commitment to a message is binding if no adversary can produce a valid opening to some different message .
A commitment scheme is 🔍 hiding if for any polynomial-time adversary :
Informally, this states that if a commitment is hiding if an adversary cannot “reverse-engineer” which of their messages was committed to.
Definition (Commitment scheme). A commitment scheme is a tuple (Setup, Commit, Open) of PPT algorithms where:
-
takes security parameter (in unary) and generates public parameters ;
-
takes a secret message and outputs a public commitment and (optionally) a secret opening hint (which might or might not be the randomness used in the computation).
-
verifies the opening of the commitment to the message provided with the opening hint .
Vector Commitment
A vector commitment scheme for the message space is a commitment scheme for a vector .
The main security property for a vector commitment is position binding:
Definition (Position binding). A vector commitment scheme is position binding if for any PPT adversary :
Informally, this states that no adversary can open to two different values at the same position.
Pedersen Commitment
Vector Pedersen commitment. The Pedersen commitment [9] is a binding and hiding commitment scheme for the message space . For a secret message :
-
, where is a cryptographic group of order .
-
, where is a random secret.
-
the prover reveals and , and the verifier checks
Note that the Pedersen commitment is additively homomorphic:
Interactive Pedersen Calculator
Commitment Result:
This is a simplified implementation using:
- Generator g = 7
- Generator h = 11
- Prime modulus p = 2147483647
In real applications, these would be carefully chosen cryptographic parameters.
Vector Pedersen Commitment
Vector commitments allow committing to a vector of values while being able to open the commitment at specific positions. They are particularly useful in applications where you need to commit to multiple values at once.
🔢 Mathematical Definition:
Where:
- is the vector to commit to
- is a random value (blinding factor)
- are independent group generators
- is another independent group generator
🔍 Applications: Vector commitments are used in:
- Verifiable databases where you need to prove membership of elements
- Zero-knowledge proofs for multiple values
- Blockchain systems for committing to multiple transactions
⚡ Efficiency Considerations: The main challenge with vector commitments is efficiency, especially as the vector size grows. Various optimizations exist to make vector commitments more practical:
- Merkle trees for logarithmic-sized proofs
- Polynomial commitments for batch openings
- Specialized constructions like KZG for vectors
Vector Commitment Example
Consider a vector of 3 values: [5, 12, 7]
g₁ = 3, g₂ = 5, g₃ = 7
h = 11
r = 9
Commit([5, 12, 7], 9) = 11⁹ · 3⁵ · 5¹² · 7⁷
= 2,357,947,691 (mod p)
To open just the second position (value 12), the prover would provide the value 12 and a proof that this value is indeed at position 2 in the committed vector.
Polynomial Commitment
A univariate polynomial commitment scheme (PCS) is a commitment scheme for the message space , the ring of univariate polynomials with maximum degree and coefficients in the field
It supports an argument of knowledge for proving the correct evaluation of a committed polynomial at a given point. A lot of information can be encoded in a polynomial: an arbitrary relation can be represented as a polynomial.
🔗 Pairing-based cryptography
Given cyclic groups , all of the same prime order , a pairing is a nondegenerate bilinear map
-
bilinear:
-
nondegenerate: with generators and is a generator.
KZG Polynomial Commitment
KZG (Kate-Zaverucha-Goldberg) polynomial commitments allow committing to a polynomial and later proving evaluations of that polynomial at specific points. They are widely used in modern zero-knowledge proof systems due to their efficiency and succinctness.
Its core idea is:
- The prover can commit to a polynomial.
- Later, they can prove to the verifier the value of that polynomial at a specific point without revealing the underlying polynomial.
This method is so useful because any content that can be encoded as a polynomial can now be easily disclosed selectively.
We will use the shorthand notation , for any .
-
:
set . here is a secret element and must be discarded after the Setup.
-
:
for .
-
:
To “open” the commitment at evaluation point to a claimed value
-
the prover computes the quotient polynomial and sends the verifier
-
the verifier checks .
The 1 and 2 steps in are often written as two separate algorithms:
- returns an opening proof for the relation
- verifies the opening proof’s correctness.
-
Quotient Polynomial
Goal:
Prove that without revealing what is.
Method:
-
Since , this guarantees that is zero at .
Therefore, is a factor of . -
We divide by , and the result is a polynomial of one degree lower, denoted as .
Example:
Suppose , and we know , i.e., . Then:
Now we verify that is zero at :
So is a root of .
Therefore, we can factor as:
In this case, the quotient polynomial is:
Interactive KZG Example
Define a polynomial by entering its coefficients (from constant term to highest degree)
Polynomial:
Polynomial Evaluation:
Quotient Polynomial:
This example demonstrates the polynomial division that forms the basis of KZG proofs. In a real KZG implementation:
- The polynomial and quotient would be committed to using elliptic curve operations
- The verification would use bilinear pairings
- The proof would be a single group element
Commitment Resources
Polynomial Commitments: Building Block for Universal SNARKs
Includes a taxonomy of PCS based on the cryptographic primitives used (hash, pairing, etc.).
KZG Polynomial Commitments
An introduction to the KZG polynomial commitment scheme, and how to extend it to multiproofs and vector commitments.
Inner Product Arguments
An introduction to the inner product argument (IPA) protocol, a primitive used to build PCS. Often instantiated with the vector Pedersen commitment.
Inner Product Proof Notes (Bulletproofs)
An excellent write-up on inner product arguments in the context of Bulletproofs.
Anatomy of a STARK, Part 3: FRI
An introduction to the FRI (Fast Reed-Solomon IOP of Proximity) protocol, an oracle proof of proximity used in STARKs.
arkworks-rs/poly-commit
A Rust library supporting four polynomial commitment schemes.
Polynomial Commitment Benchmark
Benchmarks for the Commit algorithm in KZG, IPA-based, and FRI-based polynomial commitment implementations.
References
- Shuang Liang, zkShanghai. " Commitment Schemes ". 2023.