You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
mottla 621b377127 adding test for various programs 5 years ago
.idea improved circuit compiling 5 years ago
bn128 -initial commit, 5 years ago
circuitcompiler adding test for various programs 5 years ago
cli -initial commit, 5 years ago
fields cli 5 years ago
r1csqap new variable renaming logic 5 years ago
r1csqapFloat doing trusted setup 6 years ago
.gitignore update cli, update readme 5 years ago
LICENSE Initial commit 6 years ago
README.md adding test for various programs 5 years ago
build-cli.sh update cli, update readme 5 years ago
go-snark-cli update cli, update readme 5 years ago
go.mod cli 5 years ago
go.sum cli 5 years ago
snark.go optimizing R1CS representation 5 years ago
snark_test.go optimizing R1CS representation 5 years ago

README.md

Caution, Warning

Fork UNDER CONSTRUCTION! Will ask for merge soon

Current implementation status:

Library usage

Warning: not finished.

Working example of gate-reduction and code parsing:

def do(x):
		e = x * 5
		b = e * 6
		c = b * 7
		f = c * 1
		d = c * f
		out = d * mul(d,e)
	
	def doSomethingElse(x ,k):
		z = k * x
		out = do(x) + mul(x,z)
	
	def main(x,z):
		out = do(z) + doSomethingElse(x,x)
	
	def mul(a,b):
		out = a * b

R1CS Output:

[[0 0 210 0 0 0 0 0 0 0 0 0 0 0] [0 0 210 0 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 1 0 0 0 0 0 0 0 0 0] [0 0 0 1 0 0 0 0 0 0 0 0 0 0] [0 210 0 0 0 0 0 0 0 0 0 0 0 0] [0 210 0 0 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 1 0 0 0 0 0] [0 0 0 0 0 0 0 1 0 0 0 0 0 0] [0 1 0 0 0 0 0 0 0 0 0 0 0 0] [0 1 0 0 0 0 0 0 0 0 0 0 0 0] [1 0 0 0 0 0 0 0 0 0 0 0 0 0]]
[[0 0 210 0 0 0 0 0 0 0 0 0 0 0] [0 0 210 0 0 0 0 0 0 0 0 0 0 0] [0 0 5 0 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 1 0 0 0 0 0 0 0 0] [0 210 0 0 0 0 0 0 0 0 0 0 0 0] [0 210 0 0 0 0 0 0 0 0 0 0 0 0] [0 5 0 0 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 1 0 0 0 0] [0 1 0 0 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0 0 1 0 0] [0 0 0 0 0 0 1 0 0 0 1 0 1 0]]
[[0 0 0   1 0 0 0 0 0 0 0 0 0 0] [0 0 0   0 1 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 1 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 1 0 0 0 0 0 0 0] [0 0   0 0 0 0 0 1 0 0 0 0 0 0] [0 0   0 0 0 0 0 0 1 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 1 0 0 0 0] [0 0 0 0 0 0 0 0 0 0 1 0 0 0] [0 0 0 0 0 0 0 0 0 0 0 1 0 0] [0 0 0 0 0 0 0 0 0 0 0 0 1 0] [0 0 0 0 0 0 0 0 0 0 0 0 0 1]]

Note that we only need 11 multiplication Gates instead of 16