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
I'm trying to verify the DCAP ZKP on chain via the Solidity smart contract.
I'm able to generate the proof, verify the proof on my machine, and generate the Solidity smart contract correctly.
However, when I try to verify the proof with Truffle, I get the following error:
Compiling your contracts...===========================
> Compiling ./contracts/verifier.sol
> Artifacts written to /var/folders/6x/bs175kk945z9qhqcl0btt6sm0000gn/T/test--61440-1tB505qxWkv4
> Compiled successfully using: - solc: 0.8.19+commit.7dd6d404.Emscripten.clang Contract: VerifierProof verification failed: Error: Transaction has been reverted by the EVM:{ "transactionHash": "0x4bcbdd9ecde6c352b4d740676b50f2306f2f6842d06e018f9ae8b814a179700d", "transactionIndex": 0, "blockNumber": 2, "blockHash": "0x11d1c5a195c69959c40efffd917266dede16146357c8ad33481cc6764c47248f", "from": "0x627306090abab3a6e1400e9345bc60c78a8bef57", "to": "0x8cdaf0cd259887258bc13a92c0a6da92698644c0", "cumulativeGasUsed": 90000, "gasUsed": 90000, "contractAddress": null, "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "status": false, "effectiveGasPrice": 3410045336, "type": "0x2"} at Object.TransactionError (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-helpers/lib/errors.js:90:1) at Object.TransactionRevertedWithoutReasonError (/usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-helpers/lib/errors.js:101:1) at /usr/local/lib/node_modules/truffle/build/webpack:/node_modules/web3-core-method/lib/index.js:396:1 at processTicksAndRejections (node:internal/process/task_queues:95:5) { receipt: { transactionHash: '0x4bcbdd9ecde6c352b4d740676b50f2306f2f6842d06e018f9ae8b814a179700d', transactionIndex: 0, blockNumber: 2, blockHash: '0x11d1c5a195c69959c40efffd917266dede16146357c8ad33481cc6764c47248f', from: '0x627306090abab3a6e1400e9345bc60c78a8bef57', to: '0x8cdaf0cd259887258bc13a92c0a6da92698644c0', cumulativeGasUsed: 90000, gasUsed: 90000, contractAddress: null, logs: [], logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', status: false, effectiveGasPrice: 3410045336, type: '0x2' }} ✔ Should verify (194ms) 1 passing (242ms)
The truffle test I'm running is the following:
constSolidityVerifier=artifacts.require("Halo2Verifier");const{ TextEncoder }=require("util");constfs=require("fs");contract("Verifier",(accounts)=>{it("Should verify",async()=>{constverifier=awaitSolidityVerifier.deployed();// Read calldata from calldata.binconstcalldataHex=fs.readFileSync("test/calldata.bin","utf-8").trim();try{// Call the fallback function of the contract with the calldataconstresult=awaitweb3.eth.sendTransaction({from: accounts[0],// Replace with appropriate account if neededto: verifier.address,data: calldataHex});// If the call succeeds, the proof is validconsole.log("Proof verified successfully.");}catch(error){// If the call fails (reverts), the proof is invalidconsole.error("Proof verification failed:",error);}});});
I have not modified the solidity smart contract and I generated the proof and the calldata the following way:
I'm trying to verify the DCAP ZKP on chain via the Solidity smart contract.
I'm able to generate the proof, verify the proof on my machine, and generate the Solidity smart contract correctly.
However, when I try to verify the proof with Truffle, I get the following error:
The truffle test I'm running is the following:
I have not modified the solidity smart contract and I generated the proof and the calldata the following way:
With
params.json
being the following file:What can I do to solve this issue?
The text was updated successfully, but these errors were encountered: