Why are logic gates assigned integers when checking QAP in zkSNARK algo? I am trying to understand how zkSNARKs work. Going through this article by Vitalik, in the section on 'Checking the QAP' he says &quot; If the resulting polynomial, evaluated at every x coordinate that we used above to represent a logic gate, is equal to zero, then that means that all of the checks pass;&quot; -
Can somebody help me understand why logic gates correspond to numbers 1,2,3,4?
Assigning "coordinates" (integers) to arithmetic gates is a way of combining multiple verification equations into a single one by Lagrange interpolation, and then testing that single equation at a random point. Choosing that point at random effectively results in random weights for original equations in the combination. This point could be compared to challenge of Schnorr protocol. For the statement cited, resulting polynomial is representing all the gates in the circuit.