ProofVerifier class

This class is defined

This is the class used to verify the proof generated by ProofGenerator object.

You can use the ProofVerifier as is without subclassing it if you have the standard output variables which are the timestamp and the constraint status. If your proof function has custom output parameters, then you need to subclass this class and override the parseCustomOutput method.

export default class ProofVerifier<Type> {
  private zkpComponentPath: string;
  private zkpComponentName: string;

  constructor(
    zkpComponentPath: string,
    zkpComponentName: string
  ) {
    this.zkpComponentPath = zkpComponentPath;
    this.zkpComponentName = zkpComponentName;
  }

  protected parseRequiredOutput(output: Array<string>): RequiredOutput {
    // ... deleted for clariry
  }

  protected parseCustomOutput(output: Array<string>): Type|null {
    return null;
  }

  verifyProof = async (
    proof: string,
    output: Array<string>
  ): Promise<Type|null> => {
    // ... deleted for clarity
  }
}

Last updated