Chapter status: ✅ in good shape ✅

Related puzzles: Puzzle 1

TODO:

Commitment Schemes

This section contains a brief introduction to commitment schemes, focusing on Pedersen commitments.

Contents

Generalities

A commitment scheme involves two parties, a committer (or prover) and a verifier. It allows the committer to send to the verifier a commitment to some secret value and later on to open this commitment to reveal The commitment should not reveal any information about the message (hiding property) and the committer should not be able to open a commitment in two distinct ways (binding property).

For a physical analogy, imagine the committer as writing the message on a piece of paper and placing it in an opaque, unbreakable, locked box which he sends to the verifier. At this point, the verifier cannot learn anything about the message and the committer cannot modify the message. Later, when the committer wants to open the commitment, he sends the key opening the box to the verifier to reveal the message.

Syntax

More formally, a commitment scheme consists of three algorithms (the exact syntax can vary slightly in the literature):

  • a probabilistic setup algorithm which on input the security parameter returns public parameters1 which in particular specify a message space (in the following, we simply denote the message space leaving the dependency on implicit);
  • a probabilistic commitment algorithm which on input parameters and a message returns a commitment and a decommitment2
  • a deterministic verification algorithm which on input parameters a commitment a message and a decommitment return 1 if the decommitment is valid for and 0 otherwise.

Quite often, the decommitment simply consists of the random coins used by the commitment algorithm, and the verification algorithm simply recomputes the commitment given and and compares with When this is the case, we say that the commitment scheme has canonical verification and, overloading the notation, we let denote the function explicitly taking the random coins of the commitment algorithm as input and returning the commitment (letting the decommitment implicit in that case).

Note that what we just defined here is the syntax for a non-interactive commitment scheme, where the algorithm is run once and for all and committing consists of a single message sent by the prover to the verifier. There exists more complex commitment schemes where committing requires some interaction between the prover and the verifier.

Correctness requires that for every security parameter the following game capturing the nominal execution of algorithms returns true with probability 1:

Security

A commitment scheme should satisfy two security properties informally defined as follows:

  • hiding: the commitment should not reveal any information about the secret value to the verifier,
  • binding: the committer should not be able to open the commitment in two different ways.

Let us formalize these two properties more precisely, starting with hiding, defined by the following game:

In some cases, it might be necessary to check additional conditions and messages and queried to oracle (e.g., when consists of bit strings of various lengths and does not hide the message length, and should have the same length).

Binding is defined by the following game:

For some commitment schemes, one of these two properties holds statistically (i.e., cannot be broken with non-negligible advantage even by a computationally unbounded adversary) or even perfectly. However, a commitment scheme cannot be both statistically hiding and statistically binding at the same time. Hence, at best, a commitment scheme can be either statistically hiding and computationally binding or computationally hiding and statistically binding.

Homomorphic Commitments

Informally, a commitment scheme is homomorphic if the message space equipped with some binary operation forms a group and given two commitments and to respectively and anyone can compute a commitment that the committer can open to

More formally, a commitment scheme is homomorphic (with respect to group operation if there exists two algorithms and such that

  • takes parameters and two commitments and and returns a commitment
  • takes parameters and two decommitments and and returns a decommitment
  • for any security parameter the following game returns true with probability 1:

Algorithms and are often quite simple (e.g., when the commitment and decommitment spaces also have a group structure, they simply consist in applying the corresponding group operation to and or and respectively).

Pedersen Commitments

Description and Security

The Pedersen commitment scheme, initially introduced in [Ped91], is widely used, in particular to build zero-knowledge proof systems. It is specified as follows. Let be a group setup algorithm. Then:

  • the setup algorithm on input runs draws two random generators and of and returns parameters the message space is

  • the commitment algorithm on input parameters and a message draws and returns a commitment and a decommitment

  • the verification algorithm on input parameters a commitment a message and a decommitment returns 1 if and 0 otherwise.

Theorem 18.1. The Pedersen commitment scheme is perfectly hiding, computationally binding under the discrete logarithm assumption, and homomorphic with respect to addition over

Proof

Let us sketch the proof of each property:

  • perfectly hiding: as is uniformly random in for any message is uniformly random in and hence does not reveal any information about
  • computationally binding: assume an adversary can output two message/decommitment pairs and with for the same commitment then which yields the discrete logarithm of in base (note that implies as and are generators of
  • additively homomorphic: given two commitments and anyone can compute and the committer can compute which is a valid decommitment for and message

A Note About the Setup

Importantly, the setup algorithm should ensure that nobody knows the discrete logarithm of in base In particular, it is not safe to allow the committer to choose the public parameters: if the committer knows the discrete logarithm of in base then the scheme is not binding anymore. Say the committer knows such that Then it can send as commitment; later, it can open this commitment to any value it wants by computing and sending decommitment it satisfies

For this reason, Pedersen's scheme is sometimes referred to as a trapdoor (or equivocal) commitment scheme, which can be useful in security proofs but should also make us wary. However, there are secure ways to select the commitment key without a trusted third party, such as using a hash-to-group function (a.k.a. hash-to-curve function in case is based on an elliptic curve) applied to some NUMS (nothing-up-my-sleeve) input. Hence, even though Pedersen commitments do not require a trusted setup, one should always verify that parameters were correctly generated. For a real-world example where this trapdoor property could have been used, see Section VI of [HLPT20] about the Scytl/SwissPost e-voting system.

Variants

The Pedersen commitment scheme can be generalized to messages which are vectors the parameters are extended to where and are uniformly random and independent generators of and the commitment for message with randomness is This is usually called the generalized Pedersen commitment scheme, or sometimes the Pedersen vector commitment scheme, although this is somehow a misnomer as it does not have all the properties required from a vector commitment scheme [CF13]. As for the basic variant, it can be shown to be perfectly hiding, computationally binding under the DL assumption, and homomorphic with respect to addition over

The "random" part of the commitment is sometimes omitted, in which case the commitment algorithm becomes deterministic and the commitment is simply In that case, the scheme is still computationally binding under the DL assumption (and even perfectly binding for as the commitment function is bijective), but it is not hiding anymore (given two messages and and a commitment to for some random bit one can recover by simply computing the commitments corresponding to respectively and and comparing with For this reason, it is sometimes referred to as the non-hiding Pedersen commitment scheme. It is however preimage-resistant under the DL assumption, meaning that given a random commitment it is hard to compute a message such that

ElGamal Commitments

The Pedersen commitments scheme has a relative known as the ElGamal commitment scheme where the commitment key is as for Pedersen and the commitment for message with randomness is the pair (Note the similarity with ElGamal encryption w.r.t. public key ) This scheme is perfectly binding, computationally hiding under the DDH assumption, and additively homomorphic.

If the message is encoded as a group element and the commitment computed as the scheme has a trapdoor property allowing anyone with knowledge of the discrete logarithm of in base to extract the message (by "decrypting" the commitment as in ElGamal encryption, i.e., computing

Commitments and Hash Functions

There is a strong connection between commitment schemes and collision-resistant hash functions.

First, let us consider the following strengthening of the binding property: We say that a commitment scheme if strongly binding if it is hard to find a commitment and two distinct message-decommitment pairs and such that and That is, the adversary wins also when the messages and are equal but the decommitments and are different.

Given a hash function family indexed by some parameter one can define a simple commitment scheme with where It can be shown to be (computationally) strongly binding assuming the family is collision-resistant. On the other hand, there is no reason for this scheme to be hiding in general ( could for example reveal the first bit of the message, allowing to distinguish commitments to two messages with distinct first bits). It is however easily seen to be (computationally) hiding in the random oracle model.

Reciprocally, it is straightforward to derive a collision-resistant hash function family from a strongly binding commitment scheme.

Proposition 18.1. Consider a commitment scheme with a function taking parameters a message and explicit random coins If is strongly binding, then the function family is collision-resistant.

Proof

Assume that is not collision-resistant and that there is an adversary which on input returns such that Let Then hence this adversary can be used to break strong binding of

Note that the assumption that is binding is not sufficient: it could be easy to find such that but with which would break collision-resistance but not binding.

It is not hard to see that the Pedersen commitment scheme is actually strongly binding, which directly gives an algebraic family of collision-resistant hash functions usually called Pedersen hashing. A specific instance of the family is specified by a tuple of parameters where is a cyclic group of order and are generators chosen in a way such that nobody knows any discrete logarithm relation between them. Then has domain range and is defined by (Note that in the context of hashing, there is no distinction between the "message" and the "randomness" as in the context of commitment schemes.)

This family of hash functions is collision-resistant assuming the discrete logarithm problem is hard.

Variants are possible: for example, if inputs are bit strings of length exactly one can split the input into chunks of consecutive bits with and convert the -th chunk into an integer and let

Further Resources

For more background on commitment schemes, see for example this article by Damgård and Nielsen and this lecture by Dodis.


1: The name can vary; these parameters are sometimes called a commitment key or a public key.

2: Again, the name can vary and it is sometimes called an opening or a hint.