Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.5.0 #156

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resolver = "2"


[workspace.package]
version = "0.4.0"
version = "0.5.0"
authors = ["arkworks contributors"]
description = "A library for constructing polynomial commitment schemes for use in zkSNARKs"
repository = "https://github.com/arkworks-rs/poly-commit"
Expand All @@ -15,6 +15,17 @@ categories = ["cryptography"]
license = "MIT/Apache-2.0"
edition = "2018"

[workspace.dependencies]
ark-serialize = { version = "0.5.0", default-features = false }
ark-ff = { version = "0.5.0", default-features = false }
ark-ec = { version = "0.5.0", default-features = false }
ark-poly = { version = "0.5.0", default-features = false }
ark-crypto-primitives = { version = "0.5.0", default-features = false }
ark-std = { version = "0.5.0", default-features = false }
ark-relations = { version = "0.5.0", default-features = false }
ark-r1cs-std = { version = "0.5.0", default-features = false }
rand_chacha = { version = "0.3.0", default-features = false }

[profile.release]
opt-level = 3
lto = "thin"
Expand All @@ -27,16 +38,16 @@ debug-assertions = true
incremental = true
debug = true

[patch.crates-io]
ark-std = { git = "https://github.com/arkworks-rs/std/" }
ark-ff = { git = "https://github.com/arkworks-rs/algebra/" }
ark-ec = { git = "https://github.com/arkworks-rs/algebra/" }
ark-serialize = { git = "https://github.com/arkworks-rs/algebra/" }
ark-poly = { git = "https://github.com/arkworks-rs/algebra/" }
# [patch.crates-io]
# ark-std = { git = "https://github.com/arkworks-rs/std/" }
# ark-ff = { git = "https://github.com/arkworks-rs/algebra/" }
# ark-ec = { git = "https://github.com/arkworks-rs/algebra/" }
# ark-serialize = { git = "https://github.com/arkworks-rs/algebra/" }
# ark-poly = { git = "https://github.com/arkworks-rs/algebra/" }

ark-crypto-primitives = { git = "https://github.com/arkworks-rs/crypto-primitives/" }
ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std/" }
# ark-crypto-primitives = { git = "https://github.com/arkworks-rs/crypto-primitives/" }
# ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std/" }

ark-bls12-377 = { git = "https://github.com/arkworks-rs/algebra/" }
ark-bls12-381 = { git = "https://github.com/arkworks-rs/algebra/" }
ark-bn254 = { git = "https://github.com/arkworks-rs/algebra/" }
# ark-bls12-377 = { git = "https://github.com/arkworks-rs/algebra/" }
# ark-bls12-381 = { git = "https://github.com/arkworks-rs/algebra/" }
# ark-bn254 = { git = "https://github.com/arkworks-rs/algebra/" }
108 changes: 107 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,112 @@ This library provides various constructions of polynomial commitment schemes. Th
The key properties satisfied by the polynomial commitment schemes are **succinctness**, **extractability**, and **hiding**. See [the Marlin paper][marlin] for definitions of these properties.


[kzg10]: http://cacr.uwaterloo.ca/techreports/2010/cacr2010-10.pdf
### Supported Polynomial Commitment Schemes

The library supports six polynomial commitment schemes.

#### Inner-product-argument PC

A polynomial commitment scheme based on the hardness of the discrete logarithm problem in prime-order groups.
The construction is described in the following paper.

[pcd-acc]: https://ia.cr/2020/499

[Proof-Carrying Data from Accumulation Schemes][pcd-acc]
Benedikt Bünz, Alessandro Chiesa, Pratyush Mishra, Nicholas Spooner
TCC 2020

#### Marlin variant of the Kate-Zaverucha-Goldberg PC

Polynomial commitment based on the Kate-Zaverucha-Goldberg construction, with degree enforcement, batching, and (optional) hiding property taken from Marlin.
The construction is described in the following papers.

[Marlin: Preprocessing zkSNARKs with Universal and Updatable SRS][marlin]
Alessandro Chiesa, Yuncong Hu, Mary Maller, Pratyush Mishra, Noah Vesely, Nicholas Ward
EUROCRYPT 2020

[Polynomial Commitments][kzg10]
Aniket Kate, Gregory M. Zaverucha, Ian Goldberg
ASIACRYPT 2010

#### Sonic/AuroraLight variant of the Kate-Zaverucha-Goldberg PC

Polynomial commitment based on the Kate-Zaverucha-Goldberg construction, with degree enforcement and batching taken from Sonic (more precisely, their counterparts in AuroraLight that avoid negative G1 powers). The (optional) hiding property of the commitment scheme follows the approach described in Marlin.
The construction is described in the following papers.

[AuroraLight: Improved Prover Efficiency and SRS Size in a Sonic-Like System][aurora-light]
Ariel Gabizon
ePrint, 2019

[Sonic: Zero-Knowledge SNARKs from Linear-Size Universal and Updateable Structured Reference Strings][sonic]
Mary Maller, Sean Bowe, Markulf Kohlweiss, Sarah Meiklejohn
CCS 2019

[Marlin: Preprocessing zkSNARKs with Universal and Updatable SRS][marlin]
Alessandro Chiesa, Yuncong Hu, Mary Maller, Pratyush Mishra, Noah Vesely, Nicholas Ward
EUROCRYPT 2020

[Polynomial Commitments][kzg10]
Aniket Kate, Gregory M. Zaverucha, Ian Goldberg
ASIACRYPT 2010

#### Hyrax multilinear PC

Multilinear polynomial commitment, introduced with Hyrax zkSNARK. Relies on Pedersen commitments and discrete logarithm problem for a hiding scheme. Construction details in the following paper.

[Doubly-efficient zkSNARKs without trusted setup][hyrax]
Riad S. Wahby, Ioanna Tzialla, abhi shelat, Justin Thaler, Michael Walfish
2018 IEEE Symposium on Security and Privacy

#### Ligero and Brakedown

Polynomial commitments based on linear codes and cryptographic hash functions. Construction details in the following papers.

[Ligero: Lightweight Sublinear Arguments Without a Trusted Setup][ligero]
Scott Ames, Carmit Hazay, Yuval Ishai, Muthuramakrishnan Venkitasubramaniam
CCS 2017

[Brakedown: Linear-time and field-agnostic SNARKs for R1CS][brakedown]
Alexander Golovnev, Jonathan Lee, Srinath Setty, Justin Thaler, Riad S. Wahby
CRYPTO 2023

#### Marlin variant of the Papamanthou-Shi-Tamassia multivariate PC

Multivariate polynomial commitment based on the construction in the Papamanthou-Shi-Tamassia construction with batching and (optional) hiding property inspired by the univariate scheme in Marlin.
The construction is described in the following paper.

[Signatures of Correct Computation][pst]
Charalampos Papamanthou, Elaine Shi, Roberto Tamassia
TCC 2013

[Marlin: Preprocessing zkSNARKs with Universal and Updatable SRS][marlin]
Alessandro Chiesa, Yuncong Hu, Mary Maller, Pratyush Mishra, Noah Vesely, Nicholas Ward
EUROCRYPT 2020

### Comparison (WIP)

#### Comparison of `MarlinKZG10` and `SonicKZG10`


- High-level:
They handle degree bounds differently.
MarlinPC uses shift powers only in G1 and requires two commitments to enforce degree bounds.
SonicPC uses shift powers in G1 and G2 and requires only one commitment to enforce degree bounds.

- Setup:
SonicPC additionally computes some G2 elements for shift powers: `(1/\beta)^i H`. This results in a longer verifying key, as shift powers in SonicPC are in G2, while shift powers in Marlin are in G1, and are shared with the "non-shift" powers.

- Commit:
When there is no degree bound, both are the same.
When there is a degree bound, MarlinPC is more expensive: it needs an additional commitment to commit to the shifted poynomial.

- Open:
When there is no degree bound, both are the same.
When there is a degree bound, MarlinPC is slightly more expensive: it requires more scalar field computations.

- Check:
MarlinPC simply adjusts the commitment of the shifted polynomial, so the overhead is small. It checks a pairing equation with two pairing operations.
SonicPC is more expensive, as it checks a pairing equation of three pairing operations. It can be reduced into two if there is no degree bound.

## Build guide

Expand Down Expand Up @@ -178,6 +283,7 @@ This library is licensed under either of the following licenses, at your discret

Unless you explicitly state otherwise, any contribution that you submit to this library shall be dual licensed as above (as defined in the Apache v2 License), without any additional terms or conditions.

[kzg10]: http://cacr.uwaterloo.ca/techreports/2010/cacr2010-10.pdf
[marlin]: https://ia.cr/2019/1047
[sonic]: https://ia.cr/2019/099
[aurora-light]: https://ia.cr/2019/601
Expand Down
17 changes: 8 additions & 9 deletions bench-templates/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ publish = false

[dependencies]
ark-poly-commit = { path = "../poly-commit", default-features = false }
ark-serialize = { version = "^0.4.0", default-features = false, features = [ "derive" ] }
ark-ff = { version = "^0.4.0", default-features = false }
ark-ec = { version = "^0.4.0", default-features = false }
ark-poly = {version = "^0.4.0", default-features = false }
ark-crypto-primitives = {version = "^0.4.0", default-features = false, features = ["sponge", "merkle_tree"] }
ark-std = { version = "^0.4.0", default-features = false }
ark-serialize = { workspace = true, features = [ "derive" ] }
ark-ff.workspace = true
ark-ec.workspace = true
ark-poly.workspace = true
ark-crypto-primitives = { workspace = true, features = ["sponge", "merkle_tree"] }
ark-std.workspace = true
rand_chacha.workspace = true

rand_chacha = { version = "0.3.0", default-features = false }
criterion = { version = "0.5", default-features = false }

paste = "1.0"
paste = "1.0"
27 changes: 13 additions & 14 deletions poly-commit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@ categories.workspace = true
include.workspace = true
license.workspace = true
edition.workspace = true
description.workspace = true

[dependencies]
ark-serialize = { version = "^0.4.0", default-features = false, features = [ "derive" ] }
ark-ff = { version = "^0.4.0", default-features = false }
ark-ec = { version = "^0.4.0", default-features = false }
ark-poly = {version = "^0.4.0", default-features = false }
ark-crypto-primitives = {version = "^0.4.0", default-features = false, features = ["sponge", "merkle_tree"] }
ark-std = { version = "^0.4.0", default-features = false }
ark-serialize = { workspace = true, features = [ "derive" ] }
ark-ff.workspace = true
ark-ec.workspace = true
ark-poly.workspace = true
ark-crypto-primitives = { workspace = true, features = ["sponge", "merkle_tree"] }
ark-std.workspace = true
ark-relations = { workspace = true, optional = true }
ark-r1cs-std = { workspace = true, optional = true }

blake2 = { version = "0.10", default-features = false }
derivative = { version = "2", features = [ "use_core" ] }
digest = "0.10"

ark-relations = { version = "^0.4.0", default-features = false, optional = true }
ark-r1cs-std = { version = "^0.4.0", default-features = false, optional = true }

hashbrown = { version = "0.15", default-features = false, features = ["inline-more", "allocator-api2"], optional = true }
rand = { version = "0.8.0", optional = true }
rayon = { version = "1", optional = true }
Expand Down Expand Up @@ -60,10 +59,10 @@ ahash = { version = "0.8", default-features = false}
fnv = { version = "1.0", default-features = false }

[dev-dependencies]
ark-ed-on-bls12-381 = { version = "^0.4.0", default-features = false }
ark-bls12-381 = { version = "^0.4.0", default-features = false, features = [ "curve" ] }
ark-bls12-377 = { version = "^0.4.0", default-features = false, features = [ "curve" ] }
ark-bn254 = { version = "^0.4.0", default-features = false, features = [ "curve" ] }
ark-ed-on-bls12-381 = { version = "0.5.0", default-features = false }
ark-bls12-381 = { version = "0.5.0", default-features = false, features = [ "curve" ] }
ark-bls12-377 = { version = "0.5.0", default-features = false, features = [ "curve" ] }
ark-bn254 = { version = "0.5.0", default-features = false, features = [ "curve" ] }
rand_chacha = { version = "0.3.0", default-features = false }
ark-pcs-bench-templates = { path = "../bench-templates" }

Expand Down
117 changes: 0 additions & 117 deletions poly-commit/README.md

This file was deleted.

1 change: 1 addition & 0 deletions poly-commit/README.md
2 changes: 1 addition & 1 deletion poly-commit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#![deny(renamed_and_removed_lints, stable_features, unused_allocation)]
#![deny(unused_comparisons, bare_trait_objects, unused_must_use)]
#![forbid(unsafe_code)]
#![doc = include_str!("../../README.md")]
#![doc = include_str!("../README.md")]

#[allow(unused)]
#[macro_use]
Expand Down
Loading