The rules
How PatchPay works
- 01
File
A maintainer pastes a GitHub issue. Issue Scout (Gemini) summarises it, rates difficulty and drafts testable acceptance criteria, which the maintainer edits.
- 02
Lock
PatchPay derives a one-off PatchEscrow contract address for that issue. The maintainer funds it from Paytaca, Cashonize or Selene over WizardConnect. Anyone can see the BCH sitting there.
- 03
Fix
Anyone, human or coding agent, opens a PR with “Fixes #N” and a PatchPay-Address line. Nothing to sign up for.
- 04
Prove
On merge, PatchPay reads GitHub directly: merge commit, head SHA, diff SHA-256, every CI check run, plus a sceptical AI review for missed criteria and AI-slop. That becomes the PatchProof, hashed and posted on the PR.
- 05
Pay
The merge is the maintainer’s approval. If CI is green, the PR has a valid payout address, the AI review finds the criteria met, and a maintainer other than the author merged it, the oracle signs (bountyId, recipient, proofHash) and the contract pays exactly that address, writing the proof hash into an OP_RETURN. Anything less waits for a maintainer’s manual approval.
- 06
Refund
Nobody fixed it by the deadline? Anyone can trigger the refund. The contract only lets funds go back to the maintainer.
When does a PR get paid?
- The PR is merged.
- A maintainer other than the PR author merged it.
- Every required CI check is green.
- The PR includes a valid payout address.
- The AI review says the acceptance criteria are met.
- No AI-slop signals are found.
When every condition passes, the contract pays the contributor automatically on merge and writes the PatchProof hash into the payout transaction.
If an automatic check fails, payout waits for a maintainer to review it. A failed AI check does not block payment forever: a maintainer can still approve the payout manually.
Trust model, plainly
- The contract cannot pay anyone the oracle did not sign for, and cannot be refunded to anyone but the maintainer.
- The oracle is a PatchPay server key. It only signs after a merged PR, green checks and a maintainer approval. Its public key is printed on every docket; every signature it made is in the payout transaction.
- The AI never holds keys and cannot approve anything. It only writes the review section of the proof.
- Next: replace the single oracle with a 2-of-3 (maintainer, PatchPay, independent verifier).