uint per bomb, which gives
biased placement, O(N) cost per click, and a packing cap that limits board size.
How it keeps the board secret
- The board is an elist of
ebool, length N squared. One entry per tile,truemeans bomb. - Bombs are placed with a single
shuffle. That gives a uniform distribution in one Inco op, with no per-bomb bias. - Each click is O(1).
e.getEbool(board, pos)reads one cell instead of scanning every bomb. - A sticky encrypted accumulator tracks the whole game.
ebool everHitBombis updated withe.oron every pick, so cashout verifies exactly one attestation no matter how many tiles the player opened.
The flow
attestedReveal (no signature needed), and the contract verifies
the covalidator-signed attestation at cashout. The player sees one wallet popup
per pick and one at cashout.
Contracts
Solidity 0.8.30,
@inco/lightning and @inco/lightning-js at 1.0.2. EList is
built into core as of v1.
Running it
The repo has a Hardhat contracts side and a Next.js frontend. It runs against Base Sepolia testnet or a fully local Inco node.Lightning.localNode("mainnet") to point the SDK at the local node. The
mainnet pepper matches the local image executor. Node 22 LTS is pinned;
Node 25+ breaks wagmi connectors during SSR.
Honest limitations
This is a testnet build with two things to know before real money.- The factory must hold enough ETH to cover the max payout of every active game. Mines multipliers explode at higher mine counts, so a 5 by 5 board with 5 mines needs about 53 ETH in reserves per 0.001 ETH bet. Boards with 7 or more mines are effectively unusable on testnet.
- After the timeout fix,
expireGamerefunds the bet on timeout. That is correct for a winning player who could not cash out in time, but it also refunds a player who hit a bomb and walked away. A real product would require an attestation proving no bomb was hit before refunding.
docs/plans/.