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

Separate preprocessing from proving and verification by adding a parameter --stage to proof producer #97

Merged
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
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,29 @@ proof-generator --circuit <circuit-file> --assignment <assignment-file> --proof
cmake ..
make -j $(nrpoc)
```

# Sample calls to proof-producer

In all the calls you can change the executable name from proof-producer-single-threaded to proof-producer-multi-threaded to run on all the CPUs of your machine.

Generate a proof and verify it:
```bash
./build/bin/proof-producer/proof-producer-single-threaded --circuit="circuit.crct" --assignment-table="assignment.tbl" --proof="proof.bin" -q 10
```

Making a call to preprocessor:

```bash
./build/bin/proof-producer/proof-producer-single-threaded --stage="preprocess" --circuit="circuit.crct" --assignment-table="assignment.tbl" --common-data="preprocessed_common_data.dat" --preprocessed-data="preprocessed.dat" --commitment-state-file="commitment_state.dat" --assignment-description-file="assignment-description.dat" -q 10
```

Making a call to prover:

```bash
./build/bin/proof-producer/proof-producer-single-threaded --stage="prove" --circuit="circuit.crct" --assignment-table="assignment.tbl" --common-data="preprocessed_common_data.dat" --preprocessed-data="preprocessed.dat" --commitment-state-file="commitment_state.dat" --proof="proof.bin" -q 10
```

Verify generated proof:
```bash
./build/bin/proof-producer/proof-producer-single-threaded --stage="verify" --circuit="circuit.crct" --common-data="preprocessed_common_data.dat" --proof="proof.bin" --assignment-description-file="assignment-description.dat" -q 10
```
6 changes: 4 additions & 2 deletions bin/proof-producer/include/nil/proof-generator/arg_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ namespace nil {
typename tuple_to_variant<typename transform_tuple<HashTypes, to_type_identity>::type>::type;

struct ProverOptions {
std::string stage = "all";
boost::filesystem::path proof_file_path = "proof.bin";
boost::filesystem::path json_file_path = "proof.json";
boost::filesystem::path preprocessed_common_data_path = "preprocessed_common_data.dat";
boost::filesystem::path preprocessed_public_data_path = "preprocessed_data.dat";
boost::filesystem::path commitment_scheme_state_path = "commitment_scheme_state.dat";
boost::filesystem::path circuit_file_path;
boost::filesystem::path assignment_table_file_path;
boost::filesystem::path assignment_description_file_path;
boost::log::trivial::severity_level log_level = boost::log::trivial::severity_level::info;
bool skip_verification = false;
bool verification_only = false;
CurvesVariant elliptic_curve_type = type_identity<nil::crypto3::algebra::curves::pallas>{};
HashesVariant hash_type = type_identity<nil::crypto3::hashes::keccak_1600<256>>{};

Expand Down
Loading
Loading