A more simple and concise implementation of snark tools in javascript. ## Goals - isomorphic implementation (browser/nodejs support) - ESM module, easily tree shakeable/lazy loadable - benchmark different BigInt implementations - Always expose ES2020 BigInts to external consumers The implementation will start with the `alt_bn128` curve, but will be built to support easily switching curves, where possible. ## Rough order of operations ### 1. ZKey parsing/contributing support Parsing zkeys and verifying/adding phase 2 contributions seems like a good first step. We can start using our implementation internally for the trusted setup team. e.g. look into generating signatures for contributions so the whole chain doesn't need to be stored/verified. ### 2. groth16 proofs Take an existing zkey and generate a witness and make/verify a proof. Open questions: - Can we avoid using wasm to generate a witness (e.g. generate in pure js)? - _Should_ we put in the effort of parsing a circom file to get witness variable names? - Would it be performant? Using wasm for the witness _may_ be acceptable, especially as an initial approach. ### 3. HALO2 proofs Add support for generating/verifying halo2 proofs in browser by exporting a wasm file with a specific ABI. ### 4. Export solidity verifiers Add support for exporting Solidity verifiers for groth16/halo2 proofs. ### 5. PTAU operations Parse a phase 1 keyfile and make contributions.