cipherLend is a privacy-first peer-to-peer lending platform built on Web3 infrastructure, combining traditional financial document analysis with cutting-edge privacy technology.
cipherLend enables borrowers to request loans by uploading financial documents (bank statements, bills, income proof) that are analyzed by AI and encrypted using Nillion's SecretVault technology. Lenders can assess loan applications by viewing AI-generated summaries without accessing raw financial documents, ensuring borrower privacy while enabling informed lending decisions.
- π Privacy-First: Documents encrypted in Nillion SecretVault - only borrowers can decrypt raw files
- π€ AI Document Analysis: AI analyzes financial documents and extracts key insights
- π° P2P Lending: Direct borrower-lender matching without traditional banking intermediaries
- π Global Access: Web3-based, accessible worldwide with crypto wallet integration
- π Humanity Score: Gitcoin Passport integration for identity verification
- π Blockchain Integration: Wallet connections via RainbowKit/WagMi
- Next.js 15 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling with custom neo-brutalist design
- Clerk - Authentication and user management
- Convex - Real-time database and backend logic
- RainbowKit/WagMI - Web3 wallet integration
- Nillion AI - Provide private AI assessments
- Nillion SecretVault - Encrypted document storage with user-controlled access
- Gitcoin Passport - Humanity verification and scoring
users/ - User profiles and preferences
loanRequests/ - Loan applications with terms
documents/ - Financial document metadata (encrypted files in SecretVault)
assessments/ - Lender evaluations of loan requests
wallets/ - User wallet connections
βββ app/ # Next.js App Router pages
β βββ api/ # API routes
β β βββ analyze-document/ # AI document analysis
β β βββ generate-keypair/ # SecretVault keypair generation
β β βββ vault-operations/ # Document encryption/decryption
β β βββ verify-score/ # Gitcoin Passport verification
β βββ borrow/ # Borrower interface
β β βββ new/ # Create loan request
β β βββ [shortId]/ # View specific loan request
β βββ lend/ # Lender interface
β β βββ [shortId]/ # Assess loan requests
β βββ profile/ # User profile management
βββ components/
β βββ borrower/ # Borrower-specific components
β β βββ LoanRequestBuilder.tsx # Loan creation form
β β βββ UploadPanel.tsx # General document upload
β β βββ LoanRequestUploadPanel.tsx # Loan-specific uploads
β β βββ SecretVaultManager.tsx # SecretVault integration
β β βββ HumanityScore.tsx # Gitcoin Passport display
β βββ lender/ # Lender-specific components
β β βββ BorrowerCard.tsx # Loan request display
β β βββ AssessmentModal.tsx # Loan evaluation interface
β βββ ui/ # Reusable UI components (Neo-brutalist design)
βββ convex/ # Backend logic and database
β βββ users.ts # User management
β βββ loanRequests.ts # Loan CRUD operations
β βββ documents.ts # Document metadata management
β βββ assessments.ts # Lender evaluations
βββ lib/
βββ secretvaults.ts # Nillion integration
βββ loan-utils.ts # Loan calculation utilities
- Sign Up β Clerk authentication
- Generate SecretVault Keypair β Privacy setup for document encryption
- Create Loan Request β Specify amount, terms, purpose
- Upload Documents β Bank statements, bills, income proof (AI analyzed + encrypted)
- Wait for Lenders β Receive assessments and funding offers
- Accept Funding β Connect wallet and receive funds
- Sign Up β Clerk authentication
- Browse Loan Requests β View AI-generated summaries
- Assess Applications β Evaluate risk based on financial insights
- Fund Loans β Connect wallet and transfer funds to borrowers
- Document Upload β Files analyzed by OpenAI API
- Encryption β Raw documents + analysis stored in SecretVault (user-controlled)
- Summary Sharing β Only AI summaries visible to lenders
- Access Control β Borrowers can grant/revoke document access
- Node.js 18+
- npm/yarn/pnpm
- Convex account
- Clerk account
- OpenAI API key
- Nillion API key
# Convex
CONVEX_DEPLOYMENT=dev:your-deployment
NEXT_PUBLIC_CONVEX_URL=https://your-deployment.convex.cloud
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...
CLERK_SECRET_KEY=sk_test_...
# OpenAI
OPENAI_API_KEY=sk-...
# Nillion SecretVault
NILLION_BUILDER_PRIVATE_KEY=your-builder-key
NILLION_USER_KEY=your-user-key
# Gitcoin Passport
PASSPORT_API_KEY=your-passport-key
NEXT_PUBLIC_PASSPORT_SCORER_ID=your-scorer-id
# Wallet Connect
NEXT_PUBLIC_REOWN_PROJECT_ID=your-project-id# Install dependencies
npm install
# Start Convex development
npx convex dev
# Start Next.js development server
npm run devPOST /api/analyze-document- Analyze financial documents with OpenAIPOST /api/generate-keypair- Create SecretVault encryption keypairPOST /api/vault-operations- Store/retrieve encrypted documentsPOST /api/verify-score- Verify Gitcoin Passport humanity score
- Upload β Files sent to OpenAI for analysis (temporary)
- Analysis β AI extracts financial insights and categories
- Encryption β Raw files + analysis encrypted in SecretVault
- Access Control β Users control who can decrypt their documents
- Sharing β Lenders only see AI summaries, never raw documents
- Each user generates a unique encryption keypair
- Documents stored encrypted with user-controlled access
- Delegation tokens enable secure sharing with specific parties
- Zero-knowledge architecture - platform cannot decrypt user documents
- Follow TypeScript strict mode
- Use Tailwind for styling (neo-brutalist design system)
- All forms use Convex mutations for data persistence
- Privacy-first: always encrypt sensitive documents
- Real-time updates via Convex subscriptions
StoreToVaultButton- Test SecretVault integrationNilaiTestComponent- Test document analysis- Upload panels have built-in privacy checks
- Components: Reusable UI in
/components/ui/ - Feature Components: Domain-specific in
/components/borrower/or/components/lender/ - Backend Logic: Convex functions in
/convex/ - API Routes: External integrations in
/app/api/
- Convex - Real-time backend and database
- Clerk - Authentication and user management
- Nillion - Privacy-preserving data storage
- Gitcoin Passport - Identity verification
- RainbowKit - Web3 wallet connections
cipherLend aims to democratize access to credit while preserving financial privacy. By combining AI-powered document analysis with zero-knowledge encryption, we enable global P2P lending without compromising sensitive financial data.
The platform bridges traditional finance (bank statements, credit scores) with Web3 infrastructure (wallet connections, decentralized storage), creating a new paradigm for privacy-preserving financial services.