CrossChainFitnessDapp

Overview

CrossChainFitnessDapp is a decentralized application that allows you to create fitness challenges and invite your friends to participate. Smart contracts ensure adherence to the rules, manage funds (in USDC), and hold everyone accountable across multiple blockchain networks using Chainlink's CCIP.

Key Features

  • Challenge Creation: Easily create fitness challenges and invite friends to join.
  • Smart Contracts: Manage rules and funds securely.
  • Cross-Chain Capability: Use USDC across multiple chains with Chainlink CCIP.
  • Accountability Judges: Select impartial third-party judges to verify activities.
  • Social Proof: Use Lens for posting and attesting to challenge progress.
  • Strava Integration: Automatically fetch activity data from Strava via Chainlink Functions.
  • Fair Rewards: Distribute funds among those who complete the challenge successfully.

How It Works

CrossChainFitnessDapp Screenshot

  1. Create a Challenge:

    • Define the challenge (e.g., 50 push-ups daily for 30 days).
    • Deploy a smart contract that manages the challenge rules and funds.
    • Publish a summary post on Lens.
  2. Connect and Verify:

    • Connect your Strava account to the dApp.
    • Post daily proofs of your activities on Lens.
    • Judges attest to the validity of your posts.
  3. Monitor and Validate:

    • Chainlink Functions call the Strava API to fetch and verify activity data.
    • Attestations on Lens are tracked by the UMA Optimistic Oracle.
  4. Distribute Rewards:

    • Upon challenge completion, proofs are analyzed.
    • Funds are split among participants who met the challenge criteria.

Example Scenario

Imagine you challenge two friends to do 50 push-ups daily for 30 days. Here's how it plays out:

  • Create Challenge: Deploy a CrossChainFitness challenge and post a summary on Lens.
  • Choose Judges: Select impartial third-party judges.
  • Connect Accounts: Link Strava accounts with the dApp.
  • Post Proofs: Daily post proofs on Lens.
  • Attestations: Judges verify the posts on Lens.
  • Completion: After 30 days, verified participants split the USDC pot.

Technology Stack

  • Lens Protocol: Used for distribution, social proof, and attestations.
  • UMA Optimistic Oracle: Tracks attestations from Lens.
  • Strava API: Authenticates and retrieves user activities.
  • Next.js: Frontend framework for the dApp.
  • QuickNode QuickAlerts: Notifies the backend service of new contract creations.
  • Chainlink Services:
    • CCIP: Supports cross-chain token staking.
    • Functions: Calls Strava API for activity verification.

Detailed Workflow

  1. Challenge Setup:

    • Deploy a custom escrow contract with details like participant Lens handles, judges, USDC amount, and criteria.
    • Backend cron service starts polling Lens API for specific posts from participants.
  2. Verification Process:

    • If participants meet the posting and activity criteria, the backend updates the UMA Oracle.
    • UMA Oracle influences the challenge outcome and the withdrawal functionality of the contract.
  3. Reward Distribution:

    • Upon challenge completion, the smart contract queries the UMA Oracle.
    • Verifies winners and facilitates fund withdrawal.

Chainlink services utilsed

  • CCIP: Allows users to stake tokens from supported chains like Avalanche, Moonbeam, Polygon Cardono.
  • Functions: Calls the Strava API to verify challengers' activities.

By combining the power of blockchain technology, social media, and fitness tracking, CrossChainFitnessDapp offers a unique and fair way to motivate and reward physical activity.

Built With

  • chainlink-ccip
  • chainlink-functions
  • lens
  • lens-openaction
Share this project:

Updates

Submission history