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
| Type | Description |
|---|---|
ScoreAboveThreshold | Proves score ≥ threshold in a given category |
AgeVerification | Proves 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
| Field | Rules |
|---|---|
subject | Valid Ethereum address |
proofType | Required string |
minimumAge | Optional integer (for AgeVerification type) |
Verify Proof
POST /api/v1/reputation/verify
{
"proof": "0x1a2b3c4d..."
}
Response
{
"valid": true
}
Validation
| Field | Rules |
|---|---|
proof | Required, 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.