Options
All
  • Public
  • Public/Protected
  • All
Menu

@semaphore-protocol/proof

Index

Type Aliases

BigNumberish: string | bigint
FullProof: { proof: Proof; publicSignals: PublicSignals }

Type declaration

Proof: { curve: string; pi_a: BigNumberish[]; pi_b: BigNumberish[][]; pi_c: BigNumberish[]; protocol: string }

Type declaration

PublicSignals: { externalNullifier: BigNumberish; merkleRoot: BigNumberish; nullifierHash: BigNumberish; signalHash: BigNumberish }

Type declaration

SnarkArtifacts: { wasmFilePath: string; zkeyFilePath: string }

Type declaration

  • wasmFilePath: string
  • zkeyFilePath: string

Functions

  • Generates a nullifier by hashing the external and the identity nullifiers.

    Parameters

    Returns bigint

    The nullifier hash.

  • generateProof(identity: default, groupOrMerkleProof: default | MerkleProof, externalNullifier: BigNumberish, signal: string, snarkArtifacts?: SnarkArtifacts): Promise<FullProof>
  • generateSignalHash(signal: string): bigint
  • Hashes a signal string with Keccak256.

    Parameters

    • signal: string

      The Semaphore signal.

    Returns bigint

    The signal hash.

  • verifyProof(verificationKey: any, fullProof: FullProof): Promise<boolean>
  • Verifies a SnarkJS proof.

    Parameters

    • verificationKey: any

      The zero-knowledge verification key.

    • fullProof: FullProof

      The SnarkJS full proof.

    Returns Promise<boolean>

    True if the proof is valid, false otherwise.

Generated using TypeDoc