Inspiration

  Open-source bounties run on a promise. A company offers money in an issue, someone spends a weekend on the fix, the pull request merges, and then payment takes weeks of chasing, or never arrives. Maintainers hate being the payment police, and contributors learn to ignore bounties. We wanted the opposite order: the money exists before the work starts, and it moves when the work is verified.

What it does

  BountyRail is an escrow rail for open-source bounties. A sponsor posts a bounty with acceptance criteria and the contributor's PayPal email. The full amount is authorized through PayPal Orders (intent=AUTHORIZE), so it is held but not captured. A patch arrives manually or from a merged GitHub pull request. An AI judge reads the diff, the test output, and every criterion, then returns a verdict, a score out of 100, and one evidence line per criterion. The maintainer reviews that evidence and confirms. Only then does BountyRail capture the authorization and send a PayPal Payouts transfer to the contributor. Every order, authorization, capture, and payout ID stays on the bounty.

How we built it

  Next.js 15, React 19, and TypeScript, with route handlers for the API and server-rendered pages. PayPal Orders v2 for the authorization hold and capture, and PayPal Payouts for settlement. The judge runs on Groq with openai/gpt-oss-120b through an OpenAI-compatible endpoint, with strict JSON validation and a labelled deterministic fallback when no key is configured. GitHub webhooks are HMAC-SHA256 verified and matched to an escrowed bounty by issue reference or label. Data lives in a JSON store with an in-process write lock. We wrote 26 Vitest tests, including the full create → authorize → review → release pipeline, and built two explainer videos plus a live demo cut.

Challenges we ran into

  The biggest was PayPal's authorize flow: an AUTHORIZE order must call /v2/checkout/orders/{id}/authorize, not /capture. Mocks passed; the live sandbox returned ACTION_DOES_NOT_MATCH_INTENT. Fixing that was the moment the escrow actually worked. We also had to separate AI evidence from AI authority: the model can score a patch, but it has no capture credential. And serverless storage is ephemeral, so the demo seeds itself per instance rather than pretending state is durable.

Accomplishments that we're proud of

We shipped a complete money path and proved it in the PayPal sandbox instead of simulating it. A sponsor's $1.00 was authorized, converted to a held authorization, captured after an AI review, and paid out to a sandbox personal account: order 5J888823MC1579146, authorization 58P79889U1365612U, capture 7EU31176AF449904A, payout batch DZL7PGFLW3TWL, payout item NC468V9PR25JW, both settled SUCCESS. The Groq judge returned a pass at 100/100 on the real patch, with evidence for the criterion.

We are also proud of the safety model. The AI produces evidence but has no capture credential, and the release endpoint rejects any request without explicit maintainer confirmation. A failed payout is recorded with its error and can be retried rather than silently swallowed. Everything that is simulated is labelled as simulated.

The project ships with 26 automated tests covering validation, webhook matching, the PayPal client, and the full create → authorize → review → release pipeline. A hosted demo and a 1:47 video show the real run end to end.

What we learned

Authorization holds fit conditional work well. They reserve the sponsor's funds without transferring them, and the later capture is an explicit, auditable event.

The hard part of AI-verified payments is not the model, it is the trust boundary. Evidence and authority have to be separate. A two-key design, AI review plus human release, is easier to explain and easier to defend than either one alone.

Mocks are not enough. Our mocked PayPal flow passed while the live sandbox rejected it with ACTION_DOES_NOT_MATCH_INTENT: for an AUTHORIZE order the endpoint is /authorize, not /capture. That bug only appeared when we tested against real PayPal.

Serverless hosting also forced honesty about state. Vercel's filesystem is ephemeral, so the demo seeds itself per instance instead of pretending the data is durable.

Built With

  • and-typescript
  • next.js-15
  • react-19
Share this project:

Updates

Submission history