# Turetzky's Game of Life Source: https://gaskiller.xyz/life Fully on-chain · settled by Gas Killer Sepolia testnet This contract counts all 8 neighbours of all 4,096 cells in Solidity. One generation costs 16.6M gas, which is 98.8% of the most any single Ethereum transaction is allowed to use. Two generations need about 33M gas, which no single transaction can hold. Gas Killer runs the same code off-chain and writes the result in one small transaction, so here you can run either. What is the Game of Life? The mathematician John Conway invented the Game of Life in 1970, and Martin Gardner's column in Scientific American made it famous. It's called a game, but nobody plays it. You set up a starting pattern on a grid, and simple rules decide everything that happens after that. The rules Every square on the grid is a cell, and each cell is either alive or dead. At every step, called a generation, each cell looks at its eight neighbours: A live cell with two or three live neighbours survives. A live cell with fewer than two live neighbours dies, as if from loneliness. A live cell with more than three live neighbours dies, as if from overcrowding. A dead cell with exactly three live neighbours comes to life. All cells update at once, so the whole board moves forward together, one generation at a time. Why people care Those four rules produce behaviour nobody would guess from reading them. Some patterns sit still forever. Some blink back and forth. Gliders crawl across the grid diagonally, and "guns" fire out a new glider every few generations. Researchers have built logic gates, memory and even whole computers out of Life patterns, which proves the game can compute anything a normal computer can. This board The board here is 64 × 64 cells, and its edges wrap around. A glider that leaves the right side comes back on the left. It started with four gliders heading in different directions and an R-pentomino in the centre. That five-cell shape looks harmless, but it keeps changing for about 1,100 generations before it settles down. The whole board lives in contract storage, and every generation is computed by the contract's own Solidity code. Counting the neighbours of all 4,096 cells is exactly the kind of heavy, repetitive work that makes this contract so expensive to run as a normal transaction. What is Gas Killer? Gas Killer makes smart contracts cheaper to run without rewriting them. Gas Killer's operators simulate a transaction off-chain and write back only the storage changes it produces. On-chain, the contract checks one aggregate signature from the operators and applies those changes. Heavy computation turns into a single signature check. Why teams use it Up to 99% gas savings. Cost depends on how much storage changes, not how much computation runs. This demo settles for under 1% of what the same step costs as a normal transaction. One line of Solidity. Inherit the Gas Killer SDK. No new language, no re-architecting, no app-specific rewrite. Verifiable. Results are signed by the operator quorum and checked on-chain. Operators who return incorrect outputs are rejected and slashed. Never a bottleneck. If the network is unavailable, transactions fall back to executing on-chain as normal. Past the gas limit. Computation that doesn't fit in a transaction or a block can still settle on-chain. Use cases On-chain AIRun model inference inside a contract. On Sepolia, Gas Killer already serves a Qwen language model and a complete fruit-fly brain connectome that sets the fee on every swap of an AMM. Bigger than the gas limitExecute transactions that can't fit in one transaction or even one block, like the two-generation button on this page. Zero-knowledge proof verificationProof checks are expensive for everyday users. Against 400 historical RAILGUN transactions, Gas Killer saved 40.9% on shields and 53.9% on transacts. Case study ↗ VaultsRe-check every invariant across every position on each deposit or withdrawal, instead of trusting a cheap partial check. Oracles and dataSort, aggregate and take medians over large sets of observations on-chain. Games and simulationsAutonomous worlds, physics and cellular automata like this one, stepped by the contract itself. The rule of thumb: if a transaction does a lot of computation but changes a small amount of storage, Gas Killer can make it much cheaper, or make it possible at all. Integrate Gas Killer The contract side is one import and one modifier. You keep writing normal Solidity: the expensive function stays in your contract as the reference implementation, and Gas Killer's operators run it off-chain for you. This Game of Life is exactly that pattern: step() is the tracked function. 1. Install the SDK forge install gas-killer/solidity-sdk Add the remapping gas-killer-sdk/=lib/solidity-sdk/src/ and set evm_version = "cancun" in your foundry.toml. 2. Inherit and mark the expensive function import {GasKillerSDK} from "gas-killer-sdk/GasKillerSDK.sol"; contract Counter is GasKillerSDK { uint256 public total; constructor(address avs, address schnorrRegistry) { _setAvsAddress(avs); _setSchnorrRegistry(schnorrRegistry); } // Too expensive to run on-chain? Mark it trackState. function recompute(uint32 rounds) external trackState { uint256 acc = total; for (uint32 i = 0; i < rounds; i++) { acc = uint256(keccak256(abi.encode(acc, i))); } total = acc; } } verifyAndUpdate, stateTransitionCount() and the transition guard all come from the base contract. Nothing else to write. 3. Deploy against the live operator set forge create src/Counter.sol:Counter \ --rpc-url "$RPC_URL" --private-key "$PRIVATE_KEY" \ --constructor-args 0x0eF3c25243004C0F81Dc678c3411E619D61577ef \ 0x8A86301675ac9617895117afFE9577f5154555F9 These are the current Sepolia AVS and Schnorr registry addresses. Always confirm them on the Configuration page before deploying. 4. Submit a task, then send the result // Ask the operators to run recompute(1000) off-chain const { task_id } = await gk("POST", "/tasks", { body: { target_address: COUNTER, call_data: [...Buffer.from( encodeFunctionData({ abi, functionName: "recompute", args: [1000] }).slice(2), "hex")], transition_index: "auto", from_address: account.address, value: "0x0", block_height: Number(await client.getBlockNumber()) - 2, }, }); // Poll until the quorum has signed, then submit the payload let task; do { task = await gk("GET", `/tasks/${task_id}`); } while (task.status !== "ready"); await wallet.sendTransaction(task.payload); // one cheap verifyAndUpdate Run this server-side (Node) so your API key stays secret. gk() is a small fetch wrapper that sends it as Authorization: Bearer gk_… to https://testnet.gaskiller.xyz. The router never holds your keys or funds: you submit the signed transaction from your own wallet. Good to know Gas Killer fits functions that compute a lot but change little storage. The cost of settling depends on how many storage slots change. The SDK is experimental and unaudited. It runs on Sepolia today. You need a Gas Killer API key to submit tasks. Sign up and request one from your dashboard. Generation… Alive Just born Just died Dead Highlights appear when a new generation lands Same transaction, two ways Bars are scaled to the per-transaction gas cap (16,777,216 gas, EIP-7825), shown as the red line. Normal transaction16,573,354 98.8% of the per-transaction cap and 27.6% of a whole Sepolia block. It only just fits. —less gas —normal tx at today's mainnet gas price —with Gas Killer at the same price What happens when you click 01 Request Our server asks the Gas Killer router to run step(1) or step(2) on the OnchainLife contract. 02 Compute off-chain Gas Killer's operators each execute the real contract code against Sepolia state. That's the 16.6M gas of work, done without a gas limit. 03 Sign the diff The whole board is only 16 storage words. Operators sign that storage diff, and their signatures are aggregated into one quorum signature. 04 Verify and write One verifyAndUpdate transaction checks the quorum signature on-chain and writes the 16 words. The cost depends on how much storage changed, not how much compute ran. Recent generations GenStepsGas usedWhenTransaction Loading…