HomeProjectsHackathonsEventsWorkBlogTimeline

FitStake

FitStake is rethinking how online fitness competitions work. We bring together AI verification and blockchain settlement to make contests fair, transparent, and rewarding.

ETHGlobal New Delhi

๐ŸŽ“ ETHGlobal

๐Ÿ“Œ New Delhi, Delhi

๐Ÿš€ 36hr Hackathon Project

landing
room
rooms

๐Ÿ‹๏ธโ€โ™‚๏ธ 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

  1. Connect your wallet (Sepolia testnet)
  2. Create a new fitness room
  3. Start camera and begin workout
  4. 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

  1. Camera Stream: Browser MediaStream API
  2. Pose Landmarks: MediaPipe extracts 33 3D points
  3. Angle Calculation: Custom geometric calculations for exercise-specific joints
  4. Rep Detection: Peak finding algorithm with configurable thresholds
  5. 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."