Gas Killer / life Sepolia testnet

Fully on-chain · settled by Gas Killer

Conway's Game of Life

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.

Generation …
  • Alive
  • Just born
  • Just died
  • Dead
  • Highlights appear when a new generation lands

No wallet needed. Gas Killer's relayer pays the gas.

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 transaction 16,573,354

With Gas Killer —

—less gas
—normal tx at today's mainnet gas price
—with Gas Killer at the same price

What happens when you click

  1. 01

    Request

    Our server asks the Gas Killer router to run step(1) or step(2) on the OnchainLife contract.

  2. 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.

  3. 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.

  4. 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…

One step before you run it

Enter your email to run the demo. You'll be subscribed to the Gas Killer newsletter, and you can unsubscribe any time.

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:

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

Use cases

On-chain AI Run 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 limit Execute transactions that can't fit in one transaction or even one block, like the two-generation button on this page.
Zero-knowledge proof verification Proof 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 ↗
Vaults Re-check every invariant across every position on each deposit or withdrawal, instead of trusting a cheap partial check.
Oracles and data Sort, aggregate and take medians over large sets of observations on-chain.
Games and simulations Autonomous 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