StreetCred is a secure, AI-driven credit scoring platform designed to lower collateral requirements for DeFi lending. By combining on-chain and off-chain financial data, computed within a Trusted Execution Environment (TEE), and secured through Transport Layer Security (TLS), StreetCred provides a verifiable and privacy-preserving credit score that improves capital efficiency.
- π Privacy-Preserving: All data processing happens in secure TEE enclaves
- π€ AI-Powered Analysis: Uses Google Gemini AI for intelligent financial data analysis
- π Multi-Chain Support: Analyzes on-chain activity across multiple blockchains
- π¦ Traditional Finance Integration: Connects to bank accounts via Plaid API
- π Real-time Credit Scoring: Provides instant credit scores based on comprehensive data
- π‘οΈ Enterprise Security: TLS encryption and TEE protection throughout the pipeline
StreetCred consists of multiple interconnected components:
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Frontend UI β β Backend API β β TEE Enclave β
β (Next.js) βββββΊβ (FastAPI) βββββΊβ (Python) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Plaid API β β Blockchain β β Gemini AI β
β (Bank Data) β β (On-chain) β β (Analysis) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
- Framework: FastAPI - Modern, fast web framework for building APIs
- AI/ML: Google Gemini AI - Advanced AI model for financial data analysis
- Blockchain: Web3.py - Ethereum and multi-chain integration
- Security: Cryptography - TLS encryption and secure communications
- Data Validation: Pydantic - Data validation using Python type annotations
- HTTP Client: httpx - Modern async HTTP client
- Logging: Structlog - Structured logging for better observability
- Framework: Next.js 15 - React framework with SSR/SSG capabilities
- UI Components: Radix UI - Accessible, unstyled UI primitives
- Styling: Tailwind CSS - Utility-first CSS framework
- State Management: TanStack Query - Server state management
- Blockchain Integration: Wagmi + Viem - Ethereum hooks and utilities
- Forms: React Hook Form + Zod - Form handling and validation
- Animations: Framer Motion - Production-ready motion library
- 3D Graphics: Three.js + React Three Fiber - 3D visualizations
- Containerization: Docker - Containerized deployment
- Web Server: Nginx - Reverse proxy and load balancing
- Process Management: Supervisord - Process control system
- Package Management: UV - Fast Python package installer
- Code Quality: Ruff - Fast Python linter and formatter
- Type Checking: Pyright - Static type checker for Python
- Banking Data: Plaid API - Secure bank account connectivity
- AI Processing: Google Gemini AI - Advanced AI analysis
- Blockchain: Flare Network - Primary blockchain integration
- Security: Google Cloud TEE - Trusted Execution Environment
- Python 3.12+
- Node.js 18+
- Docker (optional)
- Plaid API credentials
- Google Gemini API key
-
Clone the repository
git clone https://github.com/your-username/streetcred.git cd streetcred -
Install Python dependencies
# Using UV (recommended) uv sync # Or using pip pip install -r requirements.txt
-
Configure environment variables
cp .env-example .env # Edit .env with your API keys and configuration -
Start the backend server
uv run python -m flare_ai_defai.main
-
Navigate to the frontend directory
cd streetcredui -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
# Build and run with Docker Compose
docker-compose up --buildStreetCred/
βββ src/flare_ai_defai/ # Python backend
β βββ ai/ # AI service integrations
β βββ api/ # FastAPI routes and middleware
β βββ attestation/ # TEE attestation and validation
β βββ blockchain/ # Blockchain integration
β βββ prompts/ # AI prompt templates
βββ streetcredui/ # Next.js frontend (main UI)
β βββ app/ # App router pages
β βββ components/ # React components
β βββ lib/ # Utility functions
βββ frontend/ # Legacy React frontend
βββ chat-ui/ # Chat interface
βββ tests/ # Python test suite
βββ assets/ # Documentation images
βββ docs/ # Additional documentation
Create a .env file based on .env-example:
# AI Configuration
GEMINI_API_KEY=your_gemini_api_key
GEMINI_MODEL=gemini-pro
# Blockchain Configuration
WEB3_PROVIDER_URL=your_web3_provider_url
WEB3_EXPLORER_URL=your_explorer_url
# Plaid Configuration
PLAID_CLIENT_ID=your_plaid_client_id
PLAID_SECRET=your_plaid_secret
PLAID_ENV=sandbox
PLAID_PRODUCTS=transactions,accounts
# TEE Configuration (for production)
TEE_IMAGE_REFERENCE=your_tee_image
INSTANCE_NAME=your_instance_name# Run all tests
pytest
# Run with coverage
pytest --cov=flare_ai_defai
# Run specific test file
pytest tests/test_ai_service.pycd streetcredui
npm testOnce the backend is running, visit:
- Interactive API Docs: http://localhost:8000/docs
- ReDoc Documentation: http://localhost:8000/redoc
- TEE Protection: All sensitive data processing happens in secure enclaves
- TLS Encryption: End-to-end encryption for all communications
- Privacy-Preserving: No raw financial data is stored or transmitted
- Attestation: Verifiable proof of secure execution environment
- Zero-Knowledge: Credit scores without exposing underlying data
- Multi-chain support (Ethereum, Polygon, Arbitrum)
- Advanced AI models for risk assessment
- Mobile application
- DeFi protocol integrations
- Real-time credit score updates
- Institutional API access
- Flare Network for blockchain infrastructure
- Plaid for banking data integration
- Google AI for AI capabilities
- Next.js for the frontend framework
StreetCred - Building the future of DeFi credit scoring, one secure transaction at a time. π
