Non-Interactivity and Graph Non-Isomorphism
This is a supplement to Zero Knowledge Proofs - Lecture 1.
Not all interactive protocols can be converted to non-interactive protocols
In the lecture, the professor claimed that not all interactive protocols can be converted to non-interactive protocols, and the reason given in the slide was that IP = AM sometimes requires a super-polynomial prover, and in the case of Fiat-Shamir transformation, the prover needs to be computationally bounded, and therefore cannot invert H.
However, why is this the case? Let’s use Schnorr’s Protocol as a case study to explain it.
Schnorr’s Protocol
Goal: Prover convinces Verifier that they know such that where is a generator of a group.
- Thanks ZKDocs - Schnorr’s identification protocol and Lecture 5: Proofs of Knowledge, Schnorr’s protocol, NIZK for providing the code and the graph.
The completeness of the above protocol is easy to see. For soundness, instead of proving statistical soundness, we can prove special soundness.
Just a sidenote, to convert this Schnorr’s Protocol to an non-interactive version, ZKDocs provides a case where incorrect input is used in Fiat-Shamir transformation, which causes the protocol to be insecure. It’s worth noting that the case they discussed is a bit different from what I have shown above. It’s about generating a valid triple (, , ) for any X of prover’s choice 1, which means there is no fixed shared by both parties at the beginning. If you are interested, feel free to read the linked article and the paper.
What prevents grinding?
Now, let’s get back to the protocol that I described above. Suppose we want to turn it into an non-interactive version. The obvious thing we can do is to let and then use it to generate .
Now, you might be thinking: what prevents a malicious prover from grinding? In other words, since the variable is just a coin 2, the malicious prover can just sampled 2 and it’s very likely that one of the it gets is , which means it can then return directly. From the perspective of the verifier, this is a correct proof.
The answer to that problem is also very simple: c is not a coin, but a random value drawn from a field. If this is the case, the challenge space (the field where the “coin” c is chosen from) will be pretty large. As a result, the probability of finding the collision that I described above will be 3.
- If you treat as a -bit number, then the probability will be .
Why can’t all interactive protocols be converted to non-interactive protocols (via Arthur-Merlin Game)?
By the analysis above, we know that the probability of successfully grinding is . If the prover is computationally bounded, this is fine. However, if it’s not the case, we are in trouble.
This is exactly why not all interactive protocols can be converted to non-interactive protocols as IP = AM transformation sometimes requires extra super-polynomial powers from Merlin (the prover).
Graph Non-Isomorphism
In the lecture, the professor shows an interactive proof of graph non-isomorphism. However, this proof is not ZK because a malicious verifier can use a completely new graph (not derived from either or ) and ask prover to show whether it is isomorphism to or . Therefore, it can obtain extra information that cannot be simulated.
The way to solve this problem is briefly discussed: the verifier first prove to the prover that the graph it sends (let’s call it ) is indeed isomorphic to one of the and (can be both).
- But it is indeed very tricky to do so if you think about this carefully. How can you prove this without revealing which graph is isomorphic to ?
The remaining part of this article will analyze this amazing blog to see how we can prove this in a PZK (perfect zero knowledge) way.
Solution 1
Send the two graphs . The verifier then sends back an integer, pointing to one of these two graphs, and the prover responds by providing the permutation from to this graph. Note that if at least one of the graphs is isomorphic to , the prover can do so with at least probability 1/2.
This does not work because a simulator , given access to verifier , cannot simulate this because
- It runs in PPT (probabilistic polynomial time), so it cannot using (where are random permutations), generating a random number , checking if it is able to find a permutation between and .
- At the same time, it does not know which graph is isomorphic to, so it pre-prepare a permutation and generate messages like and .
Solution 2
The prover sends back in a random order. The verifier then randomly points to one of the three graphs, and asks the prover to show that this graph is isomorphic to .
For the same reason, this method doesn’t work either. Given the length of the article, I’ll skip to the last solution.
Last Solution
The last solution is a very interesting construction.
- Prover responds by sending two scrambled and permuted ordered copies of , , to the Verifier, with an additional restriction that second scrambling of the three graphs is either a right shift, or a left shift of the original three graphs.
- In other words, it sends:
- or:
- where is some random permutation (ordering) of
- The Verifier now responds with either a 0, or a 1, one option to continue with the proof, and the other to verify that the two permuted copies indeed satisfy the requirements.
- If the Verifier sent a 0, the Prover reveals the two permutations, and we go back to step 2. If the Verifier sent a 1, we continue to prove that at least one of the graphs is isomorphic to , by choosing one of the columns, and showing that both of the graphs in that column are isomorphic to by sending back the permutations.
This solution works and achieve PZK because:
- H0, H1, H2 is a permutation of , , (they are , , in random order) -> this ensures that the correct column that the prover will pick can be any of the three columns.
- Suppose no permutation is used, and only left and right shifts are used. Then, the probability of a column being selected is 1:1:0 (G isomorphic to ) or 1:0:1 (to ) or 1:1:1 (to and ) depending on which graph is isomorphic to.
-
Isomorphic to
- or
-
Isomorphic to
- or
-
So, without permutation, we can know some additional information based on which column is selected.
-
- Suppose no permutation is used, and only left and right shifts are used. Then, the probability of a column being selected is 1:1:0 (G isomorphic to ) or 1:0:1 (to ) or 1:1:1 (to and ) depending on which graph is isomorphic to.
- Left Shift or Right Shift: it’s important to have them as well. This ensures that no matter the permutation, the distance between the and / (the graph is isomorphic to) is always 1. If the distance is not always the same, after randomly selecting the column in the simulator, we cannot construct the other two columns randomly because we must fix the position of the graph that is isomorphic to match distance = 1.
- For example, given this permutation , , . Suppose is isomorphic to . If we only allow left shift, we can only choose as the position for .
- But, in reality, the simulator doesn’t know which graph is isomorphic to.
- So, after selecting the column randomly, it cannot proceed.
- For example, given this permutation , , . Suppose is isomorphic to . If we only allow left shift, we can only choose as the position for .
-
This is not true, but a misconception that I had after listening to lecture 1. ↩
-
https://crypto.stackexchange.com/questions/97735/grinding-in-the-fiat-shamir-heuristic ↩