Thanks to visit codestin.com
Credit goes to github.com

Skip to content

khovratovich/two-worlds-ref

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Two World Benchmarks

Set of benchmarks for Two World / Data Matching in Unequal Worlds / Hybrid Compression project.

System Requirements

In order to run use these benchmarks the following software should be installed on the system:

  1. Node.js version 22.13.1+
  2. Circom 2.2.2+

Configuration

The size of the “Powers of Tau” ceremony could be set like this:

export S=16

The default size is 23, which is enough for running all benchmarks with 256 inputs, but may take more than a day to be created.

The benchmarks could be parameterized by the number of public inputs like this:

export N=16

The default number of inputs is 256.

Also, the following environment variable could be set to address heap limit issues:

export NODE_OPTIONS=--max-old-space-size=8192

Prepare

Before running the benchmarks, the following preparation steps should be performed:

  1. Go to the root directory of the benchmarks, i.e. the directory containing this README file.
  2. Install dependencies: npm install
  3. Perform trusted setup: npm run powersoftau
  4. Prepare the benchmarks: npm run prepare

This will ask for entropy a couple of times. Just enter random strings and press [Enter].

Run benchmark

In order to run benchmark execute the following command:

npm run benchmark

Full List of Supported Commands

npm run clear Remove all generated content. WARNING: this also removes powersoftau output that could take DAYS to recreate.

npm run powersoftau Perform “Powers of Tau” ceremony.

npm run preprocess_Uncompressed Preprocess the “Uncompressed” benchmark code.

npm run preprocess_SHA256 Preprocess the “SHA256” benchmark code.

npm run preprocess_Poseidon Preprocess the “Poseidon” benchmark code.

npm run preprocess_TwoWorld Preprocess the “TwoWorld” benchmark code.

npm run preprocess Preprocess code for all the benchmarks.

npm run r1cs_Uncompressed Compile the “Uncompressed” benchmark circuit into the R1CS format.

npm run r1cs_SHA256 Compile the “SHA256” benchmark circuit into the R1CS format.

npm run r1cs_Poseidon Compile the “Poseidon” benchmark circuit into the R1CS format.

npm run r1cs_TwoWorld Compile the “TwoWorld” benchmark circuit into the R1CS format.

npm run r1cs Compile all the benchmark circuits into the R1CS format.

npm run wasm_Uncompressed Produce witness generator for the “Uncompressed” benchmark.

npm run wasm_SHA256 Produce witness generator for the “SHA256” benchmark.

npm run wasm_Poseidon Produce witness generator for the “Poseidon” benchmark.

npm run wasm_TwoWorld Produce witness generator for the “TwoWorld” benchmark.

npm run wasm Produce witness generators for all the benchmarks.

npm run input_Uncompressed Generate input for the “Uncompressed” benchmark.

npm run input_SHA256 Generate input for the “SHA256” benchmark.

npm run input_Poseidon Generate input for the “Poseidon” benchmark.

npm run input_TwoWorld Generate input for the “TwoWorld” benchmark.

npm run input Generate input for all the benchmarks.

npm run witness_Uncompressed Generate witness for the “Uncompressed” benchmark.

npm run witness_SHA256 Generate witness for the “SHA256” benchmark.

npm run witness_Poseidon Generate witness for the “Poseidon” benchmark.

npm run witness_TwoWorld Generate witness for the “TwoWorld” benchmark.

npm run witness Generate witness for all the benchmarks.

npm run zkey_Uncompressed Produce proving and verification keys for the “Uncompressed” benchmark.

npm run zkey_SHA256 Produce proving and verification keys for the “SHA256” benchmark.

npm run zkey_Poseidon Produce proving and verification keys for the “Poseidon” benchmark.

npm run zkey_TwoWorld Produce proving and verification keys for the “TwoWorld” benchmark.

npm run zkey Produce proving and verification keys for all the benchmarks.

npm run verifier_Uncompressed Generate verifier contract code for the “Uncompressed” benchmark.

npm run verifier_SHA256 Generate verifier contract code for the “SHA256” benchmark.

npm run verifier_Poseidon Generate verifier contract code for the “Poseidon” benchmark.

npm run verifier_TwoWorld Generate verifier contract code for the “TwoWorld” benchmark.

npm run verifier Generate verifier contract code for all the benchmarks.

npm run solc_Uncompressed Compile verifier contract for the “Uncompressed” benchmark.

npm run solc_SHA256 Compile verifier contract for the “SHA256” benchmark.

npm run solc_Poseidon Compile verifier contract for the “Poseidon” benchmark.

npm run solc_TwoWorld Compile verifier contract for the “TwoWorld” benchmark.

npm run solc Compile verifier contract for all the benchmarks.

npm run proof_Uncompressed Generate ZK proof for the “Uncompressed” benchmark.

npm run proof_SHA256 Generate ZK proof for the “SHA256” benchmark.

npm run proof_Poseidon Generate ZK proof for the “Poseidon” benchmark.

npm run proof_TwoWorld Generate ZK proof for the “TwoWorld” benchmark.

npm run proof Generate ZK proof for all the benchmarks.

npm run calldata_Uncompressed Generate verifier contract calldata for the “Uncompressed” benchmark.

npm run calldata_SHA256 Generate verifier contract calldata for the “SHA256” benchmark.

npm run calldata_Poseidon Generate verifier contract calldata for the “Poseidon” benchmark.

npm run calldata_TwoWorld Generate verifier contract calldata for the “TwoWorld” benchmark.

npm run calldata Generate verifier contract calldata for all the benchmarks.

npm run verify_Uncompressed Verify ZK proof on chain for the “Uncompressed” benchmark.

npm run verify_SHA256 Verify ZK proof on chain for the “SHA256” benchmark.

npm run verify_Poseidon Verify ZK proof on chain for the “Poseidon” benchmark.

npm run verify_TwoWorld Verify ZK proof on chain for the “TwoWorld” benchmark.

npm run verify Verify ZK proof on chain for all the benchmarks.

npm run prepare_Uncompressed Prepare the “Uncompressed” benchmark by performing the following steps for it: preprocess, r1cs, wasm, input, witness, zkey, verifier, and solc.

npm run prepare_SHA256 Prepare the “SHA256” benchmark by performing the following steps for it: preprocess, r1cs, wasm, input, witness, zkey, verifier, and solc.

npm run prepare_Poseidon Prepare the “Poseidon” benchmark by performing the following steps for it: preprocess, r1cs, wasm, input, witness, zkey, verifier, and solc.

npm run prepare_TwoWorld Prepare the “TwoWorld” benchmark by performing the following steps for it: preprocess, r1cs, wasm, input, witness, zkey, verifier, and solc.

npm run prepare Prepare all the benchmarks.

npm run benchmark_Uncompressed Run the “Uncompressed” benchmark by performing the following steps for it: proof, calldata, and verify.

npm run benchmark_SHA256 Run the “SHA256” benchmark by performing the following steps for it: proof, calldata, and verify.

npm run benchmark_Poseidon Run the “Poseidon” benchmark by performing the following steps for it: proof, calldata, and verify.

npm run benchmark_TwoWorld Run the “TwoWorld” benchmark by performing the following steps for it: proof, calldata, and verify.

npm run benchmark Run all the benchmarks.

About

Reference implementation and benchmarks of the TwoWorlds compression scheme

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •