Game Mechanics

Flip game

Flip is the headline game on ThisOrThat. Buyer picks a card (or a multi-card cart), chooses a spread, and a coin flip decides whether they pay BELOW market or ABOVE. Either outcome, they get the card. The spread is the gambling element; the card delivery is the certainty.

The math

Every Flip listing has three numbers stored in FlipConfig:

Example: $100 card at 25% spread:

The provably-fair flow

The buyer can verify the outcome wasn't rigged. Sequence:

  1. Buyer commits the play with a Stripe payment intent (manual capture)
  2. Server generates seed: crypto.getRandomValues(32 bytes)
  3. Server hashes seed: sha256 = SHA-256(seedHex)
  4. Server anchors hash on Solana (memo transaction). Buyer can verify the hash existed before the result was decided.
  5. Server reveals seed + computes outcome: seed[31] % 2 === 0 ? WIN : LOSE (last byte's parity)
  6. Buyer's UI animates the coin flip, lands on result
  7. Server captures the right amount via Stripe: winPrice if win, losePrice if lose
  8. Order created, label printable, fulfillment proceeds
✓ The trust model

The hash gets anchored on-chain BEFORE the seed is revealed. Anyone can verify after the fact: take the revealed seed, recompute SHA-256, check it matches what's anchored on Solana. If the hash doesn't match, the operator cheated. If it does, the math is verifiable.

Multi-card flip carts

Buyers can build a cart of 2+ cards and flip them all on one outcome. Use case: stacking sub-$15 cards over the shipping floor. Math is identical — cardValue becomes the cart total.

CartTotal valueSpreadWin priceLose price
1× $50 card$5025%$37.50$62.50
3× $5 cards$1525%$11.25$18.75
5× $20 cards$10025%$75$125

Eligibility rules

Lots vs singles in Flip

A "lot" is a Listing with multiple cards stored as a single unit. The buyer flips the whole lot once, ship every card on the same outcome.

Spread defaults

Currently 25% across the system (recently bumped from 15%). The spread number is the operator's risk knob:

Code references