What AI caught in our bitcoin game, and what it missed

saw muneeb say the only way to fight AI hacks is to get better at AI defense. agreed, so heres what that has looked like for us so far, in case its useful to anyone else building small on stacks.

were a small anon team making genesis run 2, a free arcade shooter where maps and loot come from real bitcoin blocks. if a game says its fair, people should be able to check it, so we ran our own code past AI reviewers before anything touched real money.

what the AI reviews caught (before launch)

  • a way to fake a huge score by editing what the browser sent the server
  • an XSS hole in a backup-code screen
  • a contract path where the owner could disqualify every winner and then take the refund. we couldnt fully remove that one on testnet, so its disclosed on our fair page instead of hidden
  • an off-chain helper that approved payouts by run id only, so a hacked server could swap the wallet

we ran a second, independent AI pass after the fixes, and it still found 4 blockers. one pass is not enough.

what a human caught that the AI missed
Carlos from Zealynx read our forum thread and found timing problems in how we pick the daily bitcoin block: a miner’s clock could pull a block into the wrong day, and the first weekly seal would accept any past week. both are fixed now, and fairplay-board-v2 on testnet has the fix.

so our takeaway is to use AI for coverage and speed, and then still ask real people to read your code. the AI found more issues, but the human found the ones that mattered for fairness.

what anyone can check today
every loot drop has a CHECK THIS ROLL button. the check page redoes the roll in your browser from the bitcoin block hash and sends nothing anywhere: playgenesis.run/testnet

an offer
if youre building something small and open source in clarity and want a free extra pass, reply here. we run the same AI review on it and send what we find to you privately, not in public. no strings attached and nothing to buy. we know how stressful a public bug report can be.

Thanks for the mention, and for shipping the MTP and first-week fixes that fast. On the owner path you disclosed, if disqualifying and refunding become two calls with a fixed wait in burn blocks between them, players see a disqualification coming before the refund moves, and the fair page can link to it on chain while it’s pending.

thats a good idea, thanks. a disqualify call that only queues it, then a refund that cant run until N burn blocks later, means nobody gets surprised and the pending dq is right there on chain for anyone to see. well build it into the next version of that contract and link the pending dq from the fair page. if you have a number of burn blocks in mind for the wait wed take it, were thinking about a day (~144)

144 burn blocks is roughly a day at ~10-minute Bitcoin blocks, which seems reasonable for a pending-DQ notice. I’d make the wait a contract parameter with a sensible floor, emit an event when the disqualification is queued, and have the fair page link directly to that event. For small arcade payouts I wouldn’t go much longer than a day, since longer waits mostly add uncertainty for players.

Sorry for the slow answer. A day (144) sounds right for payouts that size. If the wait becomes a parameter like lancekristi suggests, I’d let the owner only raise it, or put any change to it behind the same wait, otherwise lowering it to 0 just before a disqualification brings back the instant path. I’d also store the burn block height in the queued entry, so changing the wait later doesn’t move a disqualification that’s already pending.

thanks both, this is really useful. @lancekristi agreed on the day, and the event on queue plus a direct link from the fair page is going in. @Zealynx good point about the wait getting lowered to 0 right before a dq. we’ll make the wait a parameter with a 144 floor that the owner can only raise, and each queued dq will store the burn height it was queued at, so changing the wait later can’t move one that’s already pending. we’ll post here when the new contract is on testnet