CipherCapital is a confidential credit infrastructure demo for the OpenBuild Zama bounty. It lets a borrower submit encrypted financial data, compute solvency and creditworthiness with Zama FHE, request a mockUSDC credit line, and grant auditor access without publishing raw assets, liabilities, revenue, burn, or repayment history.
Encrypted financial profile
-> confidential solvency verification
-> confidential credit tier and max line
-> private credit vault decision
-> consent-based auditor access
Public users can see only the outcome handles and decrypted public results:
Solvency: Verified
Credit Tier: A
Max Credit Line: 50,000 mockUSDC
Risk Band: Low
Raw financial fields remain encrypted onchain and are only decryptable by the borrower or an explicitly authorized auditor.
contracts/contracts/ConfidentialCreditProfile.solstores encrypted financial fields and manages ACL permissions for borrower, protocol contracts, and auditors.contracts/contracts/SilentScoreEngine.solcomputes encrypted solvency, reserve status, runway tier, credit tier, risk band, auditor requirement, and max credit line.contracts/contracts/PrivateLoanVault.solchecks requested credit against the encrypted limit and records an encrypted/public-decryptable decision plus issued mock amount.frontend/is a Next.js dashboard using wagmi, viem, lucide-react, and the Zama Relayer SDK.
Encrypted inputs:
assets
liabilities
monthlyRevenue
monthlyBurn
repaymentCount
overdueCount
Main checks:
healthyReserve = assets * 10 >= (liabilities + overdueCount * 1000) * 12
reserveCoversDebt = assets >= liabilities
revenueHealthy = monthlyRevenue * 10 >= monthlyBurn * 6
runwayTier = assets >= monthlyBurn * 6 ? 3 : assets >= monthlyBurn * 3 ? 2 : 1
Credit tiers:
Tier A: healthy reserve, healthy revenue, 6+ months runway, seasoned repayment, <= 1 overdue
Tier B: healthy reserve, healthy revenue or 3+ months runway, <= 5 overdues
Tier C: reserve covers debt, <= 7 overdues
Rejected: otherwise
Credit lines:
A -> 50,000 mockUSDC
B -> 20,000 mockUSDC
C -> 5,000 mockUSDC
Rejected -> 0
Install and test contracts:
cd contracts
npm install
npm run compile
npm testThe test suite uses Zama's Hardhat mock FHEVM mode and covers:
- encrypted profile submission
- Tier A/B/C risk computation
- public decryption of public outcomes
- loan approval and over-limit rejection
- auditor user-decryption access to raw encrypted fields
Build the frontend:
cd frontend
npm install
npm run lint
npm run buildCreate contracts/.env from contracts/.env.example:
SEPOLIA_RPC_URL=https://...
PRIVATE_KEY=0x...Deploy:
cd contracts
npm run deploy:sepoliaCopy the printed addresses into frontend/.env.local:
NEXT_PUBLIC_PROFILE_CONTRACT=0x...
NEXT_PUBLIC_SCORE_ENGINE_CONTRACT=0x...
NEXT_PUBLIC_LOAN_VAULT_CONTRACT=0x...
NEXT_PUBLIC_SEPOLIA_RPC_URL=https://...Run the dApp:
cd frontend
npm run devOnchain lending is usually overcollateralized or fully transparent. Real borrowers do not want to reveal cash reserves, liabilities, revenue, burn, and repayment history just to prove they are creditworthy.
CipherCapital uses Zama FHE to compute solvency and creditworthiness directly on encrypted financial data. The chain stores ciphertext handles, while the public only sees risk outcomes.
Submit the encrypted profile, compute the risk profile, show Tier A and a 50,000 mockUSDC max line, then request a 10,000 mockUSDC credit line.
Show the auditor portal. A borrower can grant an auditor user-decryption access to raw encrypted fields for consent-based compliance review.
CipherCapital makes confidential credit possible on public blockchains: private for borrowers, useful for lenders, and auditable for compliance.