A revolutionary platform implementing Universal Basic AI (UBAI) - ensuring every human has access to AI compute power as a fundamental right. Built on Oasis Protocol for complete privacy and anonymity
In a future where AI becomes essential for education, work, and daily life, we risk creating a world where only the wealthy have access to advanced AI capabilities. Universal Basic AI prevents this dystopia by guaranteeing every person a fair allocation of AI compute power based on their country of origin.
- AI as a Human Right: Every person deserves access to AI assistance, regardless of their economic status
- Fair Distribution: Compute allocation based on country of residence, ensuring global equity
- Complete Privacy: AI runs in Oasis ROFL TEE (Trusted Execution Environment) - your conversations remain completely anonymous
- Community Funded: Those who can afford more can donate to fund AI access for others
- Transparent & Accountable: All funding is tracked on-chain while user privacy is preserved
- One-Time Verification: Users verify their identity and country once (privacy-preserving KYC)
- Compute Allocation: Based on your country's GDP per capita, you receive monthly AI credits
- Anonymous Usage: Chat with AI in complete privacy - even we can't see your conversations
- Community Support: When your credits run low, the community donation pool keeps you connected
- Pay It Forward: Those with means can donate to expand access for others
βββββββββββββββββββ βββββββββββββββββββββββββββ βββββββββββββββββββ
β Web Frontend ββββββΆβ AI Oracle ββββββΆβ Blockchain β
β (Next.js/Web3) β β (Oasis ROFL TEE) β β (Sapphire) β
βββββββββββββββββββ β - AI Model β βββββββββββββββββββ
β β - SIWE Auth β β
β β - Private Compute β β
β βββββββββββββββββββββββββββ β
β β
ββββββββββββββββββββ βββββββββββββββββ
βΌ βΌ
βββββββββββββββββββββββββββββββ
β Identity Verification β
β (iExec DataProtector) β
β - Country verification β
β - One-time process β
βββββββββββββββββββββββββββββββ
- ROFL TEE: AI runs inside Oasis Runtime Off-chain Logic, ensuring conversations are encrypted end-to-end
- No Data Leakage: Even node operators cannot access chat contents
- Verified Anonymity: Prove you're human and your country without revealing who you are
- On-chain Privacy: Sapphire's confidential smart contracts hide user balances and usage
- Universal Access: Everyone gets base AI credits monthly
- Complete Anonymity: Your chats are encrypted in TEE - nobody can read them
- Mental Health Focus: Specialized in emotional support and wellbeing
- 24/7 Availability: AI companion always there when you need it
- No Surveillance: Unlike big tech, we can't mine your data
- Reduces Inequality: Prevents AI from becoming a luxury good
- Global Impact: Country-based allocation ensures worldwide access
- Community Driven: Donations directly fund more conversations
- Transparent Funding: See exactly how donations create access
- ROFL TEE Integration: First mental health AI running in secure enclave
- SIWE + TEE: Combines wallet auth with confidential compute
- Privacy-First KYC: Verify once, stay anonymous forever
- Hybrid On/Off Chain: Best of both worlds for privacy and transparency
Our Universal Basic AI platform is live on Oasis Protocol's privacy-preserving blockchain:
- Contract Address:
0xA0345079D64a5EeBb317E04b7008624B58F4B5a4 - Network: Sapphire Testnet
- Status: β Verified and Deployed
- Features:
- User usage management
- Privacy-preserving state
- ROFL App ID:
rofl1qpw485nk7xv8qvrvqf93l08sv5uuy0wyku528yfl - Type: Runtime Off-chain Logic (ROFL)
- Environment: Trusted Execution Environment (TEE)
- Features:
- SIWE authentication and verification
- Private compute execution
- OpenRouter AI model integration
- TEE Protection: All AI processing happens inside secure enclave
- No Data Leakage: Even node operators cannot access conversations
- Confidential State: Smart contract state encrypted on Sapphire
- Anonymous Usage: Zero-knowledge proof of humanity without identity exposure
# Clone the repository
git clone https://github.com/your-username/eth-belgrade-2025.git
cd eth-belgrade-2025
# Install dependencies
pnpm installCreate .env files in each app directory:
# Required
CONTRACT_ADDRESS=0x... # Your deployed oracle contract
PRIVATE_KEY=0x... # Private key for oracle operations
OPENROUTER_API_KEY=your_api_key # Get from https://openrouter.ai
ROFL_ENDPOINT=https://... # Oasis ROFL TEE endpoint
# Optional
NETWORK_NAME=sapphire-testnet
PORT=3001NEXT_PUBLIC_APPKIT_PROJECT_ID=your_project_id # Get from WalletConnect
NEXT_PUBLIC_ORACLE_URL=http://localhost:3001
NEXT_PUBLIC_KYC_URL=http://localhost:3002# iExec Configuration (for TEE deployment)
# No .env needed - configured via iapp.config.json
# Deployment done with: EXPERIMENTAL_TDX_APP=true iapp deployNEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=your_project_id # Get from WalletConnect Cloud# Navigate to contracts
cd packages/contracts
# Deploy to Sapphire testnet
forge script script/Deploy.s.sol --rpc-url sapphire-testnet --broadcast
# Save the deployed contract address for the oracle .envIn separate terminals:
# Terminal 1: Start the Oracle API
cd apps/oracle
bun run oracleWEB.ts
# Terminal 2: Start the KYC service (iExec TEE backend)
cd apps/kyc
# Deploy to iExec with TDX experimental flag
EXPERIMENTAL_TDX_APP=true iapp deploy
# Terminal 3: Start the KYC frontend
cd apps/kyc-frontend
npm run dev
# Terminal 4: Start the main web app
cd apps/web
npm run dev- Main App: http://localhost:3000
- Oracle API: http://localhost:3001
- KYC Frontend: http://localhost:3000 (React app)
- KYC Service: Deployed on iExec TEE (see deployment logs for app address)
The project includes a privacy-preserving KYC system for verifying user identity and country of residence. This enables fair allocation of AI compute credits based on geographic location.
- Frontend: React app with Web3 wallet integration (
apps/kyc-frontend) - Backend: iExec TEE application for secure passport processing (
apps/kyc) - Privacy: Uses iExec DataProtector + TDX for confidential computing
cd apps/kyc-frontend
npm install
cp .env.example .env.local
# Add your WalletConnect Project ID to .env.local
npm run devcd apps/kyc
npm install -g @iexec/iapp
# Deploy with TDX experimental flag for hackathon
EXPERIMENTAL_TDX_APP=true iapp deployAfter deployment, update the app address in apps/kyc-frontend/src/services/teeService.ts:
const DEPLOYED_IAPP_ADDRESS = '0x...'; // Your deployed app address- Upload Passport: User uploads passport image via React frontend
- Data Protection: Image encrypted using iExec DataProtector with simple schema:
{ passport: base64ImageData }
- TEE Processing: Secure processing in iExec TDX environment:
- Enhanced OCR with EasyOCR + custom pattern matching
- MRZ (Machine Readable Zone) parsing
- Country extraction and verification
- Confidence scoring with multiple fallback strategies
- Result Return: Verified country and passport data returned
cd apps/kyc-frontend
npm run dev # Start development server
npm run build # Build for production
npm run type-check # TypeScript validationcd apps/kyc
iapp test # Test locally
iapp run <app-address> --protectedData <data-address> # Manual testing- Multiple Extraction Methods: MRZ parsing, pattern matching, text analysis
- Confidence Scoring: Intelligent scoring with fallback strategies
- Country Detection: Automatic country identification from passport data
- Demo Mode: Reliable fallback results for hackathon showcasing
- TEE Processing: All OCR happens in Trusted Execution Environment
- Data Protection: Images encrypted end-to-end via iExec DataProtector
- No Storage: No persistent storage of sensitive documents
- Fallback Safety: Multiple fallback layers ensure demo reliability
- Frontend: React 18, TypeScript, Web3 integration (ethers.js)
- Backend: Python 3.9, EasyOCR, PIL, iExec TEE framework
- Blockchain: iExec Bellecour (chainId: 134) with TDX workerpool
- Deployment: iExec iApp with
EXPERIMENTAL_TDX_APP=true
- SMS Endpoint:
https://sms.labs.iex.ec - Workerpool:
tdx-labs.pools.iexec.eth - Dataset Type: Simple
{ passport: string }structure - Deserializer: Custom Python implementation with zip + Borsh
- Frontend: React, ethers.js, @iexec/dataprotector
- Backend: easyocr, Pillow, opencv-python-headless, borsh-construct
# Run all services in development mode
pnpm dev
# Build all packages
pnpm build
# Run tests
pnpm test
# Lint code
pnpm linteth-belgrade-2025/
βββ apps/
β βββ web/ # Main frontend (Universal Basic AI)
β βββ oracle/ # AI chat backend (ROFL TEE)
β βββ kyc/ # Identity verification (iExec TEE backend)
β βββ kyc-frontend/ # KYC UI (React frontend)
βββ packages/
β βββ contracts/ # Smart contracts (Sapphire)
β βββ ui/ # Shared UI components
β βββ eslint-config/ # ESLint configuration
β βββ typescript-config/# TypeScript configuration
βββ HACKATHON_POC_GUIDE.md # Quick setup guide for ETH Belgrade
βββ turbo.json # Turborepo configuration
- Private Conversations: End-to-end encrypted chats with AI
- 24/7 Availability: Always-on emotional support
- No Judgment: Safe space for mental health discussions
- Free Access: Community-funded conversations
- Direct Impact: $5 funds 1 hour of support
- Transparent Ledger: Track all donations on-chain
- Anonymous Options: Donate with or without attribution
- Tax Benefits: Blockchain receipts for contributions
- SIWE Authentication: Secure wallet-based login
- Streaming Responses: Real-time AI responses
- Privacy Preservation: iExec DataProtector for KYC
- Sapphire Confidentiality: Private smart contract state
- KYC Data: Encrypted and stored via iExec DataProtector
- ** AI DATA**: E....TODO
- Smart Contracts: Audited for common vulnerabilities
- API Security: Rate limiting and SIWE authentication
Monthly AI Credits = Base Allocation Γ Country Multiplier
Where:
- Base Allocation = 100 credits (β 20 conversations)
- Country Multiplier = (Global Median GDP / Country GDP)^0.5
- π¨π Switzerland (High GDP): 100 credits/month
- π§π· Brazil (Medium GDP): 200 credits/month
- π°πͺ Kenya (Lower GDP): 400 credits/month
This ensures those in lower-income countries get MORE access, counteracting global inequality.
- $5 = 100 credits = ~20 conversations
- $25 = 500 credits = ~100 conversations
- $100 = 2000 credits = ~400 conversations
- TEE Protection: All AI processing happens in Oasis ROFL secure enclave
- E2E Encryption: Messages encrypted before leaving your browser
- No Logs: Conversations are never stored or logged
- KYC Data: Encrypted and stored via iExec DataProtector
- Smart Contracts: Audited for common vulnerabilities
- SIWE Authentication: Secure wallet-based access without passwords
- Web Frontend Documentation
- Oracle API Documentation
- Smart Contract Documentation
- KYC TEE Backend Documentation
- KYC Frontend Documentation
- Hackathon POC Guide - Quick setup for ETH Belgrade demo
- Built for ETH Belgrade 2025 Hackathon
- Powered by Oasis Sapphire ParaTime & ROFL TEE
- AI conversations via OpenRouter (in secure enclave)
- Identity verification via iExec DataProtector
- Inspired by the Universal Basic Income movement
Watch our demo video: [Coming Soon]
