Constructs a new Prover instance.
The Interface Description Language (IDL) for the proof system, as generated by ANCHOR framework. Used to retrieve a parsed account struct to read an object of a circuit proof inputs.
The initial path used for building paths to circuit-related files i.e. wasm and zkey files.
Adds proof inputs after reading and parsing the circuit's proof inputs struct from the idl.
Will throw an error if the circuit's proof inputs structure does not exist in the IDL, or if any of the required proof inputs is missing.
An object containing the proof inputs to be added. The keys of this object should correspond to the field names in the zk-SNARK circuit's proof inputs structure in the IDL, and the values should be the corresponding proof inputs.
Performs a full proof generation and parsing process.
An object containing the parsed proof and parsed public inputs.
Parses a proof to a bytes array that will be used for zk proof verification for the groth16-solana crate.
The proof to be parsed.
An object containing the parsed proof.
Will throw an error if the public input array is undefined, or if the number of public inputs does not match the expected number.
A two-dimensional array of numbers representing the public inputs for a zk-SNARK, where each inner array is a byte array of a public input value.
An object where each key is the name of a public input, and each value is the parsed public input value. The shape and structure of the values depend on the specific zk-SNARK circuit.
Verifies the proof generated by this class or a passed in proof.
Optional
proof: proofDataThe optional proof to be verified. If not provided, the proof generated by this class is verified.
A promise that resolves to a boolean indicating whether the proof is valid.
Generated using TypeDoc
Prover class for zero-knowledge proof systems using SNARKJS and CIRCOM circuits.