hermeznetwork / circuits

Implements hermez network zk-Snarks circuits
GNU Affero General Public License v3.0
55 stars 21 forks source link

withdraw-multi-token #40

Closed krlosMata closed 3 years ago

krlosMata commented 3 years ago

Summary

New circuit to support multi token withdrawal in order to save gas for a user when exit the rollup.

Brief description

Circuit will have a global variable, MAX_TOKENS that will define which is the maximum tokens to be withdrawn. User provides should provide an array of merkle tree indexes in order to perform several withdrawals. This array is set to maximum length of MAX_TOKENS. User could choose to withdraw or not withdraw depending on idx input. idx = 0 will skip SMTVerifier while idx != 0 will perform the SMTVerifier with account state data

laisolizq commented 3 years ago

Spec WithdrawMultiToken: https://hackmd.io/6tABzjVKT4iX8W9_NhynOw

krlosMata commented 3 years ago

implemented in https://github.com/hermeznetwork/circuits/pull/49