• Creates a zero-knowledge proof to prove that you have the pre-image of a Semaphore commitment, without disclosing the actual preimage itself. The use of a scope parameter along with a nullifier helps ensure the uniqueness and non-reusability of the proofs, enhancing security in applications like blockchain transactions or private data verification. If, for example, this package were used with Semaphore to demonstrate possession of a Semaphore identity of a group of voters, the scope could be the poll's ID.

    Parameters

    • privateKey: string | Uint8Array | Buffer

      The private key of the commitment.

    • scope: BigNumberish | Uint8Array

      A public value used to contextualize the cryptographic proof and calculate the nullifier.

    • Optional snarkArtifacts: SnarkArtifacts

      The Snark artifacts (wasm and zkey files) generated in a trusted setup of the circuit are necessary to generate valid proofs

    Returns Promise<IdentityProof>

    The Poseidon zero-knowledge proof.