Pedersen Commitment

Protocol Description

Setup

Let GG be a (multiplicative) cyclic group of prime order for which the Discrete Logarithm problem is intractable. The key generation procedure publishes randomly chosen generators g,hGg, h ∈ G, which serve as both the commitment key and verification key.

Commit

To commit to a number m{0,...,G1}m ∈ \{0, . . . , |G| − 1\}, committer picks a random z{0,...,G1}z ∈ \{0, . . . , |G| − 1\} and sends c=gmhzc = g^m · h^z.

Open

To open a commitment cc, committer sends (m,z)(m, z). Verifier checks that c=gmhzc = g^m · h^z.

Properties of the commitment:

  • perfect hiding

  • computational binding

Additive Homomorphism

One important property of Pedersen commitments is that they are additively homomorphic. This means that the verifier can take two commitments c1c_1 and c2c_2, to values m1,m2{0,...,G1}m_1, m_2 ∈ \{0, . . . , |G| − 1\} (with m1,m2m_1, m_2 known to the committer but not to the verifier), and the verifier on its own can derive a commitment c3c_3 to m3=m1+m2m_3 = m_1 + m_2, such that the prover is able to open c3c_3 to m3m_3. This is done by simply letting c3=c1c2c_3 = c_1 · c_2. As for “opening information” provided by the prover, if c1=hm1gz1c_1 = h^{m_1} · g^{z_1} and c2=hm2gz2c_2 = h^{m_2} · g^{z_2}, then c3=hm1+m2gz1+z2c_3 = h^{m_1+m_2} · g^{z_1+z_2}, so the opening information for c3c_3 is simply (m1+m2,z1+z2)(m_1 + m_2, z_1 + z_2). In summary, Pedersen commitments over a multiplicative group GG are additively homomorphic, with addition of messages corresponds to group-multiplication of commitments.

Perfect HVZK Proof of Knowledge of Opening

It is possible to the prover to prove that it knows how to open a commitment cc to some value, without actually opening the commitment.

Protocol

  1. Let GG be a (multiplicative) cyclic group of prime order over which the Discrete Logarithm relation is hard, with randomly chosen generators gg and hh.

  2. Input is c=gmhzc = g^m · h^z. Prover knows mm and zz, Verifier only knows c,g,hc, g, h.

  3. Prover picks d,r{0,...,G1}d, r ∈ \{0, . . . , |G| − 1\} and sends to verifier a=gdhra = g^d · h^r.

  4. Verifier sends challenge ee chosen at random from {0,...,G1}\{0, . . . , |G| − 1\}.

  5. Prover sends m=me+dm' = me + d and z=ze+rz' = ze + r

  6. Verifier checks that gmhz=ceag^{m'}· h^{z'} = c^e · a

Properties of the protocol:

  • perfect completeness

  • special soundness

  • perfect HVZK

Establishing A Product Relationship Between Committed Values

Suppose the committer sends commitments (c1,c2,c3)(c_1, c_2, c_3) that is claimed to be a commitments to values (m1,m2,m1m2)(m_1, m_2, m_1 · m_2). Pedersen commitments are not multiplicatively homomorphic but it is possible to the prover to prove to the verifier that c3c_3 indeed commits to m1m2m_1 · m_2, without actually opening up c3c_3 and thereby revealing m1m2m_1 · m_2.

Protocol

  1. Let GG be a (multiplicative) cyclic group of prime order over which the Discrete Logarithm relation is hard.

  2. Input is ci=gmihric_i = g^{m_i} · h^{r_i} for i{1,2,3}i ∈ \{1, 2, 3\} such that m3=m1m2modGm_3 = m_1 · m_2 \mod |G|.

  3. Prover knows mim_i and rir_i for all i{1,2,3}i ∈ \{1, 2, 3\}, verifier only knows c1,c2,c3,g,hc_1, c_2, c_3, g, h.

  4. Prover picks b1,...,b5{0,...,G1}b_1, . . . , b_5 ∈ \{0, . . . , |G| − 1\} and sends to verifier three values:

αgb1hb2,βgb3hb4,γc1b3hb5.α ← g^{b_1} · h^{b_2}, β ← g^{b_3} · h^{b_4}, γ ← c_1^{b_3} · h^{b_5}.
  1. Verifier sends challenge ee chosen at random from {0,...,G1}\{0, . . . , |G| − 1\}.

  2. Prover sends:

z1b1+em1,z2b2+er1,z3b3+em2,z4b4+er2,z5b5+e(r3r1m2).z_1 ← b_1 + e · m_1, \\ z_2 ← b_2 + e · r_1, \\ z_3 ← b_3 + e · m_2, \\ z_4 ← b_4 + e · r_2, \\ z_5 ← b_5 + e · (r_3 − r_1m_2).
  1. Verifier checks that the following three equalities hold:

gz1hz2=αc1e,gz3hz4=βc2e,c1z3hz5=γc3e.g^{z_1} · h^{z_2} = α · c_1^{e}, \\ g^{z_3} · h^{z_4} = β · c_2^e, \\ c_1^{z_3} · h^{z_5} = γ · c_3^e.

Properties of the protocol:

  • perfect completeness

  • special soundness

  • perfect HVZK

Last updated