-
Notifications
You must be signed in to change notification settings - Fork 1
zkSNARK
Arthur Greef edited this page May 13, 2018
·
12 revisions
- We are using the libsnark library.
- The mtxq balancing equation validation is the match transaction family is replaced with a zkSNARK protocol.
General form of the equations where i:initiating quantity, n: ratio numerator quantity, d:ratio denominator quantity, r: reciprocating quantity.
iq * nq / dq = rq for q in {quantity value, quantity unit, quantity resource}
Rewrite as algebraic circuit.
iq * nq - dq * rq = 0 for q in {0..2}
Rewrite as conjuction of three balancing equation using a slack variable.
iq * nq - dq * rq + 1 = sq for q in {0..2}
product(sq) = 1 for q in {0..2}
Rewrite as statements of the form c = a * b
-
in0 = i0 * n0
-
dr0 = d0 * r0
-
indr0 = in0 - dr0
-
s0 = indr0 + 1
-
in1 = i1 * n1
-
dr1 = d1 * r1
-
indr1 = in1 - dr1
-
s1 = indr1 + 1
-
in2 = i2 * n2
-
dr2 = d2 * r2
-
indr2 = in2 - dr2
-
s2 = indr2 + 1
-
ss = s0 * s1
-
out = s2 * ss
Create R1CS as zkSNARK library relation.