Reducing the number of equality checks (constraints) through random linear combinations
Random linear combinations are a common trick in zero knowledge proof algorithms to enable equality checks to be probabilistically checked with a single equality check. Suppose we have inner products we are trying to prove. Instead of creating proofs, we create a random linear combination of the equalities and prove that.
Equality of Pedersen Commitments
First, let’s consider how we might prove the equality of multiple Pedersen commitments.
If we have elliptic curve points and with unknown discrete logs, and blinding terms and we can construct Pedersen committments and where
The verifier can check if if the prover provides the difference in the blinding terms. The verifier cannot simply check because the blinding terms will generally not be equal to each other, i.e. .
If the prover wishes to convince the verifier that and are committed to and respectively, but without revealing and , the prover can compute
And give to the verifier. The verifier computes
Under the hood, this expands to
All the blinding terms will cancel out leaving .
But suppose the prover wishes to establish equality for several commitments, i.e. . The naïve solution is to send blinding terms and the verifier will run equality checks. This will require sending field elements () and the verifier’s algorithm will run in time.
Why the prover cannot simply add up all the commitments
Suppose we have with commitments respectively. Suppose also the prover wants to show that and without revealing them.
The following check is not secure:
where is the difference in the blinding terms. As a counterexample, consider the case where . The sums are balanced, but the original claim is incorrect.
Random linear combinations
However, if the prover is required to show that
for a random value they cannot predict, then the scheme is secure.
Specifically, the prover and verifier do the following algorithm:
Randomized proof of equality
Setup
The prover and verifier agree on elliptic curve points and , where the discrete logs are unknown.
Prover sends commitments
The prover generates blinding terms and creates the Pedersen commitments
and sends to the verifier.
Verifier picks a random
The verifier chooses a random field element and sends it to the prover.
Prover computes the difference in blinding terms
The prover computes and sends to the verifier.
Final verification check
The verifier checks that
Security analysis
If and then the equation will be balanced regardless of the choice of , assuming the prover computed correctly.
Now suppose or . The prover still will not be able to produce a valid because doing so would require solving for the discrete logs of and .
Generalizing to checks
If we have equality checks, , the verifier could send random elements and the prover could provide such that
However, this requires the verifier to send elements, leading to a linear communication overhead. The communication overhead can be reduced to constant if the verifier only sends and the prover and verifier separate the commitments by successive powers of :
Security analysis
The left-hand-side and right-hand-side are both polynomials of degree . If they are unequal to each other, then they intersect in at most points by the Schwartz Zippel Lemma. If where is the order of the finite field, then again the probability of being an intersection point is negligible.
Random linear combinations of inner products
We can generalize the above technique to combine multiple inner products together.
Suppose we have two inner products
and
Because the two inner products share a common term, it is algebraically possible to combine them as follows:
However, this is not secure from a soundness perspective because it is possible that and but .
As expected, we can solve this by using a random linear combination.
We only need to create an inner product proof for a single inner product instead of two. It is crucial that the prover receives after they have sent the relevant commitments, but we leave the exact details for the next chapter when we see an example of an algorithm using this technique: range proofs.
This tutorial is part of a series on ZK Bulletproofs.
Ready to Get Started?
Join Thousands of Users Today
Start your free trial now and experience the difference. No credit card required.