Skip to content

Commit

Permalink
init: v0.6.0 staging
Browse files Browse the repository at this point in the history
- adds CHANGELOG.md
- bumps version
- deletes extra builds
- updates main.rs
- updates circuits.json
  • Loading branch information
Autoparallel committed Dec 3, 2024
1 parent e7c4ec9 commit 08edfb7
Show file tree
Hide file tree
Showing 14 changed files with 99 additions and 72 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ ir_log/*
log_input_signals.txt
*.bin
*.r1cs
builds/**/artifacts/
builds/**/artifacts/

# MacOS folks
**/.DS_Store
73 changes: 73 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [UNRELEASED] [0.6.0] - 2024-12-3

### Added

### Changed
#### Circuit Builds
- Removed `512b` build path
- Removed `aes_gctr_nivc_*b.circom` from build

#### Artifacts
- Adjusted circuit names:
- `aes_gctr_nivc` and `chacha20-nivc` replaced with a more suitable name: `plaintext_authentication`
- Runs with `512b` per fold
- `http_nivc` replaced with more suitable name: `http_verification`

### Fixed
- TODO

### Notes
- **Total circuits:** 5
- **Circuit sizes:**
- `plaintext_authentication_1024b`
- non-linear constraints: `365,484`
- linear-constraints: `40,463`
- Theoretical storage size: `(40,463 + 365,484) * 3 * 32 bytes = 38,971,912 bytes ≈ 39 MB`
- R1CS file: `121.3MB`
- Graph file: `13.1MB`
- **WARNINGS:** Yes. Run `circomkit compile plaintext_authentication_1024b`
- `http_verification_1024b`:
- non-linear constaints: `546,895` **(WARNING: greater than `2^19 == 524,288`)**
- linear-constraints: `543,804`
- Theoretical storage size: `(546,895 + 543,804) * 3 * 32 bytes = 104,707,104 bytes ≈ 105 MB`
- R1CS file: `246.4MB`
- Graph file: `16.5MB`
- **WARNINGS:** Yes. Run `circomkit compile http_verification_1024b`
- `json_mask_object_1024b`:
- non-linear constraints: `550,001` **(WARNING: greater than `2^20 == 524,288`)**
- linear-constraints: `316,205`
- Theoretical storage size: `(550,001 + 316,205) * 3 * 32 bytes = 83,155,776 bytes ≈ 83 MB`
- R1CS file: `109MB`
- Graph file: `9.3MB`
- **WARNINGS:** Yes. Run `circomkit compile json_mask_object_1024b`
- `json_mask_array_index_1024b`:
- non-linear constraints: `295,146`
- linear-constraints: `194,082`
- Theoretical storage size: `(295,146 + 194,082) * 3 * 32 bytes = 46,966,080 bytes ≈ 47 MB`
- R1CS file: `67.4MB`
- Graph file: `7.4MB`
- **WARNINGS:** Yes. Run `circomkit compile json_mask_array_index_1024b`
- `json_extract_value_1024b`:
- non-linear constraints == `32,039`
- linear-constraints: `18,644`
- Theoretical storage size: `(32,039 + 18,644) * 3 * 32 bytes = 4,865,568 bytes ≈ 4.8 MB`
- R1CS file: `11.1MB`
- Graph file: `949KB`
- **Estimated expanded R1CS base memory requirements:** `2^{20} * 32 * 5 ~ 168MB`$
- **Circuit param file sizes (SNARK):**
- `aux_params`: `115.1MB`
- `prover_key`: `100.7MB`
- `verifier_key`: `780.3MB`
- **Circuit param file sizes (ppSNARK):**
- `aux_params`: `836MB` **(WARNING: THIS IS LARGE)**
- `prover_key`: `5.86GB` **(WARNING: THIS IS EXTREMELY LARGE!!!)**
- `verifier_key`: `16.8MB`

5 changes: 0 additions & 5 deletions builds/target_1024b/aes_gctr_nivc_1024b.circom

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ pragma circom 2.1.9;

include "../../circuits/chacha20/nivc/chacha20_nivc.circom";

// Note: this takes in 32 bits (4 bytes) per chunk, so 256 * 4 = 1024 bytes
component main { public [step_in] } = ChaCha20_NIVC(256);
5 changes: 0 additions & 5 deletions builds/target_512b/aes_gctr_nivc_512b.circom

This file was deleted.

5 changes: 0 additions & 5 deletions builds/target_512b/chacha20_nivc_512b.circom

This file was deleted.

5 changes: 0 additions & 5 deletions builds/target_512b/http_nivc_512b.circom

This file was deleted.

5 changes: 0 additions & 5 deletions builds/target_512b/json_extract_value_512b.circom

This file was deleted.

5 changes: 0 additions & 5 deletions builds/target_512b/json_mask_array_index_512b.circom

This file was deleted.

5 changes: 0 additions & 5 deletions builds/target_512b/json_mask_object_512b.circom

This file was deleted.

51 changes: 18 additions & 33 deletions circuits.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,45 +213,22 @@
16
]
},
"nivc_aes": {
"file": "aes-gcm/nivc/aes-gctr-nivc",
"template": "AESGCTRFOLD"
},
"http_nivc": {
"file": "http/nivc/http_nivc",
"template": "HttpNIVC",
"params": [
1024,
10
]
},
"nivc_start_line": {
"file": "http/nivc/parse_and_lock_start_line",
"template": "ParseAndLockStartLine",
"plaintext_authentication_1024b": {
"file": "chacha20/nivc/chacha20_nivc",
"template": "ChaCha20_NIVC",
"params": [
1024,
50,
200,
50
256
]
},
"nivc_lock_header": {
"file": "http/nivc/lock_header",
"template": "LockHeader",
"http_verification_1024b": {
"file": "http/nivc/http_nivc",
"template": "HttpNIVC",
"params": [
1024,
50,
100
]
},
"nivc_body_mask": {
"file": "http/nivc/body_mask",
"template": "HTTPMaskBodyNIVC",
"params": [
1024
25
]
},
"nivc_json_object": {
"json_mask_object_1024b": {
"file": "json/nivc/masker",
"template": "JsonMaskObjectNIVC",
"params": [
Expand All @@ -260,12 +237,20 @@
10
]
},
"nivc_json_array": {
"json_mask_array_index_1024b": {
"file": "json/nivc/masker",
"template": "JsonMaskArrayIndexNIVC",
"params": [
1024,
10
]
},
"json_extract_value_1024b": {
"file": "json/nivc/extractor",
"template": "MaskExtractFinal",
"params": [
1024,
50
]
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "web-prover-circuits",
"description": "ZK Circuits for WebProofs",
"version": "0.5.9",
"version": "0.6.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ struct CircuitFiles {
}

const BASE_CIRCUIT_NAMES: &[&str] = &[
"aes_gctr_nivc",
"http_nivc",
"plaintext_authentication",
"http_verification",
"json_mask_object",
"json_mask_array_index",
"json_extract_value",
Expand Down

0 comments on commit 08edfb7

Please sign in to comment.