Inspiration

When I set myself a deadline, nobody checks, so I keep missing it. A to-do list costs nothing to ignore. Students, freelancers and solo builders all have this problem: the only person holding them to account is themselves. I wanted ignoring a deadline to cost something, without the app ever being able to take the money for itself.

What it does

ProofStake lets you put real money on your own deadline.

  1. Say the goal in one sentence. "Finish 10 calculus questions by 9 tonight, $20, Priya gets it if I don't." An AI goal agent fills in the whole form and makes the goal provable with one photo. The amount is always the user's choice.
  2. Agree the proof rules. The AI writes a short, strict list of what the photo must show. You read and accept them.
  3. PayPal holds the stake. An authorization, not a charge, placed with one tap on a saved PayPal account.
  4. Optional pact. A friend gets a link, accepts with their PayPal email, and receives a missed stake. They never judge the proof, so it stays fair. With no partner, a missed stake goes to a charity pool. ProofStake never keeps it.
  5. Prove it. Before the deadline you upload a photo of the finished work with a one-time code from the app handwritten on the page, so an old photo can't be reused.
  6. AI checks, code decides. Gemini checks the photo against each rule. Before any verdict can cost money, a second, different model reads the photo again and must agree.
  7. PayPal settles. Goal met: the hold is voided. Partly met: a proportional part is captured. Missed: the full stake is captured, and after a 5-minute appeal window PayPal Payouts sends it to the partner.
  8. A person has the last word. Unsure verdicts and appeals go to a human reviewer. An AI case agent gathers the facts, including read-only PayPal lookups, but it can't move money. An upheld appeal is refunded.
  9. Nothing is hidden. Every PayPal call for a goal (the hold, capture, refund and payout) is listed in the app and matches PayPal's own API log.

How I built it

  • Next.js 16, React 19 and TypeScript, with Zod validation and SQLite, deployed on Railway.
  • PayPal: Orders v2 with the JS SDK (intent AUTHORIZE), Payments v2 (void, capture, refund), Vault payment tokens, Payouts, Webhooks with signature verification, and the PayPal Agent Toolkit, limited to read-only tools.
  • AI: Google Gemini (gemini-3.6-flash, with gemini-3.5-flash as the second opinion) for the rule writer, the vision check, the goal agent and the case agent. The agents run a tool loop: the goal agent checks the time, the user's history and the app's own rules before it drafts.
  • The AI is kept away from the money. It never calls PayPal's money-moving APIs and never names an amount. A pure function maps a verdict to a money action, and only that code calls PayPal.
  • Ports-and-adapters architecture. The core never imports PayPal, AI or database code, and modules talk through domain events. 256 automated tests cover it.
  • Live updates without refreshing, through lightweight polling that slows down when nothing is happening.

Challenges I ran into

  • Webhook verification only works if the raw request body is sent back to PayPal byte for byte.
  • PayPal's authorization honor period is three days, so goals are capped at three days to avoid re-authorizing.
  • Stopping an old photo from passing: the handwritten one-time code is matched by code, not by the AI.
  • A redirect behind the hosting proxy pointed at an internal address and blanked the page after upload. A relative redirect fixed it.
  • Calling a second model costs time, so it only runs when a verdict would charge money or a pass is borderline.

Accomplishments that I'm proud of

  • Every PayPal money action in one product: authorize, void, partial capture, full capture, refund and payout, all driven by verified rules.
  • An AI that is genuinely useful (drafting, checking, investigating) but structurally unable to move money.
  • A full appeal path with a real person and an AI helper, so a wrong verdict can always be fixed.

What I learned

PayPal's authorize-then-decide model is a natural fit for commitment contracts: the money is committed but not spent. I also learned that an AI system becomes trustworthy when its limits are enforced in code, not in the prompt.

What's next for ProofStake

  • More proof types, such as links, commits and fitness-app screenshots.
  • Longer goals, with re-authorization.
  • A real charity partner for the charity pool.
  • Recurring goals and group pacts.

Built With

Share this project:

Updates

Submission history