How to use the snarkjs.original.isValid function in snarkjs

To help you get started, we’ve selected a few snarkjs examples, based on popular ways it is used in public projects.

github barryWhiteHat / maci / app / utils / generate_circuit_input.js View on Github external
signature_S: signature.S,
  sender_proof: [bobHash],
  sender_proof_pos: [1]
}

const circuit = new Circuit(circuitDef)

console.log('Calculating witnesses....')
const witness = circuit.calculateWitness(circuitInput)

console.log('Generating proof....')
const { proof, publicSignals } = zkSnark.genProof(
  unstringifyBigInts(provingKey), witness
)

const isValid = zkSnark.isValid(
  unstringifyBigInts(verificationKey),
  proof,
  publicSignals
)

console.log(`Inputs passes circuit: ${isValid}`)