diff --git a/packages/protocols/README.md b/packages/protocols/README.md index f089dde..4e8d7f6 100644 --- a/packages/protocols/README.md +++ b/packages/protocols/README.md @@ -82,6 +82,6 @@ const signal = "Hello world" const externalNullifier = BigInt(1) const witness = Semaphore.genWitness(identity, merkleProof, externalNullifier, signal) -const fullProof = await Semaphore.genProof(witness, "./semaphore.wasm", "./semaphore.zkey") -const solidityProof = Semaphore.packToSolidityProof(fullProof) +const { proof, publicSignals } = await Semaphore.genProof(witness, "./semaphore.wasm", "./semaphore.zkey") +const solidityProof = Semaphore.packToSolidityProof(proof) ``` diff --git a/packages/protocols/src/semaphore.ts b/packages/protocols/src/semaphore.ts index 7a09dba..ad0c201 100644 --- a/packages/protocols/src/semaphore.ts +++ b/packages/protocols/src/semaphore.ts @@ -1,7 +1,7 @@ import { MerkleProof } from "@zk-kit/incremental-merkle-tree" import { poseidon } from "circomlibjs" import { groth16 } from "snarkjs" -import { SemaphoreFullProof, SemaphoreSolidityProof, SemaphoreWitness, StrBigInt } from "./types" +import { Proof, SemaphoreFullProof, SemaphoreSolidityProof, SemaphoreWitness, StrBigInt } from "./types" import { genSignalHash } from "./utils" export default class Semaphore { @@ -91,9 +91,7 @@ export default class Semaphore { * @returns The Solidity compatible proof. */ /* istanbul ignore next */ - public static packToSolidityProof(fullProof: SemaphoreFullProof): SemaphoreSolidityProof { - const { proof } = fullProof - + public static packToSolidityProof(proof: Proof): SemaphoreSolidityProof { return [ proof.pi_a[0], proof.pi_a[1],