๐๏ธโโ๏ธ FitStake โ AI-Verified Fitness Competitions on Web3
Stake. Sweat. Win.
Real-time pose detection meets blockchain staking for verifiable fitness competitions.
๏ฟฝ What We Built
FitStake is ## ๐ Contract Addresses
Sepolia Testnet
- RoomFactory:
0x9839385033B11C2678BE017fA774BC05970775bA
Flow Testnet
- RoomFactory:
0x9dd8fbDDEE26E7DdFE19D0cc8BDf01A1144c8340
๐ฏ Our Vision
"Making fitness competitions trustless, transparent, and rewarding through AI verification and blockchain technology."ess competition platform that combines AI-powered pose verification with on-chain staking. Users can create fitness rooms, stake crypto, and compete in real-time workouts verified by MediaPipe pose detection and dynamic scoring algorithms.
โจ Live Features
- ๐ท Real-time Pose Detection: MediaPipe runs in-browser for instant rep counting
- ๐ฏ Dynamic Form Scoring: Advanced algorithm analyzing Range of Motion, Tempo, and Consistency
- ๐ฐ Stake-to-Compete: Create or join rooms with crypto stakes
- ๐ฑ Mobile-First UI: Responsive design with auto-closing sidebar
- โก Performance Optimized: 10 FPS detection with frame limiting
- ๐ On-Chain Verification: Smart contracts handle stakes and payouts
๐๏ธ Architecture
[๐ฑ Browser Camera] โ [๐ค MediaPipe Pose Detection] โ [๐ Dynamic Scoring]
โ
[๐ป Next.js Frontend] โ [โ๏ธ Smart Contracts] โ [๐ฐ Reward Distribution]
Tech Stack
- Frontend: Next.js 15, TypeScript, shadcn/ui, Tailwind CSS
- Pose Detection: MediaPipe Tasks Vision v0.10.3
- Blockchain: Hardhat 3, Solidity, viem, wagmi v2
- Networks: Sepolia Testnet, Flow Testnet, Polygon (planned)
- Package Management: PNPM workspaces
๐ฎ How It Works
1. Create Competition Room
- Set exercise type (squats, pushups, bicep curls)
- Define stake amount and duration
- Deploy room contract on-chain
2. Real-Time Workout
- Camera captures pose landmarks
- MediaPipe counts reps with pose angle analysis
- Dynamic scoring based on:
- Range of Motion (40%) - How deep/complete each rep is
- Tempo Control (35%) - Proper speed and timing
- Form Consistency (25%) - Smoothness and control
3. On-Chain Settlement
- Submit workout results to smart contract
- Automated reward distribution to top performers
- Transparent, verifiable competition outcomes
๐ Quick Start
Prerequisites
- Node.js 18+
- PNPM package manager
- MetaMask or Web3 wallet
Installation
git clone <repo-url>
cd eth-global
pnpm install
Development
# Start web frontend
pnpm -F web dev
# Deploy contracts (separate terminal)
pnpm -F blockchain hardhat ignition deploy ignition/modules/RoomFactory.ts --network sepolia
# Generate contract types
pnpm -F web wagmi generate
Access the App
- Connect your wallet (Sepolia testnet)
- Create a new fitness room
- Start camera and begin workout
- Watch real-time rep counting and scoring!
๐ก Key Innovations
๐ค Advanced Pose Analysis
- Multi-angle Detection: Tracks 33 pose landmarks in real-time
- Exercise-Specific Logic: Custom angle calculations for different workouts
- Intelligent Rep Counting: Peak detection with configurable thresholds
- Form Quality Scoring: Fit-wise inspired algorithm for comprehensive analysis
โก Performance Optimizations
- Frame Rate Limiting: Optimized to 10 FPS to prevent browser crashes
- Monotonic Timestamps: Solved MediaPipe timestamp conflicts
- Rep-Based Analysis: Scoring only on completed reps, not every frame
- Smart Logging: Detailed debugging without console spam
๐ฑ Mobile-First Design
- Responsive Sidebar: Auto-hiding on mobile with logo button
- Statistics Cards: Separate cards for rep count and form score
- Touch-Friendly Controls: Large buttons and intuitive navigation
- Accessibility: Screen reader support with proper ARIA labels
๐ Current Implementation Status
โ Completed
- [x] Real-time MediaPipe pose detection
- [x] Dynamic scoring algorithm (ROM + Tempo + Consistency)
- [x] Smart contract room system
- [x] Mobile-responsive UI with statistics cards
- [x] Performance optimizations and error handling
- [x] Wallet integration with wagmi v2
๐ In Progress
- [ ] AI agent verification layer
- [ ] IPFS session storage
- [ ] Multi-user competition logic
- [ ] Advanced anti-cheat mechanisms
๐บ๏ธ Roadmap
- [ ] Live multiplayer competitions
- [ ] Wearable device integration
- [ ] ZK-proof verification
- [ ] Cross-chain deployment
- [ ] SDK for third-party integration
๐ ๏ธ Technical Details
Smart Contracts
// Core contracts in /blockchain
RoomFactory.sol // Factory for creating competition rooms
Room.sol // Individual competition logic
Frontend Structure
/web/src/
โโโ components/
โ โโโ MediaPipeWorkout.tsx // Main workout interface
โ โโโ AppSidebar.tsx // Navigation with mobile support
โ โโโ ui/ // shadcn/ui components
โโโ lib/
โ โโโ mediapipe-utils.ts // Pose detection & scoring logic
โ โโโ wagmi.ts // Web3 configuration
โ โโโ contracts.ts // Contract interactions
โโโ app/
โโโ (app)/room/ // Competition pages
Pose Detection Pipeline
- Camera Stream: Browser MediaStream API
- Pose Landmarks: MediaPipe extracts 33 3D points
- Angle Calculation: Custom geometric calculations for exercise-specific joints
- Rep Detection: Peak finding algorithm with configurable thresholds
- Form Scoring: Multi-factor analysis with weighted components
๐ Demo Highlights
- ๐ฏ Accurate Rep Counting: Tested across different exercise types
- ๐ Real-time Scoring: Instant feedback on form quality
- ๐ณ Wallet Integration: Seamless Web3 onboarding
- ๐ฑ Mobile Experience: Works great on phones and tablets
- โก Performance: Smooth 10 FPS detection without lag
๐ฅ Contributing
This is a hackathon project showcasing the potential of AI-verified fitness competitions on blockchain. The codebase demonstrates key concepts and can be extended for production use.
โ ๏ธ Disclaimers
- Testnet Only: Currently deployed on Sepolia and Flow testnets
- Demo Purpose: Simplified verification for hackathon scope
- No Financial Advice: Educational project only
๐ Contract Addresses
Sepolia Testnet
- RoomFactory:
0x9839385033B11C2678BE017fA774BC05970775bA
Flow Testnet
- RoomFactory:
0x9dd8fbDDEE26E7DdFE19D0cc8BDf01A1144c8340
๏ฟฝ Our Vision
"Making fitness competitions trustless, transparent, and rewarding through AI verification and blockchain technology."


