Inspiration

Open source maintainers, especially in fast-moving ecosystems like Bitcoin Rust libraries, are spending more time triaging low-effort or AI-generated PRs than reviewing real work. We wanted a fix that didn’t just bolt an LLM classifier onto GitHub, since that’s the obvious answer everyone reaches for. A Bitcoin-native prize from Btrust pushed us toward something that actually uses the technology: a small Lightning stake as the cost of claiming work, paired with a quality check that catches spam before a maintainer ever opens the diff.

What it does

SatGate has two parts working together. When a contributor wants to claim a GitHub issue, they lock a small Lightning stake. It’s refunded automatically when their linked PR merges, and forfeited if they ghost the issue or the PR gets closed unmerged. Separately, every PR gets run through a diff quality gate that checks things like whether the description matches the actual diff, whether tests were touched, and whether the change looks like boilerplate AI output, then posts an advisory score so the maintainer can triage faster.

How we built it

Rust backend on axum, GitHub App for webhooks via octocrab, Postgres through sqlx for claim state, and lnbits for invoice creation and payouts on the Lightning side. The claim lifecycle is modeled as an explicit state machine (Pending, Paid, Refunded, Forfeited, Expired) so invalid transitions are caught at compile time rather than in production. The quality checks are written as a trait so new checks can be added without touching the aggregation logic.

Challenges we ran into

Preventing two contributors from claiming the same issue at once turned out to need a database constraint, not application logic, since webhook delivery order isn’t guaranteed. We also went back and forth on custodial versus non-custodial Lightning given the time box, and on how strict the quality gate should be, since a tool that blocks legitimate first-time contributors is worse than the spam problem it solves.

Accomplishments that we’re proud of

We got the full loop working end to end on regtest: claim, invoice, payment, merge detection, refund. We’re also proud that the architecture ties directly into the actual prize theme instead of being a generic spam filter with a Bitcoin label on it.

What we learned

A lot about Lightning invoice lifecycles and webhook reliability, GitHub App permission scoping versus personal access tokens, and that advisory scoring beats hard gating for tools maintainers actually trust enough to install.

What’s next for SatGate

Move from custodial lnbits to a self-hosted LND or LDK node, build out contributor reputation from claim history across repos, package it as an installable GitHub App rather than a hackathon prototype, and pilot it with a Btrust-funded project willing to test it on real issue traffic.

Built With

Share this project:

Updates