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

šŸš€ 36 hours 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

  • Real-time MediaPipe pose detection
  • Dynamic scoring algorithm (ROM + Tempo + Consistency)
  • Smart contract room system
  • Mobile-responsive UI with statistics cards
  • Performance optimizations and error handling
  • 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."