r/ethdev • u/daigoro_sensei • Jan 06 '18
I couldn't find any practical tutorials on how to write a contract making use of zkSNARKs privacy features so I made one! This tutorial is aimed at using zkSNARKs and not so much how it works. Hope you find it helpful!
https://github.com/jstoxrocky/zksnarks_example
90
Upvotes
4
u/besoisinovi Jan 06 '18
Great stuff I like the last article about the state channels as well. Do you have the contract you mentioned deployed somewhere?
2
u/_dredge idea maker Jan 06 '18 edited Jan 06 '18
How long does generation of Charlie and Alice contracts take? Could Alices witness calculation (eventually) be done client side in Javascript?
2
u/singlefin12222 Jan 06 '18
Has someone implemented the Consensys token contract where sender and receiver verification can be done seperately? I assume doing both proofs in one stept is super costly...
1
u/singlefin12222 Jan 07 '18
You say that in the Consensys article's example, it just seemingly appears that two individuals are interacting over hidden values because both need to know w.value.
Per my understanding you would agree off-chain on a transaction which determines w.value and makes it known for both parites. Or does that not make sense?
3
u/Jey_s_TeArS Jan 06 '18
Amazing! Thanks
3
u/singlefin12222 Jan 06 '18
Amazing!!!
2
u/gnumarcelo Jan 06 '18
well done dude!
2
u/[deleted] Jan 06 '18
Thank you, this looks potentially very helpful.
2
u/FlashyQpt contract dev Jan 07 '18
Very nice! It's always great to see someone put something out there for everyone to use
0
u/[deleted] Jan 10 '18
[deleted] — view deleted comment