CredTrust is a decentralized credit scoring protocol that converts on-chain behavior into verifiable crypto credit scores. This MVP demonstrates how blockchain activity can translate into a transparent, user-owned credit score for DeFi applications.
- On-Chain Credit Scoring: Converts blockchain activity into a verifiable credit score
- Score Visualization: Interactive charts showing score composition
- Attestation System: Stake TRUST tokens to vouch for your score credibility
- Credit Gate: Demo system that gates access based on credit score
- IPFS Integration: Verifiable score data stored on decentralized storage
- Wallet Integration: Connect with any Web3 wallet
Frontend
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS
- Recharts
- Wagmi + Web3Modal
Blockchain
- Ethereum (Sepolia testnet)
- The Graph (for on-chain data indexing)
- IPFS (for decentralized storage)
- Smart Contracts (Solidity)
Design
- Geist Font
- Dark Mode UI
- Responsive Layout
Prerequisites
- Node.js v18+
- npm
- Web3 wallet (MetaMask, Coinbase Wallet, etc.)
Installation
- Clone the repository:
git clone https://github.com/your-username/credtrust-mvp.git
cd credtrust-mvp- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser and visit:
http://localhost:3000
- Configuration Create a .env.local file in the root directory with the following environment variables:
cp .env.example .envsrc/
├── app/ # Main application
│ ├── components/ # Reusable components
│ │ ├── AttestationsCard.tsx
│ │ ├── CreditGateModal.tsx
│ │ ├── ScoreCard.tsx
│ │ ├── ScoreChart.tsx
│ │ ├── StakeModal.tsx
│ │ └── WalletButton.tsx
│ ├── ClientBody.tsx # Client-side body component
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── lib/
│ └── utils.ts # Utility functions
public/ # Static assets
CredTrust demonstrates a decentralized credit scoring system:
- Data Aggregation: Collects on-chain data from:
- Aave loan repayments
- Uniswap liquidity provisioning
- Staking history
- Transaction patterns
- Score Calculation: Computes a credit score based on:
- Payment history (40%)
- Liquidity duration (30%)
- Staking consistency (20%)
- Transaction volume (5%)
- Identity verification (5%)
- Verification & Storage:
- Scores stored on IPFS with content-addressable IDs
- Hashes anchored to Ethereum blockchain
- Fully auditable and recalculatable
- Attestation System:
- Users stake TRUST tokens to vouch for their score
- Malicious actors risk losing stakes
- Community-driven dispute resolution
- Credit Applications:
- Lenders can gate access based on credit score
- Demo shows under-collateralized loan eligibility
- Connect Wallet:
- Click "Connect Wallet" in the top right
- Select your preferred wallet provider
- Sign the connection request
- View Your Score:
- See your current credit score (750/900 by default)
- View score composition in the interactive chart
- Recalculate to see potential score changes
- Stake TRUST Tokens:
- Click "Stake TRUST" in the Attestations card
- Adjust the slider to select amount
- Confirm to create an attestation
- Test Credit Gate:
- Click "Try Credit Gate" in the Demo Consumer card
- See if you qualify for under-collateralized loans
- Get personalized feedback to improve your score
- Inspect IPFS Data:
- Click "View IPFS JSON" in Your Score card
- See the verifiable data behind your score
- Integrate with The Graph for real on-chain data
- Implement smart contract interactions
- Add dispute resolution system
- Create score delegation functionality
- Develop DAO governance for algorithm updates
This project was inspired by the need for decentralized credit systems in Web3 and builds on concepts from:
- Aave Credit Delegation
- Chainlink Oracle Networks
- Kleros Dispute Resolution
- Zero-Knowledge Proof concepts for privacy
CredTrust - Building trust in the decentralized world
