Peer-to-peer insurance protocol powered by AI, blockchain, and advanced fintech technologies
MutualChain revolutionizes insurance by making it accessible, transparent, and affordable for small businesses and gig workers. We leverage cutting-edge AI models, blockchain technology, and zero-knowledge proofs to create a peer-to-peer insurance protocol that eliminates intermediaries and reduces costs by up to 40%.
- AI-Powered Risk Assessment: XGBoost, Transformers, and Federated Learning for 98.5% accuracy
- Smart Contract Automation: Fully automated claims processing with Chainlink oracles
- Zero-Knowledge Privacy: zkSNARKs/zkSTARKs for private claim verification
- Layer 2 Scaling: Fast, low-cost transactions on Arbitrum, Optimism, and Base
- Decentralized Storage: IPFS and Arweave for policy documents
- Real-time Analytics: The Graph subgraphs and time-series databases
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Wagmi/Viem - Ethereum interactions
- RainbowKit - Wallet connection
- Framer Motion - Smooth animations
- Recharts - Data visualization
- Solidity 0.8.20 - Smart contracts
- Hardhat - Development environment
- Chainlink Oracles - Real-world data feeds
- zkSNARKs/zkSTARKs - Zero-knowledge proofs
- ERC-4337 - Account abstraction
- Layer 2: Arbitrum, Optimism, Base
- XGBoost - Risk prediction models
- TensorFlow/PyTorch - Deep learning
- Transformers - NLP for claims analysis
- Federated Learning - Privacy-preserving ML
- GANs - Fraud detection
- AutoML - Model optimization
- Python/Flask - AI backend API
- Docker - Containerization
- The Graph - Blockchain indexing
- IPFS - Decentralized storage
- Node.js 18+ and npm
- Python 3.9+
- MetaMask or compatible Web3 wallet
- Docker Desktop (optional, recommended)
The fastest way to get started:
# Clone the repository
git clone https://github.com/yourusername/mutualchain.git
cd mutualchain
# Copy environment file
cp .env.example .env
# Edit .env with your API keys
# Build and start all services
docker-compose up --build
# Access the app at http://localhost:3000See DOCKER.md for detailed Docker deployment instructions.
# Clone the repository
git clone https://github.com/yourusername/mutualchain.git
cd mutualchain
# Install frontend dependencies
npm install --legacy-peer-deps
# Install blockchain dependencies
cd blockchain
npm install
cd ..
# Install AI backend dependencies
cd ai-backend
pip install -r requirements.txt
cd ..Create a .env.local file in the root directory:
NEXT_PUBLIC_WALLET_CONNECT_ID=your_wallet_connect_project_id
NEXT_PUBLIC_ALCHEMY_KEY=your_alchemy_api_key
NEXT_PUBLIC_CHAIN_ID=42161
NEXT_PUBLIC_AI_API_URL=http://localhost:5000# Terminal 1: Start the Next.js frontend
npm run dev
# Terminal 2: Start the AI backend
cd ai-backend
python app.py
# Terminal 3: Start local Hardhat node (optional)
cd blockchain
npx hardhat nodeVisit http://localhost:3000 to see the application.
cd blockchain
# Compile contracts
npx hardhat compile
# Deploy to Arbitrum
npx hardhat run scripts/deploy.js --network arbitrum
# Verify on Arbiscan
npx hardhat verify --network arbitrum DEPLOYED_CONTRACT_ADDRESSmutualchain/
βββ app/ # Next.js 14 app directory
β βββ dashboard/ # Dashboard page
β βββ claims/ # Claims filing page
β βββ risk-calculator/ # Risk assessment tool
β βββ analytics/ # Protocol analytics
β βββ about/ # About page
βββ components/ # React components
β βββ Navbar.tsx
β βββ Footer.tsx
β βββ Hero.tsx
β βββ ...
βββ blockchain/ # Smart contracts
β βββ contracts/
β β βββ MutualChainInsurance.sol
β βββ scripts/
β β βββ deploy.js
β βββ hardhat.config.js
βββ ai-backend/ # Python AI/ML backend
β βββ app.py # Flask API server
β βββ requirements.txt
βββ hooks/ # Custom React hooks
βββ lib/ # Utility functions
βββ public/ # Static assets
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLintcd blockchain
npm run compile # Compile smart contracts
npm run test # Run contract tests
npm run deploy:local # Deploy to local networkcd ai-backend
python app.py # Start Flask server- XGBoost models predict risk profiles with 98.5% accuracy
- Federated Learning ensures privacy-preserving training
- Reinforcement Learning for dynamic premium optimization
- Automated policy creation and management
- Parametric insurance with Chainlink oracle triggers
- Instant claim settlements via Layer 2 networks
- zkSNARKs for private claim verification
- Zero-knowledge proofs protect sensitive data
- Military-grade encryption for all transactions
- GANs detect anomalies in claims
- Real-time analysis of claim patterns
- Multi-factor fraud scoring system
- Arbitrum One (Mainnet) - Primary deployment
- Optimism - Alternative Layer 2
- Base - Coinbase's Layer 2
- Local Hardhat - Development testing
POST /api/risk-assessment # Calculate risk scores
POST /api/fraud-detection # Detect fraudulent claims
POST /api/claim-verification # Verify claims with AI
POST /api/parametric-trigger # Check parametric triggers
# Frontend tests
npm test
# Smart contract tests
cd blockchain
npx hardhat test
# AI backend tests
cd ai-backend
pytest- Core protocol deployment
- AI risk assessment integration
- Federated learning implementation
- Multi-chain expansion
- Mobile app (React Native)
- Governance token launch
- Reinsurance layer
- Traditional insurance integration
We welcome contributions! Please see CONTRIBUTING.md for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- Website: https://mutualchain.io
- Documentation: https://docs.mutualchain.io
- Discord: https://discord.gg/mutualchain
- Twitter: https://twitter.com/mutualchain
This is a proof-of-concept project for educational purposes. Always conduct thorough security audits before deploying to production. Insurance products may be subject to regulatory requirements in your jurisdiction.
- OpenZeppelin for secure smart contract libraries
- Chainlink for decentralized oracle infrastructure
- The Graph for blockchain indexing
- All the amazing open-source contributors
Built with β€οΈ for DeFi and accessible insurance