Skip to main content

Overview

Use zero-knowledge proofs to verify score thresholds or achievements without revealing exact values.

Implementation

// Prove score > 500 without revealing exact score
async function proveScoreThreshold(user, threshold) {
  const score = await zkScore.getScore(user);
  const proof = await generateZKProof({
    public: { threshold },
    private: { actualScore: score.total }
  });
  
  return proof;
}

// Verify proof
async function verifyScoreProof(proof, threshold) {
  return await verifyZKProof(proof, threshold);
}