gnosis / dex-zksnarks

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

Create python script to generate arbitrary pedersen hashes #40

Closed fleupold closed 5 years ago

fleupold commented 5 years ago

This script allows creating pedersen hashes the same way the zkSnark gadget creates them.

E.g. to compute the initial account balance, from within a python3 shell run from GIT_ROOT/pepper run:

>>> import sys
>>> sys.path.append('./scripts/')
>>> import dex_hash_pedersen
>>> dex_hash_pedersen.hash([0] * 100)
8156475395882493195825535078490895389315142862097453514441310645298127661025

It also updates the generate.py script for order transformation to use that function and delete the copied ethSnarks code, which is now accessed via the git submodule.