To prove that σ belongs to the set {a, b} without revealing the values of a, b, and σ, the prover can use the technique of zero-knowledge proofs. In this case, a proof based on the Disjunctive Zero-Knowledge Proof (DZKP) protocol [the protocol can be found here] 1 can be used.
Here's a step-by-step show you on how the prover can prove that σ∈{a, b}:
1. Setup:
- The prover and verifier agree on the generator points G and H, which are known to both parties.
- The prover commits to values a and b using Pedersen commitments: Va = G⋅a + H⋅ra and Vb = G⋅b + H⋅rb.
- The prover also has another commitment Sσ = G⋅σ (with no H component).
2. Commitment Phase:
The prover sends the commitments Va, Vb, and Sσ to the verifier.
3. Challenge Phase:
The verifier selects a random challenge value c and sends it to the prover.
4. Response Phase:
Now, the prover needs to provide responses to the verifier's challenge c. To do this, the prover calculates the Pedersen commitments for the differences Δa = a - σ and Δb = b - σ as follows:
- Δa commitment: VΔa = G⋅(a - σ) + H⋅rΔa
- Δb commitment: VΔb = G⋅(b - σ) + H⋅rΔb
Next, the prover computes two scalar values, s1 and s2, as responses to the challenge:
- s1 = rΔa + c⋅ra
- s2 = rΔb + c⋅rb
5. Final Step:
The prover sends the responses s1 and s2 to the verifier.
6. Verification:
The verifier checks if the following conditions hold:
- VΔa + Sσ = s1⋅G + c⋅Va + (a - σ)⋅G (equality involving points)
- VΔb + Sσ = s2⋅G + c⋅Vb + (b - σ)⋅G (equality involving points)
If both equations are satisfied, the verifier can be confident that σ∈{a, b}. The prover has proven that they know the values a and b, such that σ is either equal to a or b, without revealing the actual values of a, b, or σ.
The zero-knowledge property of this proof ensures that the verifier learns nothing about a, b, or σ, except for the fact that σ belongs to the set {a, b}. This way, the prover can keep their values private while still convincing the verifier of the validity of their claim.