You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generates wrong proof for given zokrates code ,which generates false as ouput every time when verified.Below code is implemented in reactjs app.
const runZokrates = async () => {
const zokratesProvider = await initialize();
const code = def main(private field a) -> field { return true; };
const artifacts = await zokratesProvider.compile(code);
const {witness,output} = await zokratesProvider.computeWitness(artifacts,["2"]);
console.log(witness); // Resulting witness which can be used to generate a proof
console.log(output); // Computation output: "4"
setWitness(witness);
setOutput(output);
const keypair = await zokratesProvider.setup(artifacts.program);
setkeypair(keypair)
const proof = await zokratesProvider.generateProof(artifacts.program,witness,keypair);
setproof(proof)
// console.log([proof.proof.a, proof.proof.b, proof.proof.c], proof.inputs);
const { ethereum } = window;
const provider = new ethers.providers.Web3Provider(ethereum);
const signer = provider.getSigner();
const contract = "0x2e48698055571a60cA9Fb9F052254d4e7A097092";
const con = new ethers.Contract(contract,Verifier.abi,signer);
console.log(con)
const res = await con.verifyTx([proof.proof.a,proof.proof.b,proof.proof.c],proof.inputs);
const isVerified = zokratesProvider.verify(keypair.vk, proof);
//console.log(isVerified)
console.log('Proof:', proof);
console.log('Is Verified:', isVerified);
console.log("Res"+res)
};
runZokrates();
The text was updated successfully, but these errors were encountered:
Description
Generates wrong proof for given zokrates code ,which generates false as ouput every time when verified.Below code is implemented in reactjs app.
const runZokrates = async () => {
const zokratesProvider = await initialize();
const code =
def main(private field a) -> field { return true; }
;const artifacts = await zokratesProvider.compile(code);
The text was updated successfully, but these errors were encountered: