Provably fair outcome infrastructure for iGaming, built on Flare Confidential Compute (FCC) TEEs.
Game outcomes are produced inside a TEE. Per epoch, the TEE generates a secret
serverSeed, publishes SHA256(serverSeed) onchain as a commitment, then
resolves bets offchain as outcome = f(serverSeed, clientSeed, nonce). Every
outcome comes back as a receipt signed with the TEE's secp256k1 identity key.
At epoch close the TEE reveals the seed and anchors a Merkle root of all
receipts onchain. Players verify everything in the browser: signature,
recomputed outcome, commit/reveal, Merkle inclusion.
Outcome derivation is byte-identical between the Go TEE engine (later phase)
and the TypeScript reference implementation in this repo. spec/SPEC.md is
the normative contract; spec/vectors/ are the golden test vectors both
implementations must match exactly.
| Path | Contents |
|---|---|
spec/ |
FORESEER-SPEC v0.1 and golden test vectors (committed deliverables) |
packages/ts |
npm package foreseer-sdk: core, verifier, ReferenceTee. Git submodule |
server/ |
Orchestration service: epochs, SQLite receipt store, verify API (Phase 2) |
tee/ |
Go FCE extension, engine matching the vectors, contracts (Phases 3 and 4) |
docs/ |
Documentation site (Phase 5) |
web/ |
Next.js app: marketing site, the browser receipt verifier at /verify, operator dashboard |
demo/ |
Demo casino: p5 roulette frontend, operator backend, receipt checks, wallet topups |
HARDENING.md |
Production hardening runbook (Phase 6) |
TODO.md |
Whole-project MVP roadmap |
cd packages/ts
pnpm install
pnpm build
pnpm testRegenerate golden vectors (writes spec/vectors/, then copies them into the
package):
cd packages/ts
pnpm gen-vectors
pnpm sync-vectorsRegeneration is deterministic: the files must come out byte-identical.
- Clone with
git clone --recurse-submodules <url>. After a plain clone, rungit submodule update --init. - An empty
packages/ts/folder means the submodule was never initialized: rungit submodule update --init. - After every pull, run
git submodule update --initagain. - Commit order is always two-step: commit inside
packages/tsfirst, then commit the pointer bump in the root:git -C packages/ts commit ...thengit add packages/ts && git commit. modified: packages/ts (new commits)ingit statusmeans the pointer commit is still missing:git add packages/ts && git commit.- Never stage the subrepo's file contents into the root repo.