Battlerocketship, under the hood
The tour keeps it simple. Here is the real machinery, written to be readable by anyone, with deeper asides for those who want them. The same ideas power every game in the arcade.
Hashing
beginnerA hash function takes any data, a word, a file, a whole game board, and returns a short fixed-size fingerprint. These games use keccak256, which always returns 32 bytes (64 hex characters).
Three properties matter:
- Deterministic: the same input always gives the same hash.
- One-way: you cannot run it backward to recover the input.
- Avalanche: change one bit and the whole output changes.
Same input, same output, every time (deterministic). Change a single character and the whole result scrambles (the avalanche effect), and there is no way to run it backward. That is what makes a hash a tamper-evident fingerprint.
Merkle trees
beginnerHashing one thing gives one fingerprint. A Merkle tree fingerprints a whole collection into a single root, while still letting you prove any one item cheaply. You hash each item into a leaf, pair the leaves and hash each pair, then repeat until a single root remains.
Click any cell to see its proof rebuild the root:
To prove cell A is in the committed tree, you only reveal it plus two sibling hashes (not the whole board):
A tree of n cells needs only logβ(n) sibling hashes per proof (100 cells β 7).
The magic is the proof: to convince someone a single cell is part of the committed root, you reveal only that cell plus a handful of sibling hashes, never the whole board.
Commit and reveal
beginnerA commitment lets you lock in a secret now and reveal it later, with two guarantees:
- Binding: you can't change what you committed. Any change to the data changes the root.
- Hiding: the commitment (just a hash) reveals nothing about the data.
You publish the root up front. Later, when challenged, you reveal a specific piece plus its Merkle proof. The other side checks the proof against the root you already locked, so you can neither lie about it nor have changed it.
Signatures
deeperA digital signature proves a specific message came from a specific wallet, and nobody can forge it without that wallet's private key. The contract recovers the signer from the signature and checks it matches.
This is how a game can be settled with a single cheap transaction: the loser signs a short βI concedeβ message and the winner submits it. No private key ever leaves your wallet.
Soulbound tokens
beginnerMost NFTs can be bought and sold. A soulbound token (the ERC-5192 standard) is one that is permanently non-transferable: once minted to your address, it stays there forever.
That is exactly what you want for a trophy. With no resale market it carries no monetary value, so it is a pure proof of achievement, an on-chain record that you earned it, rather than something bought.
The honest part
The contract is open-source and covered by tests. We're upfront about the trust model:
- You can never lose your entry to a cheater. If someone stalls or commits a bad board, the game times out and both entries refund.
- A win is proven by the 17 collected ship-cell proofs. Full on-chain enforcement that a board is a legal fleet, and fraud proofs for mid-game stalling, are planned v2 work.
- The relay that carries moves is untrusted: it only forwards messages, which are verified against on-chain commitments and signatures, so it can't cheat.
Curious enough to read the source? The Solidity contract and tests live in the open-source repo. Same primitives, no hidden parts.