Files
Sachin f43142733b [V1] Add circuits (#11)
* Add new generate input script

* Add venmo amount regex circuit

* Add updated venmo mm regex circuit

* Update circuit to V1 spec; Fix regexes

* Update regex; doesn't fix bug;

* WIP: not working offramper ID

* partial MM id worked

* 5 matches for mm id

* 14 matches mm id

* Fix regexes

* Add hashing of packed venmo mm id

* Clean up

* Clean and fix bugs

* Add orderId as signal; update generate input script; rename mm to offramper

* Update circuit to extract only integer dollar amount

* Test fix for invalid witness error

* Revert lexical.js

* Add server scripts

* Add gen keys phase2 groth server script

* Fix scripts

* Add stats script

* Remove circuit_js

* Add chunk key gen script

* fix script

* fix script again

* add vkey script; fix scripts

* Fix UI generate inputs

* Revert UI changes

* Revert UI changes part 2

* Add uplaod chunked keys to s3 script

* Update to use same script as zkemail

* Wiring up UI; erroring with CORS

* Fix upload script

* Proof generation successful

---------

Co-authored-by: Richard Liang <richardliang2015@u.northwestern.edu>
2023-04-27 22:50:25 +05:30
..
2023-04-01 11:41:32 +01:00
2023-04-27 22:50:25 +05:30
2023-04-01 11:41:32 +01:00
2023-04-27 22:50:25 +05:30

ZK Regex

This code generates a circom regex file with Python and JS, but doesn't support all regex syntax.

Note that there is a full JS version of this code with tests at https://github.com/zk-email-verify/zk-regex/ , which also now supports some additional character classes. Once it reaches parity, we expect to update this repo to use that library instead.

Edit the regex on the top of lexical.js to change which regex is generated, then run python3 gen.py.

Halo2

You can use the compiled halo2_regex_lookup.txt file as input to the https://github.com/zk-email-verify/halo2-regex/ library, which will generate a regex circuit in halo2 instead. That circuit is much more efficient than this one for large inputs.

Notes

states[i+1][j] means that there was a character at msg[i] which led to the transition to state j.

This means that reveal for index i should be looking at state of index i+1.