You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This library provides circom circuits that enables you to prove that
10
10
- the input string satisfies regular expressions (regexes) specified in the chip.
11
11
- the substrings are correctly extracted from the input string according to substring definitions.
12
12
13
-
This is a JS/Rust adaptation of the Python regex-to-circom work done by [sampriti](https://github.com/sampritipanda/) and [yush_g](https://twitter.com/yush_g) at https://www.zkregex.com
13
+
This is a JS/Rust adaptation of the Python regex-to-circom work done by [sampriti](https://github.com/sampritipanda/) and [yush_g](https://twitter.com/yush_g), along with [sorasue](https://github.com/SoraSuegami/)'s decomposed specifications. You can generate your own regexes via our no-code tool at https://www.zkregex.com
14
14
15
15
In addition to the original work, this library also supports the following features:
16
16
- CLI to dynamically generate regex circuit based on regex argument
@@ -22,6 +22,7 @@ You can define a regex to be proved and its substring patterns to be revealed.
22
22
Specifically, there are two ways to define them:
23
23
1. (manual way) converting the regex into an equivalent determistic finite automaton (DFA), selecting state transitions for each substring pattern, and writing the transitions in a json file.
24
24
2. (automatic way) writing a decomposed version of the regex in a json file with specifying which part of the regex is revealed.
25
+
3. (no code way) put the regex into zkregex.com > tool, highlight your chosen part, and copy the generated circuit
25
26
While the manual way supports more kinds of regexes than the automatic way, the latter is easier and sufficient for most regexes.
26
27
27
28
### Theory
@@ -58,7 +59,7 @@ For example, if you want to verify the regex of `email was meant for @(a|b|c|d|e
This command generates a regex circom from a raw string of the regex definition and a json file that defines state transitions in DFA to be revealed.
77
78
For example, to verify the regex `1=(a|b) (2=(b|c)+ )+d` and reveal its alphabets,
78
-
1. Visualize DFA of the regex using [this website](https://mindfa.onrender.com/min_dfa).
79
+
1. Visualize DFA of the regex using [this website](https://zkregex.com).
79
80
2. Find state transitions matching with the substrings to be revealed. In this case, they are `2->3` for the alphabets after `1=`, `6->7` and `7->7` for those after `2=`, and `8->9` for `d`.
80
81
3. Make a json file at `./simple_regex_substrs.json` that defines the state transitions. For example,
// regex: email was meant for @(a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z|A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|0|1|2|3|4|5|6|7|8|9|_)+
0 commit comments