Closed semaraugusto closed 1 year ago
Describe the bug When using a group with maxEdges == 7 the smart-contract and typescript interfaces don't properly generate the correct publicSignals to the verifyProof function on Semaphore.sol To Reproduce Setup variables:
Semaphore.sol
const chainID = BigInt(1099511629113) // Hardhat default TypedChainId const wasmFilePath20_8 = __dirname + `/../../solidity-fixtures/solidity-fixtures/${treeDepth}/8/semaphore_20_8.wasm` const witnessCalcPath20_8 = __dirname + `/../../solidity-fixtures/solidity-fixtures/${treeDepth}/8/witness_calculator.js` const zkeyFilePath20_8 = __dirname + `/../../solidity-fixtures/solidity-fixtures/${treeDepth}/8/circuit_final.zkey` const { identities, members } = createIdentities(Number(chainID), 3) const signal = "Hello world" const bytes32Signal = utils.formatBytes32String(signal) const groupId3 = 1338 const maxEdges = 7 const linkedGroup = new LinkedGroup(treeDepth, maxEdges) linkedGroup.addMember(members[0])
await semaphore.createGroup(groupId, treeDepth, adminAddr, maxEdges)
await semaphore.addMember(groupId, commitment)
const fullProof = await generateProof( identities[0], linkedGroup, BigNumber.from(Date.now()), signal, chainID, { wasmFilePath: wasmFilePath20_8, zkeyFilePath: zkeyFilePath20_8 } ) const solidityProof = packToSolidityProof(fullProof.proof)
const transaction = semaphore.contract.verifyProof( groupId3, bytes32Signal, fullProof.publicSignals.nullifierHash, fullProof.publicSignals.externalNullifier, createRootsBytes(fullProof.publicSignals.roots), solidityProof, { gasLimit: "0x5B8D80" } )
**Expected behavior** Proof should be verified, but it's currently being reverted.
Closed in https://github.com/webb-tools/semaphore-anchor/pull/10
Describe the bug When using a group with maxEdges == 7 the smart-contract and typescript interfaces don't properly generate the correct publicSignals to the verifyProof function on
Semaphore.sol
To Reproduce Setup variables:Semaphore.sol
:await semaphore.createGroup(groupId, treeDepth, adminAddr, maxEdges)
await semaphore.addMember(groupId, commitment)