All guides
#games#chain-reaction#nostr#nip-29#kind-2390

Chain Reaction, played on a relay

Drop an orb, take a cell, and when a cell holds one orb too many it bursts into its neighbours, and their neighbours. Chain Reaction runs in an Obelisk channel with no game server; every client replays the same event log and reaches the same board.

4 min read
A cell going critical on a Chain Reaction boardA dark grid of cells holding red, lime and cyan orbs. One cell is bursting and sending an orb into each of its four neighbours, the cascade that gives Chain Reaction its name, played over a Nostr relay in Obelisk.One orb over the limitevery neighbour takes one,and may burst in turnkind 2390 {"op":"move","cell":11}the cascade is replayed,never publishedseat 1seat 2seat 3

The rules, in four lines

  • Click a cell that is empty or already yours. It gains one orb.
  • A cell bursts when it holds as many orbs as it has neighbours: 2 in a corner, 3 on an edge, 4 in the middle.
  • When it bursts, one orb goes into each neighbour, and every one of those cells becomes yours.
  • Bursting can make a neighbour critical too, so one click can roll across the board. Lose all your orbs after your first move and you are out; last player standing wins.

That is the whole game. It is small enough to explain in a sentence and deep enough that a corner you ignored for six turns eventually takes half your board.

Chain Reaction board in Obelisk: a 6×9 grid of dark cells holding glowing red, lime and cyan orbs, with a legend naming the three players and whose turn it is.
A three-player board, mid-game. Cells with two orbs on an edge are one click from going off.

Starting a table

Type /play in a channel, pick Chain Reaction, and choose a board size (small 5×7, medium 6×9 or large 8×12) and a turn clock. Creating the table publishes one event and posts a card into the channel. Anyone in the channel can hit Join on that card; when the roster looks right, the host hits Start.

The Obelisk "Pick a game" dialog listing Chain Reaction, Vesta and Stacker, each with a thumbnail, a one-line description, its player range and its turn clock.
/play in the composer. Everything in this list (names, player ranges, clocks) comes from the game registry, not from the screen.

Chain Reaction seats 2 to 8 players and defaults to a 45-second clock. If several seats are assigned to the same account, those players are sharing one keyboard: the board follows whoever is on move, and their moves are signed by the same key. Everyone else plays from their own client.

What actually crosses the wire

A move is one event. Not a board, not a cascade. A cell number:

{
  "kind": 2390,
  "tags": [
    ["h", "<channel-id>"],
    ["t", "obelisk-game"],
    ["op", "move"],
    ["e", "<table-id>", "", "root"],
    ["n", "17"]
  ],
  "content": "{\"n\":17,\"action\":{\"cell\":11},\"seat\":\"<seat-id>\"}"
}

Your client publishes that to the channel's relay, the relay hands it to everybody subscribed, and every client, yours included, runs the same reducer over the same log. The explosion you watch is your own machine replaying the cascade the rules imply. Nobody sends you a board, because nobody has a more authoritative one than you do.

Why a cheating client gets nowhere

Every client validates every move before applying it, so an event that breaks a rule is dropped everywhere at once. Concretely, a move is only applied when:

  1. it is signed by the account that controls the seat on move;
  2. it carries the current turn number n (a move published against a stale board fails here);
  3. the engine says the cell is legal (empty, or already yours).

Publishing an illegal move is not an exploit; it is publishing noise. Ordering is decided by (created_at, id), and the id is a hash, so two events landing in the same second break the tie identically on every machine. Nobody's clock skew reorders your match.

The turn clock without a server

There is no timer process anywhere. The deadline is derived from the log: the turn started when the last accepted event landed, and it expires turnTimeoutS later. Once that moment passes, any player may publish a timeout claim for that turn. Everyone else checks the claim against the same log and reaches the same verdict, so the first valid one is accepted and the rest are harmless duplicates.

Pick No clock and nothing enforces anything: a friendly table where somebody wanders off simply waits. That is a fair trade for a game with friends and a bad one with strangers.

When it ends

A player who has moved at least once and then loses every orb is eliminated. When one player is left, the table is finished and the card in the channel turns into a result.

Chain Reaction final standings in Obelisk: first place with a trophy and an orb count, second place marked out, under the heading "Final result".
The finished table, as it appears back in the channel.

The result is not a separate announcement anybody could forge; it is what the log says when you replay it.

What it does not protect you from

  • Privacy. Moves are plaintext on the relay, like the chat messages beside them. Chain Reaction has no hidden information, so there is nothing to leak; a game that did (poker, battleship) would need a commit-reveal scheme on top.
  • Someone who walks away from a no-clock table. See above.
  • Seat order. The host picks it, and turn order is a real advantage on a small board.
  • A player using an engine. Nothing here can tell a thoughtful human from a solver.

For the curious

The whole thing is kind 2390 events in the channel's group, replayed by src/lib/games/session.ts. The engine (chain-reaction.ts) is a pure function: no clock, no randomness, no mutation. That is the entire reason it can be trusted to a client. If you want the wire format op by op, it lives in docs/features/games.md.

Two Stacker wells trading garbage linesTwo ten-column wells of falling coloured blocks side by side. A completed line in the left well sends grey garbage rows into the right one: the only thing that crosses the Nostr relay in a real-time Obelisk Stacker match.Clear a line……and somebody else digsop: attack lines 3 · hole 6 Every board runs locally at sixty frames a second; only the consequences are published.

Stacker: real-time falling blocks over Nostr

the real-time one, where clearing lines buries somebody else

A Vesta island with dice derived from the event logA hexagonal island of forest, brick, wool, grain and ore tiles with numbered dice tokens and player settlements, beside the line of the Nostr event log the dice roll is derived from: nobody at the table rolls their own numbers.1058694Nobody rolls their own dicethe numbers come out of the event logentropy = 3f9c…a12 : 14 4 + 3 = 7…and every client derives the sameroll from the same log.

Vesta: settlements, trade, and dice nobody rolls

settlements, trade, and dice nobody rolls for themselves

How Obelisk worksOn a usual chat platform, your account, your data and the rules live on the company's server, between you and your community. In Obelisk you sign each message with your own key and it goes straight to your community's relay, a NIP-29 relay: Obelisk runs a public one, and anyone can run their own. The Obelisk app only signs and shows.A USUAL CHAT PLATFORMYoumessageThe company's serveryour account · your data · its rulesYour communityOBELISKYou, with your keysigned messageYour community's relayObelisk's relayor your ownYour communityUse Obelisk's relay or run your own: your community depends on no one.

How Obelisk works

why there is no backend to put a game server in