Privacy-Preserving Credit Scoring for DeFi
PrivaScore enables underbanked individuals to prove their creditworthiness without exposing their financial history. By processing sensitive data in Trusted Execution Environments (TEE), we unlock undercollateralized lending in DeFi while preserving user privacy.
2 billion people globally are underbanked, yet they have valuable financial history:
- Mobile money payments (M-Pesa, PayPal)
- Gig economy earnings (Uber, Stripe)
- Utility and rent payments
In DeFi, they're invisible. Current lending requires:
- Over-collateralization (lock $150 to borrow $100), OR
- Exposing entire financial history on-chain forever
PrivaScore solves this by enabling credit verification without data exposure.
Financial Data (Private) → TEE Processing → Credit Score (Verifiable)
↓ ↓ ↓
Bank Statements AI Analysis zkProof Published
M-Pesa History Risk Assessment Score Hash On-Chain
PayPal Earnings Privacy Preserved Portable Identity
- Upload & Encrypt - User uploads financial documents (CSV, PDF)
- TEE Processing - Data processed in secure enclave via iExec
- Credit Scoring - Algorithm analyzes:
- Payment consistency (40%)
- Income stability (30%)
- Debt management (30%)
- Verifiable Output - Only score hash published on-chain
- Borrow - Use score across DeFi protocols
┌─────────────────┐
│ Frontend │
│ (Next.js) │
└────────┬────────┘
│
▼
┌─────────────────┐
│ iExec Data │
│ Protector │
└────────┬────────┘
│
▼
┌─────────────────┐
│ TEE Worker │
│ (Confidential) │
│ │
│ ┌───────────┐ │
│ │ Python │ │
│ │ Credit │ │
│ │ Scorer │ │
│ └───────────┘ │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Smart Contract │
│ Score Storage │
└─────────────────┘
Frontend:
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS
- iExec DataProtector SDK
- ethers.js
Backend (TEE):
- Python 3.13
- iExec TEE (SCONE)
- Docker
- Arbitrum Sepolia
Blockchain:
- Arbitrum Sepolia Testnet
- iExec Protocol
- Smart Contracts for score storage
# Required
- Node.js 18+
- MetaMask wallet
- Arbitrum Sepolia ETH (from faucet)
- Docker (for local testing)- Clone the repository
git clone https://github.com/Ted1166/privascore.git
cd privascore- Frontend Setup
cd frontend
npm install- Environment Configuration
# Create .env.local
echo "NEXT_PUBLIC_IAPP_ADDRESS=0xd5728B47b7182A4C0944921c77fE158E2885F503" > .env.local- Run Frontend
npm run dev
# Open http://localhost:3000- Navigate to TEE app
cd iapp-credit-scorer- Test locally
iapp test --protectedData test-transactions- Deploy to iExec
iapp deploy
# Save the returned app addressSample CSV format for testing:
date,amount,description
01/01/2024,2500,Salary Deposit
01/05/2024,-800,Rent Payment
01/10/2024,-200,Groceries
01/15/2024,2500,Salary Deposit
01/20/2024,-150,Utilities
02/01/2024,2500,Salary Deposit
02/05/2024,-800,Rent Payment
02/15/2024,2500,Salary DepositFormat Requirements:
- Header row:
date,amount,description - Positive amounts = income
- Negative amounts = expenses
- Minimum 5 transactions for meaningful score
- Connect Wallet - MetaMask on Arbitrum Sepolia
- Upload CSV - Bank statement or financial history
- Process in TEE - Data encrypted and analyzed privately
- View Score - Credit score (300-850) with tier classification
- Request Loan - Use score for undercollateralized borrowing
Processing Time: 2-5 minutes
Privacy: Raw data never leaves TEE, only score hash on-chain
✅ Data Encryption - End-to-end encryption before upload
✅ TEE Processing - Computation in hardware-isolated environment
✅ Zero-Knowledge Proof - Only score hash published
✅ User Control - Data owner decides who can access
✅ No Data Storage - Raw data deleted after processing
- Hardware Root of Trust: Intel SGX / AMD SEV
- Verifiable Computation: iExec proof-of-execution
- Decentralized: No single point of failure
- Auditable: Open-source scoring algorithm
# Scoring Components (out of 100 raw points)
1. Payment Consistency (40 points)
- Ratio of positive to total transactions
- Higher income frequency = better score
2. Income Stability (30 points)
- Coefficient of variation in income
- Lower variance = better score
3. Debt Management (30 points)
- Debt-to-income ratio
- Lower expenses/income = better score
# Final Score Calculation
raw_score = consistency + stability + debt_score
final_score = 300 + (raw_score * 5.5) # Scale to 300-850Emerging Markets:
- 📱 M-Pesa users in Kenya
- 💰 Mobile money in Nigeria, Ghana
- 🏦 Underbanked in Southeast Asia
Developed Markets:
- 🚗 Gig economy workers (Uber, DoorDash)
- 💼 Freelancers with irregular income
- 🎓 Young professionals without credit history
Benefits:
- Reduce default risk
- Expand user base
- Enable undercollateralized loans
- Increase protocol revenue
# Test backend TEE app
cd iapp-credit-scorer
iapp test --protectedData test-transactions
# Expected output:
# ✓ Score: 665 (FAIR)
# ✓ Confidence: 16%
# ✓ Transaction count: 8# Run frontend tests
cd frontend
npm test
# E2E tests
npm run test:e2eiApp Address (Arbitrum Sepolia):
0xd5728B47b7182A4C0944921c77fE158E2885F503
Score Storage Contract:
Coming soon...
- Fork the repo
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
MIT License - see LICENSE file for details.
- Ted Adams - Software Developer - @yourtwitter
- iExec - For TEE infrastructure and DataProtector SDK
- Arbitrum - For scalable L2 infrastructure
- Hackathon Organizers - For the opportunity
- Website: privascore
- Twitter: coming soon
- Email: ogolated00@gmail.com
- Discord: coming soon
Built with ❤️ for the Underbanked
Making Credit Accessible, Privacy Preserved