StreetHeist — Technical Overview

Architecture, API surface and current integration status for aggregators and studios

Build information loading…

This document describes the CURRENT, implemented scope of the StreetHeist server-authoritative demo build — not a roadmap or a marketing claim. Every capability below is marked Implemented only where the running code does it today; everything else is marked Demo-only, Planned or None. Read alongside the one-page Game Sheet and the landing page's Integration section.

Implemented in the current build Demo-only works, but not production-grade Planned does not exist yet None no such capability exists

1 · System diagram

Text alternative: the list below IS the diagram — read top to bottom (or left to right on wide screens) as one request/response pipeline.

  1. Player BrowserInput & presentation
  2. StreetHeist HTML5 Clientstreetheist/scripts/* — rendering, state machine, animation only
  3. StreetHeist Game APIapi-routes.js / api-route-table.js — session, round, verify
  4. Server-Authoritative Engineengine.js — commit-reveal RNG & payout math
  5. Mock Walletwallet.js — demo ledger, not a real payment rail

2 · Client / server responsibilities

Client (browser)

  • Draws the hand-drawn vector city in real time (WebGL) and plays result/motion animation
  • Drives the round UI through the state machine below
  • Calls the API; never computes an outcome or a payout itself
  • Restores an in-progress round from server data on load

Server (Node, dependency-free)

  • Owns session, balance and round state (round-repository.js)
  • Resolves every outcome via commit-reveal RNG (engine.js)
  • Computes integer minor-unit payouts; applies them via the mock wallet, or the casino's wallet for a casino session
  • Validates every request field; rejects unknown fields (api-validators.js)

3 · Current API endpoints

MethodPathPurpose
GET/api/configPublic odds/config for rendering (no secrets)
POST/api/sessionCreate or resume a session
POST/api/fair/client-seedSet the player's client seed
POST/api/fair/rotateReveal the previous server seed, issue a new commitment
POST/api/round/startStart a round for a bet (idempotent)
POST/api/round/stepRob the next target (idempotent)
POST/api/round/cashoutBank the current pot (idempotent)
POST/api/verifyRecompute a revealed round for independent fairness verification
GET/api/districtsThe street catalogue with its disclosed RTP and bust chance
POST/api/districtSelect the street a session plays in (one street today)
POST/api/session/code, /api/session/resumeResume codes — carry a demo to another device. No credentials: the server mints a random 80-bit code, stores only its SHA-256, and exchanges it for the session it points at. Nothing stored identifies a player.
POST/api/operator/launch, /api/operator/sessionReal-money mode: the casino's signed launch, then the game page trades the one-time launch code for the session. 404 unless a casino is configured
POST/api/hub88/game/url, /game/list, /game/roundHub88's signed calls (RSA-SHA256). 404 unless Hub88 is configured
POST/api/payments/coinbase/*Sandbox top-up demonstration (config, checkout, status, simulate, mode) — test funds only, never a real payment rail

Any other method on a known path returns 405 with an Allow header; an unknown path returns 404.

4 · Round state machine

Client-side machine (streetheist/scripts/client-machine.js) — the transition table there is the single source of truth; UI code never branches around it.

ERROR is a connection/technical state, kept visually distinct from FAILED (a confirmed lost round) — the two are never presented the same way.

5 · Integer minor-unit model

Every money value on the wire and in storage is an integer count of minor units of the session currency (cents; satoshi for BTC; 10⁻⁸ ETH for ETH) — betCents, potCents, balanceCents. No float ever represents money. The server floors the final multiplier-derived payout to whole minor units before crediting, and every persistence adapter asserts money fields are integers before writing them to disk.

6 · Commit-reveal overview

Before a round starts, the server generates a server seed and publishes only its SHA-256 commitment. Round outcomes are derived deterministically from the (server seed, client seed, nonce) triple via HMAC-SHA256; the same triple decides how many targets each step offers — four, five or six, equally likely. Every round records the rule it was dealt under, so rounds from the earlier five-target rule still replay exactly. The server seed is revealed only after the round it protects is over (/api/fair/rotate), so a player can confirm afterwards, via /api/verify, that the revealed seed matches the earlier commitment and reproduces the exact round they played. No seed value, HMAC key material, or other secret is published anywhere in this document.

7 · Idempotency status

Implemented — every state-changing route (start/step/cashout) accepts an optional requestId. A repeated id with the same payload replays the original response instead of re-running the round logic; the same id with a different payload is rejected with a conflict error. The dedupe store itself is in-memory, bounded per session, and time-limited — a demo-scale safeguard, not a distributed/durable idempotency layer.

8 · Restore status

Implemented — reloading the page (or losing the connection) resumes the session and re-renders whatever round state the server holds — active, busted, or cashed — without ever re-submitting a start/step/cashout call. Persistence backing that state: Demo-only (not production) — local runs can use memory or a file adapter; the hosted presentation build requires the Postgres adapter. Certification-grade retention, export and operational controls remain outstanding.

9 · Mock wallet status

Wallet: Demo-only (not production). Demo sessions' bet debits and payout credits flow through a small, transaction-audited, idempotent interface (wallet.js) rather than a raw balance mutation — a demo ledger, not a payment rail. Casino sessions bypass it: their stakes and wins go to the casino's own wallet as signed, idempotent bet / win / rollback calls (see §10).

10 · Known production gaps

11 · Build & algorithm version

Product versionLoading…
API versionLoading…
Math / algorithm modelLoading…
Build dateLoading…