How It Works
The pieces
- stellarcade (the monorepo) — the on-chain contracts, the frontend, and the backend services (gateway, game-service, prize-service, quest-service)
- stellarcade-arbiter — the provably-fair randomness and settlement service. Publishes commitments before rounds and reveals after.
- stellarcade-sdk (this package) — the client that talks to both, plus the fairness verifier that trusts neither.
A round, end to end
- Commit. The client calls
games.commitRound(gameId). The arbiter picks a fresh server seed, hashes it, and publishescommitHash— before any stake exists for this round. - Play. The client calls
games.play({...})with a stake and aclientSeedthe player chooses. This submits a signed transaction that locks the stake against the round. - Settle. Once the transaction confirms, the arbiter reveals its server
seed and derives the outcome from
serverSeed + clientSeed + nonce + ledgerHash(see Fairness Verification for the exact derivation). It pays out from the prize pool and publishes a proof. - Verify. Anyone — not just the player — can fetch the proof and run
verifyProof()against it, entirely offline.
Why the ledger hash matters
The Stellar ledger hash at commit time is folded into the outcome derivation. Neither the arbiter (which picked the server seed before the ledger closed) nor the player (who picked the client seed before either the ledger hash or the server seed were known) can predict or steer the final value alone.