An fully decentralised rollup for payments (gaming proofs coming soon!).
Users can deposit ETH into the rollup contract, and transfer ETH to others. Crucially, only user actions are logged in the contract, and balances are not tracked on L1.
Instead, after a fixed timestamp, the rollup "freezes". Anyone can then settle the rollup by submitting a merkle root of each users final balance, along with a validity proof that the merkle root is valid given past events. Users can then withdraw their balance from the rollup contract.
- Install Foundry
- Install Circom and SnarkJS
- Download powersOfTau file from Hermez repository
- Run
./compile.sh
to compile the circuits - You are good to go! Run
forge test
etc.
The Forge tests use SnarkJS (via Foundry FFI) to generate proofs for every input. This leads to two issues:
- Currently, the SnarkJS prover contract always uses the same filename for input and proof files. As Forge tests run in parallel, if two tests use the prover, they will likely fail as they overwite each others files. You can specify a particular test with
forge test --match-test <TEST_NAME>
. - The standard number of 256 fuzz runs take a long time to run. I reccomend you set
FOUNDRY_FUZZ_RUNS
to a low value ie. < 10.