The house locks its randomness
before you bet.
Foreseer resolves game outcomes inside an attested TEE on Flare Confidential Compute. Every bet returns a signed receipt that anyone can recompute, offline, in a browser.
{
"specVersion": 1,
"codeVersion": "0x6094010f…76f7a28b",
"epochId": 1,
"betId": 0,
"seedCommit": "0x630dcd29…1bd710dd",
"clientSeed": "alice",
"nonce": 0,
"ruleHash": "0x7939b82e…e7016a87",
"draws": [3725],
"win": false,
"payoutBp": 0,
"timestamp": 1755000000,
"signature": "0x04065096…6dae6c1c"
}The roll was determined before you played.
The wheel spins on demand, not on a shared timer. Its seed was committed before your first spin, so every pocket was already decided.
Heads or tails, decided in advance.
The same protocol as the wheel, with two outcomes instead of fifteen.
Under or over, rolled in advance.
Pick a number and a direction. The roll was fixed before you pressed play.
Integrate the SDK, or verify with no Foreseer code at all.
The reference SDK, plain Python, or plain curl. The protocol is standard cryptography end to end.
import { dice, merkleProof, receiptDigest, toBytes } from "foreseer-sdk";
import { ReferenceTee } from "foreseer-sdk/reference";
import { verifyCommit, verifyMerkleProof, verifyOutcome, verifyReceiptSignature } from "foreseer-sdk/verify";
const tee = new ReferenceTee();
const { seedCommit } = tee.openEpoch();
const rule = dice({ target: 4999, mode: "over" });
const bet = tee.play({ clientSeed: "alice", rule });
console.log("rolled", bet.receipt.draws[0], bet.receipt.win ? "win" : "lose");
const signatureOk = verifyReceiptSignature(bet, tee.domain, tee.teeId).ok;
const { serverSeed, merkleRoot } = tee.closeEpoch();
const digest = receiptDigest(bet.receipt, tee.domain);
console.log({
signature: signatureOk,
commit: verifyCommit(serverSeed, seedCommit),
outcome: verifyOutcome(bet.receipt, rule, serverSeed).ok,
merkle: verifyMerkleProof(digest, merkleProof([digest], 0), toBytes(merkleRoot)),
});rolled … a fresh epoch seed each run { signature: true, commit: true, outcome: true, merkle: true }
One bet, four moments, six checks.
Commit, play, reveal, anchor. Four of the six checks run in your browser; two are onchain reads.
Six checks. Four run right here. Paste a receipt or load the golden example; nothing you paste leaves the page.
Open the verifierAttested compute, anchored on Flare.
The outcome engine runs as a Flare Confidential Compute extension. You never trust our servers, you trust the attested image and the chain.
- ATTESTFlare's registry binds the TEE identity to a measured code image.
- EXECUTEBets resolve inside the enclave and are signed with its identity key.
- ANCHOREvery seed commitment and Merkle root lands on Coston2.

Plug in your service, pay per play.
Foreseer is one layer of your stack: the outcome engine. You keep the players, the funds, and the front end. Usage is metered per operator, and fairness is enforced by the protocol.
Register your rules. Games are JSON documents. Dice and coinflip ship as presets; the grammar covers the games you invent.
Open epochs, pay per play. openEpoch carries the fee, split between treasury and your operator balance. Billing meters every play.
Stake an operator bond. OperatorBond backs honest operation onchain, with delayed withdrawals and slashing.
Six steps to your first bet.
Your wallet is who you are. One key runs your backend. The chain moves the money.
- 01SETUP
Get your key
Bound to your wallet. Shown once.
- 02FUND
Top up
Pay the treasury, post the tx hash.
- 03BUILD
Register a rule
A preset, or JSON you wrote.
- 04PLAY
Call play
One request per bet.
POST /play - 05SETTLE
Pay the winner
Check the signature first.
payoutBp - 06WATCH
Open the dashboard
Same wallet, one signature.
Three credentials, three jobs
NONE OF THEM DOES ANOTHER JOBx-api-keyPlay bets, spend prepaid balance
- Withdraw a single wei
- Change your owner wallet
- Open your dashboard
wallet signatureRead balance, deposits, every play
- Expire into a support ticket
- Be stolen from our database
onchain transferFund your balance from your wallet
- Arrive from another address
- Be credited twice
Your questions, probably
Foreseer makes outcomes tamper evident, not magically fair. The TEE necessarily knows outcomes during an epoch. What protects you is that its code is attested by Flare, its seed was committed before your bet, and every receipt is recomputable by anyone after the reveal.
The server is untrusted for fairness. Every artifact it hands out is TEE-signed and player-recomputable, and the honest path is client-side: fetch the epoch, the rule, and the proof, then run the checks yourself. The server cannot lie to code it does not run.
Only as far as Flare attestation: the registry binds the TEE's identity address to a measured image, and that address is what every signature check expects. Even if the enclave were broken, the commitment scheme still exposes tampering after the fact; what weakens is pre-reveal secrecy, not verifiability.
Not yet, and the difference matters. The Go engine, the attested image, and the contracts are real: the golden epoch is committed, anchored, and proof-verified on Coston2, and the extension is registered. But no Confidential Space VM is attached yet, so there are zero active TEE machines, and the reference server generates and stores epoch seeds itself, which it says plainly in its own code and README. Onchain anchoring is a manual step today, not an automated one. None of the verification math changes when the enclave is attached; what changes is who holds the seed.
Yes. Rules are JSON data, not code: draws, comparisons, and, or, not, and mod, hashed canonically into every receipt. Dice and coinflip ship as presets; the docs build a three-card matching-ranks game from the same grammar. No implementation ever runs operator-supplied code.
Keep the receipt: it is cryptographic evidence. A signature or outcome mismatch on a genuine receipt means the operator, the TEE image, or the data path misbehaved, and the receipt plus the anchored epoch is exactly what you show the world.
Receipts are published per epoch so anyone can audit them, and your clientSeed appears in yours. If you want your bets unlinkable across sessions, use a fresh clientSeed each time; the SDK ships generateClientSeed() for exactly this.
No. All read endpoints are public, and the browser widget runs entirely locally: nothing you paste leaves the page. Recomputing a roll by hand needs only a standard HMAC library.
Coston2, Flare's public testnet, chain id 114. Contracts are deployed and the golden epoch is committed, anchored, and proof-verified over public RPC; extension registration in the Flare registry is the remaining step.

