Skip to content

Commit 07bd921

Browse files
authored
Merge pull request #69 from worldcoin/forerunner/uncompressed-proving-system
Change default proving system to uncompressed
2 parents f82d62a + 22c52c1 commit 07bd921

File tree

2 files changed

+51
-42
lines changed

2 files changed

+51
-42
lines changed

README.md

Lines changed: 49 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
SMTB is a service for batch processing of Merkle tree updates. It is designed to be used in conjunction with [Semaphore](https://github.com/semaphore-protocol/semaphore). It accepts Merkle tree updates and batches them together into a single one. This is useful for reducing the number of transactions that need to be submitted to the blockchain. The correctness of the batched Merkle tree update is assured through the generation of a SNARK (generated through [gnark](https://github.com/ConsenSys/gnark)).
44

55
## Table of Contents
6+
67
1. [Features](#features)
78
2. [Usage](#usage)
89
3. [Benchmarks](#benchmarks)
@@ -20,61 +21,68 @@ SMTB is a service for batch processing of Merkle tree updates. It is designed to
2021
- [ ] Proving service
2122
- [ ] Serialize circuit and proving key
2223

23-
## Usage
24-
This part explains the existing cli commands.
25-
24+
## Usage
25+
26+
This part explains the existing cli commands.
27+
2628
1. setup - builds a circuit with provided batch size and depth, compiles it and writes it to a file.
27-
Flags:
28-
1. output *file path* - A path used to output a file
29-
2. tree-depth *n* - Merkle tree depth
30-
3. batch-size *n* - Batch size for Merkle tree updates
31-
2. export-solidity - Reads a key file (generated from setup), and writes a solidity verifier contract.
32-
Flags:
33-
1. keys-file *file path*
34-
2. Optional: output *file* - Outputs to a file, if not provided, it will output to stdandard output
35-
3. gen-test-params - Generates test params given the batch size and tree depth.
36-
Flags:
37-
1. tree-depth *n* - Depth of the mock merkle tree
38-
2. batch-size *n* - Batch size for merkle tree updates
29+
Flags:
30+
1. output _file path_ - A path used to output a file
31+
2. tree-depth _n_ - Merkle tree depth
32+
3. batch-size _n_ - Batch size for Merkle tree updates
33+
2. export-solidity - Reads a key file (generated from setup), and writes a solidity verifier contract.
34+
Flags:
35+
1. keys-file _file path_
36+
2. Optional: output _file_ - Outputs to a file, if not provided, it will output to stdandard output
37+
3. gen-test-params - Generates test params given the batch size and tree depth.
38+
Flags:
39+
1. tree-depth _n_ - Depth of the mock merkle tree
40+
2. batch-size _n_ - Batch size for merkle tree updates
3941
4. start - starts a api server with /prove and /metrics endpoints
40-
Flags:
41-
1. keys-file *file path* - Proving system file
42-
2. Optional: json-logging *0/1* - Enables json logging
43-
3. Optional: prover-address *address* - Address for the prover server, defaults to localhost:3001
44-
4. Optional: metrics-address *address* - Address for the metrics server, defaults to localhost:9998
42+
Flags:
43+
1. keys-file _file path_ - Proving system file
44+
2. Optional: json-logging _0/1_ - Enables json logging
45+
3. Optional: prover-address _address_ - Address for the prover server, defaults to localhost:3001
46+
4. Optional: metrics-address _address_ - Address for the metrics server, defaults to localhost:9998
4547
5. prove - Reads a prover system file, generates and returns proof based on prover parameters
46-
Flags:
47-
1. keys-file *file path* - Proving system file
48+
Flags:
49+
1. keys-file _file path_ - Proving system file
4850
6. verify - Takes a hash of all public inputs and verifies it with a prover system
49-
Flags:
50-
1. keys-file *file path* - Proving system file
51-
2. input-hash *hash* - Hash of all public inputs
51+
Flags:
52+
1. keys-file _file path_ - Proving system file
53+
2. input-hash _hash_ - Hash of all public inputs
5254
7. r1cs - Builds an r1cs and writes it to a file
53-
Flags:
54-
1. output *file path* - File to be written to
55-
2. tree-depth *n* - Depth of a tree
56-
3. batch-size *n* - Batch size for Merkle tree updates
55+
Flags:
56+
1. output _file path_ - File to be written to
57+
2. tree-depth _n_ - Depth of a tree
58+
3. batch-size _n_ - Batch size for Merkle tree updates
5759
8. extract-circuit - Transpiles the circuit from gnark to Lean
58-
Flags:
59-
1. output *file path* - File to be writen to
60-
2. tree-depth *n* - Merkle tree depth
61-
3. batch-size *n* - Batch size for Merkle tree updates
60+
Flags:
61+
1. output _file path_ - File to be writen to 2. tree-depth _n_ - Merkle tree depth
62+
2. batch-size _n_ - Batch size for Merkle tree updates
63+
9. convert-to-raw - Converts a compressed proving system into an uncompressed one with better read performance
64+
Flags:
65+
1. input _file path_ - Input proving system
66+
2. output _file path_ - Output proving system
6267

6368
## Benchmarks
6469

6570
Batch size: `100`
6671
Tree depth: `20`
72+
6773
```
6874
DBG prover done backend=groth16 curve=BN254 nbConstraints=6370011 took=11094.363542
6975
```
7076

7177
## Running
78+
7279
```shell
7380
go build .
7481
gnark-mbu --keys-file path/to/keys/file
7582
```
7683

7784
## Docker
85+
7886
```shell
7987
docker build -t semaphore-mtb .
8088

@@ -86,6 +94,7 @@ docker run -it \
8694
```
8795

8896
Or in docker compose
97+
8998
```yaml
9099
semaphore-mtb:
91100
# Path to the repo root directory
@@ -104,14 +113,14 @@ docker compose up -d
104113

105114
## Contributing
106115

107-
We welcome your pull requests! But also consider the following:
116+
We welcome your pull requests! But also consider the following:
108117

109-
1. Fork this repo from `master` branch.
110-
2. If you added code that should be tested, please add tests.
111-
3. If you changed the CLI flags, please update this readme in your PR.
112-
4. Ensure that CI tests suite passes.
118+
1. Fork this repo from `master` branch.
119+
2. If you added code that should be tested, please add tests.
120+
3. If you changed the CLI flags, please update this readme in your PR.
121+
4. Ensure that CI tests suite passes.
113122

114123
When you submit code changes, your submissions are understood to be under the same MIT License that covers the project.
115-
Feel free to contact the maintainers if that's a concern.
124+
Feel free to contact the maintainers if that's a concern.
116125

117-
Report bugs using github issues.
126+
Report bugs using github issues.

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func main() {
5656
if err != nil {
5757
return err
5858
}
59-
written, err := system.WriteTo(file)
59+
written, err := system.WriteRawTo(file)
6060
if err != nil {
6161
return err
6262
}
@@ -148,7 +148,7 @@ func main() {
148148
if err != nil {
149149
return err
150150
}
151-
written, err := system.WriteTo(file)
151+
written, err := system.WriteRawTo(file)
152152
if err != nil {
153153
return err
154154
}

0 commit comments

Comments
 (0)