Skip to content

Commit 34c23ef

Browse files
release: v0.6.0 (#65)
* init: v0.6.0 staging - adds CHANGELOG.md - bumps version - deletes extra builds - updates main.rs - updates circuits.json * chore: remove unused circuit material (#72) * remove: extra HTTP material * remove: aes * fix: tests * remove: old `circuits.json` * cleanup: JSON * Delete json_nivc.circom * Delete extractor.circom * remove: unneeded utils * remove: more utils * consolidate bytes * fix: build * feat: `DataHasher` takes -1 as padding (#76) * feat: authentication of ciphertext hash (#77) * fix: HTTP formatting constraints (#78) * fix: http headers max * fix: verify HTTP machine state at end * use --O1 in build * use `--O2` flag * Update Makefile * delete out-of-sync docs * delete unused example files * delete rogue logs * add rust cache * remove deprecated docs * add git for private repos * remove circuit warnings * place rust cache at correct step --------- Co-authored-by: lonerapier <lonerapier@proton.me>
1 parent bfc120b commit 34c23ef

100 files changed

Lines changed: 527 additions & 7265 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/artifacts.yaml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,20 @@ jobs:
5252
sudo apt-get update
5353
sudo apt-get install -y protobuf-compiler libprotobuf-dev
5454
55+
- name: Configure Git for Private Repos
56+
run: |
57+
git config --global url."https://${{ secrets.PAT }}@github.com/".insteadOf "https://github.com/"
58+
5559
- name: Install Rust
5660
uses: dtolnay/rust-toolchain@master
5761
with:
5862
toolchain: nightly-2024-10-28
5963

64+
- name: Rust Cache
65+
uses: Swatinem/rust-cache@v2
66+
with:
67+
cache-on-failure: true
68+
6069
- name: Install Circom
6170
run: |
6271
CIRCOM_VERSION=2.1.9
@@ -87,33 +96,29 @@ jobs:
8796
make debug # Show what will be processed
8897
make build # Build the circuits
8998
90-
- name: Configure Git for Private Repos
91-
run: |
92-
git config --global url."https://${{ secrets.PAT }}@github.com/".insteadOf "https://github.com/"
93-
9499
- name: Build and run parameter generator
95100
run: |
96101
rustup install nightly
97102
98103
# Build the parameter generator
99104
cargo build --release
100-
105+
101106
# Generate parameters using makefile target
102107
make params
103-
108+
104109
# Verify parameter files were created
105110
for target_dir in builds/target_*b; do
106111
size=$(basename "$target_dir" | sed 's/target_//')
107112
# Calculate ROM length the same way as in Makefile
108113
rom_length=$(echo "${size%b} / 16 + 16" | bc)
109-
114+
110115
# List of expected files
111116
files=(
112117
"aux_params_${size}_rom_length_${rom_length}.bin"
113118
"prover_key_${size}_rom_length_${rom_length}.bin"
114119
"verifier_key_${size}_rom_length_${rom_length}.bin"
115120
)
116-
121+
117122
for file in "${files[@]}"; do
118123
if [ ! -f "$target_dir/artifacts/$file" ]; then
119124
echo "Error: File not found: $file in $target_dir/artifacts"
@@ -122,7 +127,7 @@ jobs:
122127
echo "Successfully verified: $file"
123128
fi
124129
done
125-
130+
126131
echo "Successfully generated all parameter files for ${size}"
127132
done
128133
@@ -133,14 +138,14 @@ jobs:
133138
size=$(basename "$target_dir" | sed 's/target_//')
134139
# Calculate ROM length the same way as in Makefile
135140
rom_length=$(echo "${size%b} / 16 + 16" | bc)
136-
141+
137142
# List of expected files
138143
files=(
139144
"aux_params_${size}_rom_length_${rom_length}.bin"
140145
"prover_key_${size}_rom_length_${rom_length}.bin"
141146
"verifier_key_${size}_rom_length_${rom_length}.bin"
142147
)
143-
148+
144149
for file in "${files[@]}"; do
145150
if [ ! -f "$target_dir/artifacts/$file" ]; then
146151
echo "Error: File not found: $file in $target_dir/artifacts"
@@ -149,9 +154,9 @@ jobs:
149154
echo "Successfully verified: $file"
150155
fi
151156
done
152-
157+
153158
echo "Successfully generated all parameter files for ${size}"
154-
159+
155160
# Create zip archive for this target size
156161
if [ -d "$target_dir/artifacts" ]; then
157162
echo "Creating archive for $size"

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ ir_log/*
1717
log_input_signals.txt
1818
*.bin
1919
*.r1cs
20-
builds/**/artifacts/
20+
builds/**/artifacts/
21+
22+
# MacOS folks
23+
**/.DS_Store

CHANGELOG.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
2+
# Change Log
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](http://keepachangelog.com/)
6+
and this project adheres to [Semantic Versioning](http://semver.org/).
7+
8+
9+
## [UNRELEASED] [0.6.0] - 2024-12-3
10+
11+
### Added
12+
13+
### Changed
14+
#### Circuit Builds
15+
- Removed `512b` build path
16+
- Removed `aes_gctr_nivc_*b.circom` from build
17+
18+
#### Artifacts
19+
- Adjusted circuit names:
20+
- `aes_gctr_nivc` and `chacha20-nivc` replaced with a more suitable name: `plaintext_authentication`
21+
- Runs with `512b` per fold
22+
- `http_nivc` replaced with more suitable name: `http_verification`
23+
24+
### Fixed
25+
- TODO
26+
27+
### Notes
28+
- **Total circuits:** 5
29+
- **Circuit sizes:**
30+
- `plaintext_authentication_1024b`
31+
- non-linear constraints: `365,484`
32+
- linear-constraints: `40,463`
33+
- Theoretical storage size: `(40,463 + 365,484) * 3 * 32 bytes = 38,971,912 bytes ≈ 39 MB`
34+
- R1CS file: `121.3MB`
35+
- Graph file: `13.1MB`
36+
- **WARNINGS:** Yes. Run `circomkit compile plaintext_authentication_1024b`
37+
- `http_verification_1024b`:
38+
- non-linear constaints: `546,895` **(WARNING: greater than `2^19 == 524,288`)**
39+
- linear-constraints: `543,804`
40+
- Theoretical storage size: `(546,895 + 543,804) * 3 * 32 bytes = 104,707,104 bytes ≈ 105 MB`
41+
- R1CS file: `246.4MB`
42+
- Graph file: `16.5MB`
43+
- **WARNINGS:** Yes. Run `circomkit compile http_verification_1024b`
44+
- `json_mask_object_1024b`:
45+
- non-linear constraints: `550,001` **(WARNING: greater than `2^20 == 524,288`)**
46+
- linear-constraints: `316,205`
47+
- Theoretical storage size: `(550,001 + 316,205) * 3 * 32 bytes = 83,155,776 bytes ≈ 83 MB`
48+
- R1CS file: `109MB`
49+
- Graph file: `9.3MB`
50+
- **WARNINGS:** Yes. Run `circomkit compile json_mask_object_1024b`
51+
- `json_mask_array_index_1024b`:
52+
- non-linear constraints: `295,146`
53+
- linear-constraints: `194,082`
54+
- Theoretical storage size: `(295,146 + 194,082) * 3 * 32 bytes = 46,966,080 bytes ≈ 47 MB`
55+
- R1CS file: `67.4MB`
56+
- Graph file: `7.4MB`
57+
- **WARNINGS:** Yes. Run `circomkit compile json_mask_array_index_1024b`
58+
- `json_extract_value_1024b`:
59+
- non-linear constraints == `32,039`
60+
- linear-constraints: `18,644`
61+
- Theoretical storage size: `(32,039 + 18,644) * 3 * 32 bytes = 4,865,568 bytes ≈ 4.8 MB`
62+
- R1CS file: `11.1MB`
63+
- Graph file: `949KB`
64+
- **Estimated expanded R1CS base memory requirements:** `2^{20} * 32 * 5 ~ 168MB`$
65+
- **Circuit param file sizes (SNARK):**
66+
- `aux_params`: `115.1MB`
67+
- `prover_key`: `100.7MB`
68+
- `verifier_key`: `780.3MB`
69+
- **Circuit param file sizes (ppSNARK):**
70+
- `aux_params`: `836MB` **(WARNING: THIS IS LARGE)**
71+
- `prover_key`: `5.86GB` **(WARNING: THIS IS EXTREMELY LARGE!!!)**
72+
- `verifier_key`: `16.8MB`
73+

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ build:
2020
@set -e;
2121
@for circuit in $(CIRCOM_FILES); do \
2222
echo "Processing $${circuit}..."; \
23-
circom "$${circuit}" --r1cs --wasm -o "$$(dirname $${circuit})/artifacts" -l node_modules; \
23+
circom "$${circuit}" --r1cs --wasm --O2 -o "$$(dirname $${circuit})/artifacts" -l node_modules; \
2424
build-circuit "$${circuit}" "$$(dirname $${circuit})/artifacts/$$(basename $${circuit} .circom).bin" -l node_modules; \
2525
echo "====================xxxxxxxxxx===================="; \
2626
done

README.md

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
11
<h1 align="center">
2-
Parser Attestor
2+
Web-Prover Circuits
33
</h1>
44

55
<div align="center">
6-
<a href="https://github.com/pluto/parser-attestor/graphs/contributors">
6+
<a href="https://github.com/pluto/web-prover-circuits/graphs/contributors">
77
<img src="https://img.shields.io/github/contributors/pluto/spark?style=flat-square&logo=github&logoColor=8b949e&labelColor=282f3b&color=32c955" alt="Contributors" />
88
</a>
9-
<a href="https://github.com/pluto/parser-attestor/actions/workflows/test.yaml">
9+
<a href="https://github.com/pluto/web-prover-circuits/actions/workflows/test.yml">
1010
<img src="https://img.shields.io/badge/tests-passing-32c955?style=flat-square&logo=github-actions&logoColor=8b949e&labelColor=282f3b" alt="Tests" />
1111
</a>
12-
<a href="https://github.com/pluto/parser-attestor/actions/workflows/lint.yaml">
13-
<img src="https://img.shields.io/badge/lint-passing-32c955?style=flat-square&logo=github-actions&logoColor=8b949e&labelColor=282f3b" alt="Lint" />
14-
</a>
1512
</div>
1613

1714
## Overview
1815

19-
`parser-attestor` is a project focused on implementing parsers and extractors/selective-disclosure for various data formats inside of zero-knowledge circuits.
16+
`web-prover-circuits` is a project focused on implementing parsers and extractors/selective-disclosure for various data formats inside zero-knowledge circuits.
2017

2118
## Repository Structure
2219

2320
- `circuits/`: Current implementation of circuits
21+
- `chacha`: ChaCha encryption circuit
2422
- `http`: HTTP parser and extractor
2523
- `json`: JSON parser and extractor
2624
- `json` has its own documentation [here](docs/json.md)
2725
- `utils`: Utility circuits
2826
- `test`: Circuit tests
29-
- `src/`: Rust `pabuild` binary
30-
- `pabuild` has its own documentation [here](docs/pabuild.md)
27+
- `src/`: Rust public-params creation binary
3128
- `examples/`: Reference examples for JSON and HTTP parsers
3229

3330
Documentation, in general, can be found in the `docs` directory.
34-
We will add to this over time to make working with `parser-attestor` easier.
3531

3632
## Getting Started
3733

@@ -92,9 +88,9 @@ npx circomkit help
9288
`circomkit` can essentially do everything you would want to do with these Circuits, though we can't guarantee all commands work properly.
9389

9490
**Example:**
95-
For example, to compile the `json-parser`, you can run the following from the repository root:
91+
For example, to compile the `plaintext_authentication`, you can run the following from the repository root:
9692
```
97-
npx circomkit compile json-parser
93+
npx circomkit compile plaintext_authentication_1024b
9894
```
9995
which implicitly checks the `circuits.json` for an object that points to the circuit's code itself.
10096

@@ -114,21 +110,6 @@ npx mocha
114110
will run every circuit test.
115111
To filter tests, you can use the `-g` flag (very helpful!).
116112

117-
118-
### Install `pabuild`
119-
From the root of this repository, run:
120-
```sh
121-
cargo install --path .
122-
```
123-
to install the `pabuild` binary.
124-
You can see a help menu with the subcommands by:
125-
```sh
126-
pabuild --help
127-
```
128-
This is our local Rust command line application.
129-
Please see the [documentation](docs/pabuild.md) for how to use this alongside the other tools.
130-
131-
132113
## License
133114

134115
Licensed under the Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)

builds/target_1024b/aes_gctr_nivc_1024b.circom

Lines changed: 0 additions & 5 deletions
This file was deleted.

builds/target_1024b/http_nivc_1024b.circom

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pragma circom 2.1.9;
2+
3+
include "../../circuits/http/verification.circom";
4+
5+
component main { public [step_in] } = HTTPVerification(1024, 25);
File renamed without changes.

builds/target_512b/aes_gctr_nivc_512b.circom

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)