Verifying Proof

This flow diagram illustrates the process of Verifying Proof

Step 1: Set Up Details

Replace the placeholder values with your actual details:

const zkPassProof = "YOUR_ZKPASS_PROOF";
const validator = new ZkPassProofMetadataValidator(); //YOUR_ZKPASS_PROOF_METADATA_VALIDATOR_CLASS

Step 2: Verify Proof

Verify Siwe using promise & try and catch:

import type { Verifier } from "@didpass/verifier-sdk";
return new Promise(async (resolve, reject) => {
  try {
    const result = await verifier.verifyProof(
      zkPassProof,
      validator
    );
    resolve(result);
  } catch (err) {
    reject(err);
  }
});

Final Code

Here's the complete code:

import type { Verifier } from "@didpass/verifier-sdk";

async function verifyProof() {
  const zkPassProof = "YOUR_ZKPASS_PROOF";
  const validator = new ZkPassProofMetadataValidator(); //YOUR_ZKPASS_PROOF_METADATA_VALIDATOR_CLASS
  const verifier = new Verifier();
  
  return new Promise(async (resolve, reject) => {
    try {
      const result = await verifier.verifyProof(zkPassProof, validator);
      resolve(result);
    } catch (err) {
      reject(err);
    }
  });
}

Last updated