← Back to home

Body doubling App

A cooperative focus app that uses staking & reputation to incentivize helping others focus/learning

Problem Statement

This project is a cooperative focus and learning mini-app that transforms body-doubling into an incentive-aligned, positive-sum system. People concentrate better when others are working alongside them, and this product turns that psychological effect into a structured mechanism powered by staking, lightweight presence verification, and social reputation.Users join or create a session, stake a small amount of tokens, and start a shared timer. As long as they remain present—either silently contributing to the “social pressure of focus” or actively helping others with encouragement or quick guidance—they keep their stake and earn a share of the session’s reward. If someone disappears entirely, their stake is forfeited and reallocated to the community pool. This simple rule aligns the group around one goal: the more people finish together, the more everyone benefits. It naturally motivates users to help each other stay engaged rather than just focusing on themselves.Presence is verified through lightweight periodic check-ins, not productivity monitoring. Users confirm they’re still in the room every 15–20 minutes, which is strong enough to prevent “AFK farming“ while keeping cognitive load low. Silent users still provide value simply by being part of the shared environment, while active helpers earn additional reputation after each session through a 1–5 rating flow.A core differentiator is that the system directly rewards pro-social behavior. Users rate each other on how much they supported concentration and learning, and this reputation influences future reward shares. Good collaborators naturally rise into higher-quality groups, while disruptive behavior reduces future earnings. Over time, this creates a self-organizing network of people who reliably support one another.🛠 How the Tech Supports This MechanismSmart Contract (Celo) — manages staking, group creation, session timing, liveness status, and reward distribution. Its transparent logic ensures trust: nobody can alter outcomes or take unfair advantage.XMTP — acts as the notification and coordination layer. It delivers reminders (“10 minutes left”), start signals (“Session ready”), and post-session recaps directly via DM, so users don’t need the app open to stay engaged.Reputation Layer — session ratings flow back into on-chain reputation scores, which affect future incentives, making supportive behavior measurably valuable.Optional Identity Binding (Self Protocol) — prevents multi-account exploits by ensuring one human = one session slot, protecting the cooperative incentive loop.By combining minimal staking, presence verification, and a reputation-driven reward curve, the system captures the real-world effect of body doubling and turns it into a scalable, trust-minimized cooperative game. Instead of competing or grinding alone, users earn more by helping others finish—making focus itself a shared, reinforced activity.

Solution

We built Body Doubling Staking for Focus as a Celo-based smart contract and Farcaster mini app that together turn group focus sessions into a bot-driven staking game. On-chain, we added a FocusStaking contract (with its ABI in FocusStaking.abi.json and deployment metadata in deployment-info.json) plus a Node script scripts/deployContract.js to deploy and manage it on Celo. The contract models a “focus session” as a group staking pool: it keeps track of sessions, participants, stake token (Celo native or ERC-20), start/end timestamps, liveness flags, and the final payout state. For each session, users lock a small stake into the contract; if they are still marked “alive” when the session ends, they are eligible to withdraw their stake and a share of the group reward, while users flagged as AFK forfeit their stake into a community incentive pool. The PR description explicitly highlights that the contract supports liveness checks, AFK marking, session finalization, and secure withdrawals, as well as both native and ERC-20 staking on Celo, with the intention that a bot (rather than individual users) will drive many of these calls. GitHubWe chose Celo because it combines EVM compatibility with low fees and a mobile-friendly ecosystem. For this product, users might join multiple short sessions every day; on a more expensive L1 this would make the staking mechanic unusable. On Celo, we can afford to have users stake small amounts per session, rely on several contract calls around each session (join, liveness windows, finalization, withdrawal), and still keep the cost negligible. The fact that we can use stable tokens on Celo also makes the reward structure intuitive for non-trader users: “stake 1 unit, earn 1.x if the group finishes together” instead of exposing them to volatile token economics.On the frontend, we use the Neynar Farcaster Mini App Quickstart as our base: a Next.js + TypeScript mini app that can run as a Farcaster mini app / Frame and talk to the contract from the browser. GitHub The mini app is responsible for discovering sessions, letting users create or join them, showing the shared timer, and collecting “still here” signals during the session. From a user’s point of view, it behaves like a normal focus/Body Doubling tool: you tap to join, see a countdown, occasionally confirm that you’re still present, and at the end you see completion and reward information. Under the hood, the mini app only signs and sends the minimal set of on-chain transactions (stake / join, and later withdrawal); most of the repeated liveness updates are intentionally delegated to a bot so that people are not forced to push a transaction every 15–20 minutes.This is where XMTP comes in: we designed the protocol so that an XMTP-based agent is the “coordination brain” around the Celo contract. The agent subscribes to contract events (e.g. session created, session started, liveness window, finalization) and turns them into direct messages to participants—“your session is about to start”, “check-in window open, tap to confirm”, “session finished, here’s your recap”. When users tap a button in the mini app or reply to the XMTP message, those presence signals are collected off-chain by the agent and then periodically batched into a single call to the FocusStaking contract’s liveness/AFK functions. This pattern is exactly what the merged PR describes as “bot-driven group staking with liveness tracking via bot and session-based payouts on Celo,” and it is what makes the system both usable and trustless: all economically relevant state is on-chain, but the noisy, high-frequency presence checks are aggregated off-chain by the XMTP bot, not pushed one by one by each user. GitHubWe also design the system to integrate Self Protocol for Sybil resistance and device binding. In our architecture, before joining a session, a user proves via Self that they are a unique human bound to a particular device/wallet, in a privacy-preserving way. The proof can be checked client-side in the mini app and/or by the XMTP agent before it accepts liveness signals for that wallet. This prevents a single person from joining the same session multiple times through different accounts or devices to farm extra rewards, which would break the cooperative game theory. Importantly, Self allows us to enforce “one human = one seat” without ever putting raw identity data on-chain or inside the app, which is crucial for a product that touches focus and mental-health-adjacent behavior.Putting it all together: Celo gives us an EVM smart contract (FocusStaking) with low-cost, verifiable staking, liveness, and payout logic; the mini app built on Neynar’s Farcaster Mini App stack provides a smooth, social UX surface; the XMTP agent turns contract events and user intents into a conversational flow and batched on-chain updates; and Self Protocol underpins the whole thing with Sybil resistance. The repo reflects this structure: a Next.js mini app scaffold, plus the added FocusStaking contract, ABI, deploy script, and updated package configuration to support a bot-driven, XMTP-integrated staking flow on Celo.

Hackathon

ETHGlobal Buenos Aires

2025

Contributors