hi stacks forum. we’re blip labs, a small team making free games on stacks where a bitcoin block picks each day’s map, so nobody could pick it, us included.
what’s live:
genesis run, a free browser game: playgenesis.run/play
the bot cup, a separate league where bots play the same game through an open API: playgenesis.run/agents
the 5-step fair check and open kits (MIT) are on the site and on github under blip-labs/blip
along the way we sent two small fixes upstream: stacks explorer #2870 and leather mobile #2916.
nov 2-8 the bot cup runs a 50 STX contest for bot builders. rules are on the agents page.
no token, nothing to buy. honest feedback on the game is the most useful thing you could give us.
Nice work on the fair page. The list of what it doesn’t prove is more honest than most.
On the anchor, todaysAnchor takes the first block after midnight as soon as it appears, and the worker caches it for the day. At that moment it has zero confirmations. One-block reorgs still happen on Bitcoin now and then, with nobody throwing a block away on purpose. If the anchor gets orphaned, the cached hash is no longer in the chain, so mempool.space and bitcoin-block-hash at that height show a different hash from the one the day was played on. Keeping the anchor pending until it has a few confirmations (3 is about 30 minutes) avoids that.
The miner of a block near midnight also sets its timestamp, anywhere above the median of the previous 11 blocks and up to 2 hours ahead. So without throwing anything away they can decide whether their own block becomes the anchor or leave it to the next one, and a block mined at 23:00 can carry a 00:30 timestamp and show the day’s map early. For a free game that hardly matters, but “nobody could pick it” is a bit stronger than the rule. Using the median time past instead of the block’s own timestamp, the reason BIP 113 moved locktime to it, makes that much harder to move, at the cost of the map switching about an hour after midnight.
In the contract, seal-week accepts any week number, and since map-insert never overwrites, a wrong number sealed once stays forever and blocks the real week. Asserting the week is the last sealed week plus one closes that before mainnet.
thanks Carlos, this is exactly the kind of review we were hoping for. all three were real, and all three are fixed:
confirmations. the anchor now stays pending until it has 3 confirmations, so a 1-block reorg can’t swap a map we already served.
miner timestamps. from Monday Nov 9 (UTC) the anchor is the first block whose median time past is at or after midnight, BIP 113 style. a miner can no longer pull its own block into the day with its clock. earlier days keep the old rule so no served map changes. the map now lands an hour or two after midnight, which is fine for us. the fair page explains it.
seal-week. weeks now seal strictly in order (last sealed + 1), and only once the week is over by the chain’s own clock (stacks-block-time). so a typo can’t lock out a real week. quiet weeks seal empty so the chain never stalls. this goes in a fresh testnet deploy before anything touches mainnet.
code is in the open kit if you want to poke at it again. really appreciate you taking the time.
The new seal-week still has one opening: next-week starts as none, so the very first seal accepts any past week. If that first number comes out too high, the real first week can never be sealed after it, and if it’s too low every week in between has to be sealed empty before you catch up. Setting next-week to the first week at deploy, instead of none, closes that.
medianTimePast reads the 11 blocks before the candidate, so the candidate’s own miner can’t pull it into the day with its timestamp now.
good catch again, you’re right. a none start meant the very first seal could land on any past week.
fixed: there’s now a FIRST-WEEK constant set at deploy, and next-week starts there, so the first seal has to be exactly that week and every one after is +1. it also checks the order before the week-is-over check, so any wrong number gets the same clear error. the simnet checks now cover a week before the start, an arbitrary past week, and a far-future typo on the first seal.
and thanks for confirming the median time past change.
quick update, since today is the day the changes from this thread kick in.
from today (Nov 9 UTC) the daily map anchor is the first bitcoin block whose median time past is at or after midnight, and it stays pending until it has 3 confirmations. a miner’s clock can’t pull its block into the day, and a 1-block reorg can’t swap a map we already served.
fairplay-board-v2 is deployed on testnet with the FIRST-WEEK fix, so seals have to go in order from the start. the first seal on it will be week 44, this week.
new since the first post: loot rolls in genesis run 2 come from real bitcoin blocks too. every drop has a CHECK THIS ROLL button, and the check page redoes the roll in your browser (sha-256 of hash:save:drop) and sends nothing anywhere.
everything lives at one link now: playgenesis.run/testnet
thanks again to Carlos for the review. if anyone wants to try to break the roll check or the seal order, we’d honestly like that more than likes.
On the roll check, which block’s hash goes into sha-256(hash:save:drop)? If it’s one that’s already mined when a save starts, like the day’s anchor, a player can make fresh saves (wallets are free) and compute every drop offline before playing, then keep the save whose rare drops come early. A block mined after the save is created, or after the drop is earned, takes that away.
That precompute risk is real if the roll uses a block hash already known when the save is created. The robust version is commit-then-reveal: bind each save or drop to a future block height before the player sees the hash, store the save/drop commitment, and derive sha-256(hash:save:drop) only once that block is mined. If the target block can be chosen after seeing drops, or if a player can reroll saves freely, the check is fair per roll but not fair across attempts. Zealynx’s future-block suggestion is the right direction.