Skip to main content

ZK Proofs API

Generate and verify zero-knowledge proofs of reputation scores. Proofs use Groth16 SNARKs so a verifier can confirm a score meets a threshold without learning the actual score.

Generate Proof

POST /api/v1/reputation/prove
{
"subject": "0x1234...",
"proofType": "ScoreAboveThreshold",
"category": "DEFI_LENDING",
"threshold": 700
}

Proof Types

TypeDescription
ScoreAboveThresholdProves score ≥ threshold in a given category
AgeVerificationProves user meets minimum age requirement

Response

{
"proof": "0x1a2b3c4d...",
"proofType": "ScoreAboveThreshold"
}

The proof field is a hex-encoded Groth16 proof that can be verified on-chain or via the Verify endpoint.

Validation

FieldRules
subjectValid Ethereum address
proofTypeRequired string
minimumAgeOptional integer (for AgeVerification type)

Verify Proof

POST /api/v1/reputation/verify
{
"proof": "0x1a2b3c4d..."
}

Response

{
"valid": true
}

Validation

FieldRules
proofRequired, max 10,000 characters

On-Chain Verification

Proofs can also be verified directly on the ReputationOracle smart contract:

function verifyProof(
bytes calldata proof,
uint256 threshold,
ScoreCategory category
) external view returns (bool);

See the Smart Contracts section for contract addresses and ABIs.