RaceFi is a running platform that focuses on the social and competitive nature of runners - we allow users to create "challenges" by staking crypto currency, allowing others to compete in the challenge by staking the same amount of crypto. We're bringing running on-chain!
Any user can create a challenge for others to compete in, by creating a route on our route maker. Then, we use your location data, average speed, and acceleration to determine the validity of your run and compare it to others who competed in the challenge. The fastest runner takes the entire pool. We allow users to create a challenge in multiple ways: drawing the route themselves, running the route themselves, or importing a run through existing running software. Afterwards, the winner of the challenge will then receive an newly minted 3D NFT of the track that they ran.
We combined CoinBase's CDP, Walrus's decentralized storage, Hardhat, and deployed it on various services. We used smart contracts to create an escrow that lets all competitors "stake", and then pay out to the fastest runner.
There are 3 distinct parts to our project.
Frontend Stack:
- React Native 0.79.5 + Expo SDK 53: Cross-platform development with native GPS capabilities
- Expo Router: File-based routing for intuitive navigation
- React Native Maps: High-performance map rendering for route visualization
- Context API: Lightweight state management without external dependencies
Backend Infrastructure
- FastAPI: Async Python framework for high-performance API endpoints
- Supabase: PostgreSQL database with real-time subscriptions and built-in auth
- Contracts: Code written for on-chain contracts using Solidity
- Token-Service: Logic to handle staking verification, Coinbase api authentication.
Web3 & Blockchain
- Coinbase CDP: Onramp and offramp capabilities for users and staking
- Solidity 0.8.20: Smart contract development with OpenZeppelin security
- Sepolia Testnet: Ethereum testnet for development and testing
- IPFS via Walrus: Decentralized file storage for NFT assets and challenge metadata
Key Features:
Running Data Tracking & Verification GPS Tracking System
- Real-time Location: Uses expo-location for continuous GPS tracking during runs
- Coordinate Collection: Stores latitude, longitude, and timestamp for each point
- Polyline Encoding: Converts GPS coordinates to efficient polyline strings
Coinbase Onboarding/Offboarding
- Allows users to stake fiat currency
- Users would also be able to receive fiat currency directly from app
- Users can also check their balances directly on the app instead of their wallet
Staking
- Avoid cumbersome manual invoicing and complicated ledgering
- Checks on chain to validate the stake
- Instantly get paid out after winning a challenge
- Minimizes transactions in way that maximizes trust
Minting NFTs
- Automatically mint 3D visualizations of the route as a NFT
- Store media and metadata on Walrus through IFPS and to cache files beforehand
- Used OpenZeppelin as a foundation layer for the NFT contracts