pull down to refresh

Cool build. One question on the fairness draw: taking SHA-256(blockhash) mod 10,000 has a small modulo bias (2^256 isn't a multiple of 10,000), and deriving 6 winners from a single hash makes those draws correlated rather than independent. Probably fine for a fun game, but have you considered rejection sampling for the mod, plus hashing in a per-winner index (e.g. SHA-256(blockhash || i)) so each coordinate is independently uniform? Also: what stops someone from watching the tip and rushing the final pixel purchases when the current block hash happens to favor their pixels?

Thank you so much for taking the time to share such a detailed and sharp analysis! Your feedback on the selection algorithm and blockhash mechanics is spot on. It's rare to get such high-quality, technically sound input, and I really appreciate you pointing these nuances out.

You are completely right on all three points:

  1. Modulo Bias: While 2^256 mod 10,000 introduces a mathematically negligible bias, using rejection sampling is indeed the gold standard for pure uniform distribution.
  2. Entropy and Independence: Deriving all winning positions directly from a single hash creates statistical dependency. Switching to indexed hashing, such as SHA-256(blockhash || i) for each winning slot i, ensures true independence across coordinates.
  3. Mempool / Front-running Risk: The risk of someone tracking the chain tip to front-run the final purchases is a crucial practical issue.

Here is our action plan to address these points:

1.Future Block Commitment: To eliminate any possibility of front-running or predicting winning coordinates, we will lock the game state as soon as the last pixel is purchased and declare that the draw will use a future blockhash (e.g., target block N + 5). This guarantees that nobody - including us can know or influence the hash in advance.

2.Independent Seed Generation: We will update the logic to compute each winning coordinate independently using SHA-256(blockhash || i).

3.Rejection Sampling Implementation: We will implement rejection sampling over the modulo operation to ensure strict mathematical uniformity across the grid.

Thanks again for helping make the project fairer and more robust. People like you make building in this space worthwhile!

reply