Skip to main content

ERC-8004 ZK Validation Quick Reference

Contract Addresses

Base Sepolia (Chain ID: 84532)

IdentityRegistry:      0x8004A818BFB912233c491871b3d84c89A494BD9e
ReputationRegistry: 0x8004B663056A597Dffe9eCcC1965A193B7388713
RebalancerVerifier: 0x07A1Dc74Ec0C2F3F9e605Ad464A048099793be09

Ethereum Sepolia (Chain ID: 11155111)

IdentityRegistry:      0x8004A818BFB912233c491871b3d84c89A494BD9e
ReputationRegistry: 0x8004B663056A597Dffe9eCcC1965A193B7388713
RebalancerVerifier: 0x752AC7b1b6707399b989a6c5c68EADfcE041eE7C

Circuit Constraints

#ConstraintFormulaPurpose
1Liquidityliquidity * 85 > zyfiTvl * 100Sufficient liquidity
2TVLpoolTvl * 1e6 > amount * 400Max 25% allocation
3APYnewApy > oldApy + 10 OR edge cases0.1%+ improvement
4APY StabilityapyStable7Days == 17-day stability
5TVL StabilitytvlStable == 1Pool stability

Input Scaling

FieldScalingExample
Liquidity, TVL×100$100,000.00 → 10000000
APY×100008.0952% → 80952
AmountToken units2.00519 USDC → 2005190
Booleans0 or 1Stable → 1

Public Signals Order (15 signals)

[
liquidity, // 1. Available liquidity (×100)
zyfiTvl, // 2. Zyfai TVL (×100)
amount, // 3. Rebalancer amount (token units)
poolTvl, // 4. Pool TVL (×100)
newApy, // 5. New APY (×10000)
apyStable7Days, // 6. APY stable? (0/1)
tvlStable, // 7. TVL stable? (0/1)
oldApy, // 8. Old APY (×10000)
oldLiquidity, // 9. Old liquidity (×100)
oldZyfiTvl, // 10. Old Zyfai TVL (×100)
oldTvlStable, // 11. Old TVL stable? (0/1)
oldUtilizationStable, // 12. Old utilization stable? (0/1)
oldCollateralHealth, // 13. Old collateral healthy? (0/1)
oldZyfiTVLCheck, // 14. Old Zyfai TVL check? (0/1)
supportsCurrentPool, // 15. Current pool supported? (0/1)
];

Workflow Diagram

┌─────────────────┐
│ 1. REGISTER │
│ Agent NFT ID │
└────────┬────────┘


┌─────────────────┐
│ 2. GENERATE │
│ ZK Proof │
└────────┬────────┘


┌─────────────────┐
│ 3. STORE │
│ Proof on IPFS │
└────────┬────────┘


┌─────────────────┐
│ 4. REQUEST │
│ Validation │
└────────┬────────┘


┌─────────────────┐
│ 5. VERIFY │
│ On-Chain │
└────────┬────────┘


┌─────────────────┐
│ 6. FEEDBACK │
│ Score (0-100) │
└─────────────────┘

Example Proof

IPFS: View Full Proof

Data:

{
"publicSignals": [
"125570357", // $1,255,703.57 liquidity
"10226", // $102.26 Zyfai TVL
"2005190", // 2.00519 USDC
"1016077651", // $10,160,776.51 pool TVL
"80952", // 8.0952% APY
"1",
"1", // APY & TVL stable
"0",
"0",
"0", // No old opportunity
"1",
"1",
"1",
"1",
"1" // All checks pass
],
"verifierAddress": "0x07A1Dc74Ec0C2F3F9e605Ad464A048099793be09",
"chainId": 84532
}

Resources

ResourceLink
GitHub RepositoryZyfai ERC-8004 Implementation
ERC-8004 StandardEIP-8004
Circuit Sourcerebalancer-validation.circom
Example ProofIPFS Gateway

Need Help?