https://github.com/imdea-software/lunar
A Rust library for the Lunar universal zkSNARK
https://github.com/imdea-software/lunar
Last synced: over 1 year ago
JSON representation
A Rust library for the Lunar universal zkSNARK
- Host: GitHub
- URL: https://github.com/imdea-software/lunar
- Owner: imdea-software
- License: apache-2.0
- Created: 2023-06-09T08:14:53.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-06T13:33:49.000Z (almost 3 years ago)
- Last Synced: 2025-01-06T20:33:23.976Z (over 1 year ago)
- Language: Rust
- Size: 59.6 KB
- Stars: 1
- Watchers: 8
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Lunar
`lunar` is a Rust library that implements some of the Lunar zkSNARKs, namely LunarLite and LunarLite2x, and corresponding building blocks proposed in [the Lunar paper [CFFQR21]](https://eprint.iacr.org/2020/1069).
**WARNING:** This is an academic prototype, and in particular has not received careful code review. This implementation is NOT ready for production use.
## Table of Contents
* [ Overview ](#overview)
* [ How to install ](#how-to-install)
* [ Usage ](#usage)
* [ Benchmarks ](#benchmarks)
* [ Tests ](#tests)
* [ To-do ](#to-do)
## Overview
Description of the different modules:
- phplite2: Implements the prover and verifier of the two Polynomial Holographic IOPs (PHP) for the R1CSlite constraint-system: PHPlite2 and PHPlite2x;
- comms: Implements the typed commitment schemes CS1 and CS2;
- evalpolyproofs: Implements the Commit-and-Prove gadgets for CS1 and CS2;
- matrixutils: Utility functions for matrices and polynomials;
- php: Implements oracle structures for polynomials and commitments;
- r1cslite: Implements the R1CSlite to polyR1CSlite conversion;
- lib: Implements LunarLite (based on CS2) and LunarLite2x (based on CS1).
## How to install
To run this project you need to [install the last version of Rust](https://www.rust-lang.org/tools/install). It's recommended to run the project via the Rust package manager, `cargo`, installed by default with the `rustup` toolchain.
This project uses the [arkworks](https://github.com/arkworks-rs/) ecosystem, mainly for finite fields (`ark-ff`), polynomial manipulation (`ark-poly`), elliptic curves and pairings (`ark-ec`), grouped in the repository [algebra].
## Usage
You can build this project with
`git clone https://github.com/imdea-software/lunar`
```bash
cd lunar
cargo build --release
cargo run
```
You can build the documentation with
`cargo doc` and navigate with `cargo doc --open`
## Benchmarks
The benchmarking is in the folder `lunar/benches`. Just run `cargo bench` to check the performance of our library.
## Tests
The tests are intended to check the validity of some of the functions involved.
To run the tests, just use `cargo test`.
## To-do:
- The unwrap() function is not recommended because if an error prompts, it makes the program panic with no more information given. Thus it's recommended to transform all `unwrap()` into `expect("Some custom msg")`.
## License
This code is licensed under either of the following licenses, at your discretion.
- [Apache License Version 2.0](LICENSE-APACHE)
- [MIT License](LICENSE-MIT)
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.
## Reference paper and contributors
[CFFQR21] Matteo Campanelli, Antonio Faonio, Dario Fiore, Anaïs Querol, and Hadrián Rodríguez. Lunar: a Toolbox for More Efficient Universal and Updatable zkSNARKs and Commit-and-Prove Extensions. ASIACRYPT 2021. [https://eprint.iacr.org/2020/1069](https://eprint.iacr.org/2020/1069)
This library has been developed with the contributions of: Matteo Campanelli, Hadrián Rodríguez, and Damien Robissout.
## Acknowledgements
This work has received funding by: the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program under project PICOCRYPT (grant agreement No. 101001283), by the Spanish Government under projects SCUM (ref. RTI2018-102043-B-I00) and CRYPTOEPIC (ref. EUR2019-103816), by the Madrid regional government under project BLOQUES (ref. S2018/TCS-4339), and by research grants from Protocol Labs, and from the Tezos foundation and Nomadic Labs. Additionally, the project that gave rise to these results received the support of a fellowship from “la Caixa” Foundation (ID 100010434) to Anaïs Querol (ref. LCF/BQ/ES18/11670018).
[rust book]: https://doc.rust-lang.org/book/
[algebra]: https://github.com/arkworks-rs/algebra "Rust arkworks-rs algebra"
[2]: https://www.rust-lang.org/tools/install "Rust installation"