gnosis / dex-zksnarks

Code to generate snark proofs for batch auction result validation of the Gnosis d.exchange
46 stars 7 forks source link

Adding rounding to trade execution snark #27

Closed fleupold closed 5 years ago

fleupold commented 5 years ago

Before, the trade execution snark is expecting values to match exactly. In particular, the relations between buy/sell volume and prices, the total sum of tokens bought/sold as well as the trader surplus where exact equalities.

As sketched out in #14 this limits the region of valid solutions drastically. Therefore, we are introducing an epsilon (and unit tests to show which kind of values are now variable) to allow ≈ instead of =.