← Back to Home

Capstone Project (In-progress)

Brief 1-line description (placeholder)

Problem

Existing habit tracking apps (e.g., Beeminder, Habitica) rely almost exclusively on internal motivation. While gamification helps, there are no real consequences for missing goals. This project addresses the gap by introducing financial and social incentives directly into the habit-tracking loop. By combining “skin-in-the-game” accountability (staking funds) with social pressure (peer groups), we aim to create a more effective system for behavioral change.

Role

I am responsible for the On-chain Staking Integration and Authentication. My focus is on:

  • Smart Contract Development: Implementing the escrow logic on Solana using the Anchor framework.
  • Authentication: Integrating Privy for seamless embedded wallet creation and user onboarding.
  • Security: Ensuring the financial infrastructure meets security standards for handling user funds.

Tech Stack

  • Frontend: React, Next.js, Vercel
  • Auth & Wallet: Privy
  • Database: Supabase (PostgreSQL)
  • Blockchain: Solana (Anchor Framework), Helius (RPCs)
  • Backend: Node.js (Health API integrations)

Outcome

This is an ongoing 12-week Capstone Project. We are currently in the development phase, with a roadmap including:

  • Milestone 0-2: Core interface and secure authentication (Completed).
  • Milestone 3-5: Group creation, goal systems, and financial staking integration (In Progress).
  • Milestone 6-7: Security audits and final polish.

Technical Deep-Dive

Financial Staking Architecture

The system uses a decentralized escrow model to handle user stakes. Unlike traditional finance apps, this allows for programmable money and transparent logic.

  1. Staking: Users deposit SOL or stablecoins into a smart contract escrow linked to their goal.
  2. Verification: Oracles (via backend health API integrations) verify goal completion.
  3. Redistribution:
    • Success: The user retrieves their stake.
    • Failure: The stake is forfeited and redistributed to the peer group or a charity, as defined by the group rules.
// Pseudo-code for the Anchor Smart Contract Escrow
#[program]
pub mod habit_tracker {
    use super::*;

    pub function initialize_goal(ctx: Context<InitializeGoal>, amount: u64) -> Result<()> {
        // Transfer funds from user to escrow account
        token::transfer(
            ctx.accounts.transfer_context(),
            amount
        )?;
        
        // Set goal parameters
        let goal = &mut ctx.accounts.goal_account;
        goal.amount = amount;
        goal.deadline = clock::Clock::get()?.unix_timestamp + DURATION;
        Ok(())
    }

    pub function resolve_goal(ctx: Context<ResolveGoal>, success: bool) -> Result<()> {
        // Logic to return funds or redistribute based on 'success' flag
        // Verified by authorized backend signer
    }
}