I was reading Vitalik Buterin's post$^\color{magenta}{\star}$ on ZK-snarks and I need some clarification on some points. Since there aren't that many posts and articles on the subject, I had no choice other than turning to Stack Exchange .
First, I need to know what does Vitalik means by the following.
There is a standard way of converting a logic gate into a (a, b, c) triple depending on what the operation is
Is he pointing to a specific topic in mathematics? Why triple? I did google R1CS, but not that many results came up.
Secondly , why use the variable "one". Why assign the variables in a particluar order which is "one" "x" "out", etc? Why $3$ vectors? And how does that exactly work? Especially assigning the variables at the 3rd gate is a bit not-clear.
I know these are too many questions and even though I really appreciate any help that I can get, yet I don't expect you to answer every single question. However, if you could point me to the topics, keywords, etc that describe the methods used therein, perhaps I could work my way to the end of this article. I wish someone would have wrote a complementary post on this article instead of repeating the Sudoku example over and over again. All you can find is either really heavy math papers or the Waldo analogy, but nothing in between.
P.S.: I have read posts on zcash blog. still not clear on R1CS and QAP. And scientific papers are too math-heavy!
$\color{magenta}{\star}$ Vitalik Buterin, Quadratic Arithmetic Programs: from Zero to Hero, December 12, 2016.
A = 1 * z; B = 1 * ~one; C = 1 * x + 1 * y; It can also be the following, swapping A and B like you proposed: A = 1 * ~one; B = 1x + 1y; C = 1 * z; Or you could combine them all into A: A = 1x + 1y + -1z; B = 1~one; C = 0; These all produce valid solutions, and some may even produce the same 't' vector after a witness is provided. 3. No clue if any other areas use this technique
– ninni21 Mar 01 '18 at 16:51The steps I outlined in the answer create the R1CS, which is used to derive the QAP (so they aren't considered "quadratic" yet)
you seem to have the sequence of steps correct... But I'm not sure what you mean when you say "arbitrary values! (i dont see why we cant use 5 , 6 , 7 ..etc )". What step do you see this occurring?
Unfortunately I don't have other sources for this, but what I did was look at the source code he supplied to learn how each function works, and then played around with different input formulas/gates to see what held true
– ninni21 Mar 01 '18 at 16:51these numbers (1,2,3,4) which along with first elements of the vectors are used to make coordinates is the thing that i meant by arbitrary . why not use 5 and 6 and .. – Hesaam Mar 03 '18 at 08:10