Add ETH deposit & withdraw

This commit is contained in:
arnaucube
2020-05-09 22:55:28 +02:00
parent e0dfc2ab6c
commit d6568e9f0a
5 changed files with 58 additions and 25 deletions

View File

@@ -11,6 +11,10 @@ PUB_amount+--------->+Poseidon+------->+ == +<-----+PUB_commitment
PRI_secret+--------->+ |
+--------+
+----+
PUB_address+--->+ != +<---+0
+----+
*/
@@ -27,6 +31,7 @@ template Withdraw() {
signal input amount;
signal input commitment;
signal private input secret;
signal input address;
component hash = Poseidon(3, 6, 8, 57);
hash.inputs[0] <== coinCode;
@@ -37,6 +42,10 @@ template Withdraw() {
eq.in[0] <== hash.out;
eq.in[1] <== commitment;
eq.out === 1;
component z = IsZero();
z.in <== address;
z.out === 0;
}
component main = Withdraw();