# BlitzChips — agent play on eCash > BlitzChips is a provably fair dice game on eCash (XEC). Agents play by sending > real on-chain bets to a single game address. Every valid bet receives a payout > transaction carrying a ROLL message while the game server is up. There is no > off-chain simulation API — throughput is limited only by Chronik broadcast and > the game server. - Site: https://blitzchips.com - Human docs: https://blitzchips.com/llms - This file: https://blitzchips.com/llms.txt - Provably fair: https://blitzchips.com/#provably-fair ## Game address ``` ecash:qqkczljwm2wnyld7lm9x5hjkev2z65mqdcz6544y9c ``` Send bets to this address. Payouts always originate from it. ## Server websocket Bets are processed only while the game server's Chronik websocket is up. If that websocket is down, the server is down and bets are not being processed. Do not broadcast bets until payouts are flowing again. A bet that lands while the server is down is not rolled and is not paid until an operator catches up by hand. ## Play tokens Do not send FIRMA (`0387947fd575db4fb19a3e322f635dec37fd192b5941625b66bc4b2c3008cbf0`). FIRMA bets are not accepted. A FIRMA stake that lands is an invalid bet: it is not rolled and it is not refunded. The house keeps it. That includes a transaction that also sends BLITZ or CACHET. | Token | Token ID | Encoding | Notes | |-------|----------|----------|-------| | BLITZ | `d1952270af59eb0ae6b07c6ff93c19e1b3ff53fd0595d2ca6f239c55d4b3fd69` | ALP EMPP DICE | No house edge | | CACHET | `aed861a31b96934b88c0252ede135cb9700d7649f69191235087a3030e553cb1` | SLP P2SH input data | No house edge | | XEC | native | OP_RETURN DICE | ~3% house edge (reduced by BLITZ balance) | A stake outside the limits below is not rolled and is not refunded. The house keeps it. Always keep extra XEC for fees. ## Limits These match the site. The bet input is clamped to the max for the selected range. A stake above that max is not rolled and is not refunded. - Winning numbers: 100 to 95,000,000 for BLITZ and CACHET. 273 to 95,000,000 for XEC. 95,000,000 numbers is 95% odds. - BLITZ hard ceiling: 50 BLITZ (500,000 atoms). That ceiling is the coinflip maximum (2x, 50,000,000 numbers, about 0.0002 to 50). - Below 50% odds the stake max is lower. Max atoms = 1,000,000 × winning numbers / 100,000,000, and never above the 50 BLITZ ceiling. A 3x range (33,333,333 numbers, for example 66,666,668–100,000,000) accepts at most 333,333 atoms (33.3333 BLITZ, shown as 33). A 50 BLITZ stake on that range is invalid. - The tightest allowed BLITZ range (100 numbers) accepts 0.0001. - CACHET: up to 5,000.00, and the same atom cap. The 100-number floor accepts 0.01 CACHET. - XEC: about 5.46 to 500,000. A win pays at most 2,000,000 XEC. - A token win pays at most 1,000,000 atoms (100.0000 BLITZ or 10,000.00 CACHET). - XEC uses about a 3% edge, reduced by BLITZ balance, floored at 1%. BLITZ and CACHET pay with no edge. The stake floor still uses the 3% rule. ## Libraries (Bitcoin ABC / eCash) Install from npm. Source lives in the Bitcoin ABC monorepo. | Package | npm | Source | |---------|-----|--------| | `ecash-wallet` | https://www.npmjs.com/package/ecash-wallet | https://github.com/Bitcoin-ABC/bitcoin-abc/tree/master/shared/ecash-wallet | | `ecash-lib` | https://www.npmjs.com/package/ecash-lib | https://github.com/Bitcoin-ABC/bitcoin-abc/tree/master/shared/ecash-lib | | `chronik-client` | https://www.npmjs.com/package/chronik-client | https://github.com/Bitcoin-ABC/bitcoin-abc/tree/master/shared/chronik-client | ```bash pnpm add ecash-wallet ecash-lib chronik-client ``` Use a dedicated agent mnemonic. Derive with `Wallet.fromMnemonic` (`m/44'/1899'/0'/0/0` — same path Cashtab uses). Never use the house wallet. ## Chronik Public Chronik HTTP endpoint: ``` https://chronik.e.cash ``` ```ts import { ChronikClient } from 'chronik-client'; import { Wallet } from 'ecash-wallet'; const chronik = new ChronikClient(['https://chronik.e.cash']); const wallet = Wallet.fromMnemonic(process.env.AGENT_MNEMONIC!, chronik); await wallet.sync(); ``` ## Bet messaging (DICE) A valid bet includes a DICE payload: ``` ``` - `minValue` / `maxValue`: inclusive winning roll range, each in `1..100_000_000` - Odds ≈ `(max - min + 1) / 100_000_000` (before house edge) - BLITZ: attach as ALP EMPP `DATA` push with the token SEND - CACHET: encode as P2SH input data on the SLP SEND - XEC: put DICE on an OP_RETURN output; send XEC to the game address - FIRMA: do not send it. The bet is invalid ## Payout messaging (ROLL) Every valid bet gets a payout tx from the game address: ``` ``` - Win (`W`): payout in the wagered asset (BLITZ / CACHET / XEC) - Loss (`L`): small BLITZ consolation (loyalty token) - The codec still accepts a reserved `I` byte. The server does not emit it and does not refund an out-of-limit stake. Agents should **not** rely on a game websocket. Subscribe to the **player** address on Chronik, decode ROLL from OP_RETURN (or CACHET input data), and match `bet_txid` to bets you broadcast. ## High-throughput play pattern BlitzChips is built for chained bets. Do not sync between every tx. 1. `wallet.sync()` once. 2. Build N dependent bet txs in memory. Each `wallet.action(...).build()` updates the local UTXO set (spends removed, change added) so the next bet chains off the previous change output. 3. Broadcast with `chronik.broadcastTxs(rawTxs)` in batches (e.g. 50). 4. Collect results from Chronik WS / history on the player address until all `bet_txid`s have a matching ROLL, or idle timeout. ### Build a BLITZ EMPP bet (example) ```ts import { Wallet } from 'ecash-wallet'; import { Script, ALP_TOKEN_TYPE_STANDARD, toHex } from 'ecash-lib'; const BLITZ_TOKEN_ID = 'd1952270af59eb0ae6b07c6ff93c19e1b3ff53fd0595d2ca6f239c55d4b3fd69'; const GAME_ADDRESS = 'ecash:qqkczljwm2wnyld7lm9x5hjkev2z65mqdcz6544y9c'; // diceEmppBytes = encode DICE lokad + version + minValue + maxValue (see above) const built = wallet .action({ outputs: [ { sats: 0n }, { sats: 546n, script: Script.fromAddress(GAME_ADDRESS), tokenId: BLITZ_TOKEN_ID, atoms: wagerAtoms, }, ], tokenActions: [ { type: 'SEND', tokenId: BLITZ_TOKEN_ID, tokenType: ALP_TOKEN_TYPE_STANDARD, }, { type: 'DATA', data: diceEmppBytes }, ], }) .build(); const rawTxHex = toHex(built.builtTxs[0].tx.ser()); const betTxid = built.builtTxs[0].txid; ``` ### Build an XEC OP_RETURN bet (example) ```ts import { Script, fromHex, toHex } from 'ecash-lib'; // opReturnHex includes the leading 6a (OP_RETURN) + DICE payload const built = wallet .action({ outputs: [ { sats: 0n, script: new Script(fromHex(opReturnHex)) }, { sats: wagerSats, script: Script.fromAddress(GAME_ADDRESS), }, ], }) .build(); ``` ## Reference agent source (not an npm package) `blitz-agent` is an unpublished reference CLI that implements the pattern above (sync once → chain builds → `broadcastTxs` → Chronik ROLL collector). Use it as code examples when scaffolding your own agent; copy the approach, not a private dependency. Key ideas from that source: - Derive with `Wallet.fromMnemonic(mnemonic, chronik)` - `build()` chains UTXOs without re-sync - Results from player-address Chronik, never a game websocket - Strategies: coinflip (~50%), low-odds, high-odds ranges - Optional rotate across BLITZ / CACHET / XEC when all are funded - Do not rotate onto FIRMA. Those bets are invalid ## Provably fair Rolls are deterministic from: ``` SHA256(SHA256(bet_txid + tx_size + server_seed)) → RNG → roll in 1..100_000_000 ``` Server seed hashes are published daily and revealed after 72 hours: https://blitzchips.com/#provably-fair ## Agent checklist 1. Confirm the game server's Chronik websocket is up. If it is down, the server is down and bets are not being processed — stop. 2. Create a throwaway BIP39 mnemonic; fund with play tokens + XEC for fees. 3. Point Chronik at `https://chronik.e.cash`. 4. Build DICE bets with `ecash-wallet` + `ecash-lib`. 5. Broadcast batches; wait for ROLL payouts at your address. 6. Summarize win rate / P&L from matched `bet_txid`s. ## Links - Play: https://blitzchips.com - LLMs page: https://blitzchips.com/llms - llms.txt: https://blitzchips.com/llms.txt - eCash: https://e.cash - Bitcoin ABC: https://github.com/Bitcoin-ABC/bitcoin-abc - Cashtab (human wallet): https://cashtab.com