Initial Inspection

First, let us try to define more precisely the goal of the puzzle just from the instructions, without looking into the code yet.

Notation

Given a group of order we will write vectors of scalars and vectors of group elements in bold font, e.g. and For two vectors and their scalar product is defined as Similarly, given and we let

Definition of the Proof System

Let us first try to specify the language for which the proof system is designed. We assume that the cyclic group of prime order and generators and are agreed upon by the prover and the verifier. Then, from the puzzle's description (and also from the code, as we will see), the language of interest is defined by the relation

Recall that the language defined by this relation consists of all instances such that there exists a witness such that

The protocol itself goes as follows:

The protocol is complete, meaning that for any instance an honestly generated proof is always accepted by the verifier. This holds because and

Proof of Knowledge

One can also check that the proof system is extractable, which follows from a property called special soundness: for any instance in language given two accepting transcripts with the same commitments but different challenges and one can compute a witness. Indeed, let be two accepting transcripts for some instance such that Let Since both transcripts are accepting, we have Then Hence, the relation defining the language is satisfied and is indeed a witness that the instance is in

Zero-Knowledge?

The puzzle instructions asks us to find which is part of the witness, from a few proofs generated by Bob. If the protocol is zero-knowledge, this shouldn't be possible. Is it zero-knowledge, though, from a theoretical point of view?

The answer is yes. Namely, the interactive protocol as defined above can be shown to be honest-verifier zero-knowledge. The simulator, whose task is to generate a fake transcript distributed as a true transcript between a prover and an honest verifier without knowing the witness works as follows:

Something Strange

There is something odd with the way we described the proof system: vector plays no role in the relation In particular, note that the proof that the system is extractable did not use the second equation checked by the verifier (meaning extractability still holds even if this check is omitted).

For this reason, it would make more sense to actually include the commitment to the inner product in the instance and randomness in the witness and to define the relation as

By doing this, the protocol would now be specified as follows:

However, this is not important for solving the puzzle and we will stick to the original, albeit unnatural, description.