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
| # | Constraint | Formula | Purpose |
|---|---|---|---|
| 1 | Liquidity | liquidity * 85 > zyfiTvl * 100 | Sufficient liquidity |
| 2 | TVL | poolTvl * 1e6 > amount * 400 | Max 25% allocation |
| 3 | APY | newApy > oldApy + 10 OR edge cases | 0.1%+ improvement |
| 4 | APY Stability | apyStable7Days == 1 | 7-day stability |
| 5 | TVL Stability | tvlStable == 1 | Pool stability |
Input Scaling
| Field | Scaling | Example |
|---|---|---|
| Liquidity, TVL | ×100 | $100,000.00 → 10000000 |
| APY | ×10000 | 8.0952% → 80952 |
| Amount | Token units | 2.00519 USDC → 2005190 |
| Booleans | 0 or 1 | Stable → 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
| Resource | Link |
|---|---|
| GitHub Repository | Zyfai ERC-8004 Implementation |
| ERC-8004 Standard | EIP-8004 |
| Circuit Source | rebalancer-validation.circom |
| Example Proof | IPFS Gateway |
Need Help?
- Read the circuit specification for detailed implementation information
- Explore the example proof
- Check the GitHub repository