Decentralized Fitness Challenge Platform Powered by Web3
A blockchain-based application that incentivizes fitness through cryptocurrency staking and automated verification
FitStake is a comprehensive Web3 fitness challenge platform that enables users to create and join fitness challenges with cryptocurrency stakes. The platform combines blockchain technology, oracle services, and fitness tracking APIs to create a transparent and automated challenge system.
Users stake cryptocurrency (ETH) to participate in fitness challenges. Upon completion, activities are verified through the Strava API by an oracle service powered by Lit Protocol and Vincent Protocol. Successful participants receive rewards via PKP (Programmable Key Pair) gasless transactions.
graph TB
subgraph "Mobile App - React Native"
MobileApp[Mobile App]
subgraph "Services"
ContractService[Contract Service]
StravaService[Strava Service]
VincentService[Vincent Service]
end
subgraph "Context"
Web3Context[Web3 Context]
VincentContext[Vincent Context]
end
end
subgraph "Smart Contract"
SmartContract[ChallengeContract.sol<br/>0xe38d8f585936c60ecb7bfae7297457f6a35058bb]
end
subgraph "Backend"
VincentBackend[Vincent Backend<br/>:3001]
OAuthServer[OAuth Server<br/>:3000]
end
subgraph "External"
StravaAPI[Strava API]
LitNetwork[Lit Network<br/>PKP Signing]
end
MobileApp -->|Contract Calls| SmartContract
MobileApp -->|JWT Auth| VincentBackend
VincentBackend -->|PKP Signing| LitNetwork
VincentBackend -->|Strava API| StravaAPI
MobileApp -->|OAuth| OAuthServer
stateDiagram-v2
[*] --> Created: User creates challenge
Created --> Active: block.timestamp >= startTime
Active --> Joining: Users join with stake
Joining --> Ongoing: Challenge active
Ongoing --> Completed: Oracle verifies task
Ongoing --> Expired: Time exceeded
Completed --> Finalized: Admin finalizes
Expired --> Finalized: Admin finalizes
Finalized --> Withdrawn: Winners withdraw
Withdrawn --> [*]
sequenceDiagram
participant User
participant App
participant Vincent
participant PKP as PKP Wallet
participant Contract as Smart Contract
Note over User,Contract: Join Challenge Flow (Gasless)
User->>App: Join Challenge
App->>App: Check Vincent JWT
App->>Vincent: POST /api/auto-stake + JWT
Vincent->>Vincent: Execute Lit Action
Vincent->>PKP: Sign Transaction
PKP->>Contract: Execute joinChallenge()
Contract->>App: Emit UserJoined Event
App->>User: Success! (No Gas Fees)
Note over User,Contract: Verification Flow
User->>Strava: Record Activity
App->>Vincent: Verify Activity
Vincent->>Strava: Fetch Activity Data
Vincent->>PKP: Sign markTaskComplete()
PKP->>Contract: Execute markTaskComplete()
Contract->>App: Emit TaskCompleted Event
| Category | Technology | Version | Purpose |
|---|---|---|---|
| Mobile | React Native | 0.81.5 | Cross-platform framework |
| Mobile | Expo | 54.0.17 | Build system |
| Mobile | NativeWind | 2.0.11 | Tailwind CSS styling |
| Blockchain | Solidity | 0.8.28 | Smart contracts |
| Blockchain | Hardhat | 3.0.7 | Development framework |
| Blockchain | ethers.js | 6.15.0 | Ethereum library |
| Oracle | Lit Protocol | 7.3.1 | Decentralized oracle |
| Oracle | Vincent SDK | 2.2.3 | Serverless abilities |
| Oracle | @sogalabhi/ability-auto-stake | 1.2.0 | Auto-stake ability |
| Backend | Express.js | 4.21.2 | HTTP API |
| Indexer | Envio | - | Blockchain indexing |
- Create custom fitness challenges
- Set target distance, stake amount, duration
- Real-time challenge status tracking
- Secure ETH staking via smart contracts
- Automatic reward distribution
- Transparent winner calculation
- PKP (Programmable Key Pair): Autonomous wallet signing
- SIWE Authentication: Sign-In With Ethereum
- Lit Actions: Serverless execution
- Gasless transaction execution via Vincent SDK
- Automated Strava activity verification
- Distance, type, and timestamp validation
- Lit Protocol PKP autonomous signing
- Node.js v20.x
- pnpm (package manager)
- MetaMask mobile wallet
- Strava account# Clone repository
git clone https://github.com/Kushagra1122/fitStake.git
cd fitStake
# Install mobile app
cd client && npm install
# Install Web3 dependencies
cd ../web3 && pnpm install
# Install backend
cd ../vincent-backend && npm installClient (.env):
EXPO_PUBLIC_CONTRACT_ADDRESS=0xe38d8f585936c60ecb7bfae7297457f6a35058bb
EXPO_PUBLIC_VINCENT_BACKEND_URL=http://localhost:3001
EXPO_PUBLIC_CHAIN_ID=11155111Vincent Backend (.env):
VINCENT_APP_ID=9593630138
VINCENT_PKP_ADDRESS=your_pkp_address
VINCENT_DELEGATEE_PRIVATE_KEY=your_private_key
CONTRACT_ADDRESS=0xe38d8f585936c60ecb7bfae7297457f6a35058bb# Start mobile app
cd client && npm start
# Start Vincent backend
cd vincent-backend && npm start
# Start OAuth server (optional)
cd oauth-server && npm startAddress: 0xe38d8f585936c60ecb7bfae7297457f6a35058bb
Network: Ethereum Sepolia Testnet
Chain ID: 11155111
createChallenge()- Create new challengejoinChallenge()- Join with ETH stakemarkTaskComplete()- Oracle verification (PKP only)finalizeChallenge()- Calculate winnerswithdrawWinnings()- Withdraw rewards
FitStake uses Vincent Protocol for gasless transactions via PKP:
- User logs in with Vincent (SIWE flow)
- Receives JWT token via deep link
- Joins challenge โ Vincent auto-stake with JWT
- PKP autonomously signs and executes transaction
- No gas fees, no wallet signature required
Key npm Packages:
@lit-protocol/vincent-app-sdk(v2.2.3)@sogalabhi/ability-auto-stake(v1.2.0)@lit-protocol/lit-node-client-nodejs(v7.3.1)@lit-protocol/core(v7.3.1)
flowchart TD
Start([User Requests Verification]) --> Request[POST /api/auto-stake]
Request --> Extract[Extract: challengeId, JWT]
Extract --> GetContract[Query Smart Contract]
GetContract --> Validate[Validate Challenge]
Validate --> FetchStrava[Fetch Strava Activity]
FetchStrava --> CheckType{Activity Type = Run?}
CheckType -->|No| Error1[Invalid Type]
CheckType -->|Yes| CheckDistance{Distance >= Target?}
CheckDistance -->|No| Error2[Insufficient Distance]
CheckDistance -->|Yes| LitAction[Execute Lit Action]
LitAction --> PKPSign[PKP Signs Transaction]
PKPSign --> Submit[Submit to Blockchain]
Submit --> Success[โ
Task Completed]
- Activity Type: Must be "Run"
- Distance: Meet or exceed target
- Timestamp: Within challenge time window
1. Connect wallet (MetaMask via WalletConnect)
2. Login with Vincent (SIWE flow)
3. Create challenge (manual signing)
4. Join challenge (Vincent auto-stake - GASLESS!)
5. Record Strava activity
6. Verify activity (Lit Action execution)
7. Finalize challenge
8. Withdraw winningscd web3
npm run compile
npm run deploy-sepoliacd client
eas build --platform android
eas build --platform ios- Deploy to Railway/Render/Fly.io
- Set environment variables
- Configure PKP address and keys
- โ Gasless Transactions via Vincent PKP
- โ Automated Verification via Lit Actions
- โ Strava Integration for activity tracking
- โ PKP Signing for autonomous transactions
- โ SIWE Authentication for secure login
- โ Smart Contract Escrow for transparent staking
- โ Real-time Indexing via Envio
- Smart Contract:
web3/contracts/ChallengeContract.sol - Lit Actions:
web3/lit-actions/verifyStravaActivity.js - Vincent Backend:
vincent-backend/src/index.js - Mobile Services:
client/services/
Built with โค๏ธ for the Web3 and fitness communities
GitHub โข Demo Video โข Live App