Decentralized fitness escrow on Hedera: stake HBAR, hit step goals, unlock funds via Pyth oracle.
FitChain is a decentralized fitness platform that turns commitment into currency. It solves a core problem in today’s fitness ecosystem: most wearables funnel sensitive health data into centralized servers, creating honeypots for breaches and eroding user privacy. FitChain flips the model. Instead of exposing data, any smart health device manufacturer (OEM) can integrate by adding a lightweight SDK adapter. Fitness verification happens locally, while the Hedera blockchain handles incentives and trust.
Here’s how it works:
A participant (an individual, a gym, a corporate wellness program, or even a DAO) connects via MetaMask and escrows HBAR as a reward pool.
They set fitness goals—like daily steps or weekly activity targets—and commit them to a Hedera smart contract.
Progress is tracked locally on the user’s wearable and companion app. When a goal is achieved, the completion is verified off-chain by an oracle and relayed to the smart contract.
The contract unlocks rewards proportionally and allows the participant to withdraw directly into their wallet.
Because Hedera enables ultra-low fee microtransactions, FitChain can support frequent goal verifications and payouts without friction. Pyth integration ensures every payout can be transparently expressed in USD value, so employers, insurers, or DAOs sponsoring challenges can track incentives in fiat terms without relying on off-chain calculations.
Technical Architecture
StepGoalEscrow contract (on-chain): Maintains deposits, goals, and unlocked balances. Uses a pull-withdraw model for safety and predictable payouts.
Oracle (off-chain): Verifies goal completion and calls the contract. This is the main trust anchor, with future extensions toward multi-oracle or signature-verified flows.
Pyth price feeds: When a withdrawal is triggered, the contract can update the HBAR/USD price via Pyth. This allows reward events to carry real-time USD equivalents, enabling transparent reporting.
Client (frontend/backend): Manages deposits, oracle authentication, wearable SDK integrations, and displays contract events in the user interface.
Use Cases
Habit accountability: Individuals stake funds against their own fitness goals.
Employer wellness programs: Corporates or insurers fund rewards for verified healthy activity.
DAO-driven challenges: Communities pool funds and distribute rewards based on collective fitness milestones.
Gamified savings: Turn personal health goals into a provable savings or reward mechanism.
FitChain demonstrates how decentralized finance and privacy-first health tracking can merge into a system that is both incentive-driven and trust-minimized. It’s not just fitness data secured on-chain—it’s fitness motivation, made unstoppable.
FitChain is built to feel simple for users but is powered by a layered stack of Solidity contracts, Hedera infrastructure, React Native wearables integration, and Pyth price feeds.
User onboarding Participants start on our web portal, where they connect their Hedera account, define step-based goals, and lock in a reward pool using HBAR. Under the hood, these actions call our StepGoalEscrow smart contract, all orchestrated from a straightforward JavaScript frontend.
Smart contract logic The StepGoalEscrow contract (written in Solidity ^0.8.24 and deployed on Hedera) records deposits, goals, and unlock states. Rewards are distributed via a pull-based withdrawal model, ensuring security and scalability for many users. The contract supports two withdrawal paths:
withdrawWithoutOracle: release funds based on goals flagged complete.
updateAndWithdraw: triggers a Pyth price update, fetches the live HBAR/USD price, and emits a withdrawal event with USD equivalents for transparent reporting.
Wearables integration On the app side, we built a React Native client that integrates with a smart ring SDK. The app verifies fitness progress locally, keeping sensitive health data private. Once a goal is reached, the app triggers the oracle rather than sending raw health data to any central server.
Oracle + backend services Our backend, written in Node.js, acts as the trusted oracle and orchestrator. It:
Calls markGoal on the contract to confirm completed goals.
Fetches and forwards Pyth price update bundles.
Listens to events like Deposited, GoalMarked, and Withdrawn to update the frontend UI.
Pyth integration Pyth is used directly in the contract via its Solidity SDK. Whenever users withdraw funds, they can optionally include fresh Pyth update data. The contract verifies it, updates the feed, and calculates the USD equivalent of the released HBAR. This feature makes fitness incentives understandable in fiat terms, a must for employers, insurers, or DAOs funding challenges.
Security and design choices
Single-oracle trust is minimized by planning for multi-oracle or signature-verified flows.
Reentrancy is mitigated by updating state before transfers and can be hardened with OpenZeppelin’s ReentrancyGuard.
Loops on goals are capped to prevent gas overflows.
Refunds on excess Pyth fees are handled gracefully to keep UX smooth.
Stack overview
Contracts: Solidity + Hardhat for compile/deploy/test.
Blockchain: Hedera EVM-compatible smart contracts (HBAR escrow).
Data feeds: Pyth Network for HBAR/USD prices.
Frontend: React + Hedera JS SDK for wallet integration.
Mobile: React Native app integrating with smart ring SDK.
Backend: Node.js for oracle operations and event listeners.
Together, these components allow FitChain to provide a seamless user experience—private health verification on-device, low-fee microtransactions on Hedera, and transparent USD-equivalent payouts via Pyth.

