Conway’s Game of Life is a fascinating zero-player game on a grid, whose evolution is determined by its initial state. Each generation is a pure function of the preceding one.
We implement the game on Bitcoin SV. Each generation evolves to a new generation when triggered by a bitcoin transaction. The game lives completely on chain. As long as there are transactions interacting with it, it lives on chain forever.
Rules
- Any live cell with fewer than two live neighbours dies, as if by needs caused by underpopulation.
- Any live cell with more than three live neighbours dies, as if by overcrowding.
- Any live cell with two or three live neighbours lives, unchanged, to the next generation.
- Any dead cell with exactly three live neighbours cells will come to life.
Implementation
The generation of the game is stored as the state of the contract. We show the part enforcing rules below. The complete contract can be found here.
Updates: 7/5/2021
How to create artificial life inside Bitcoin
Bitcoin script is Turing Complete: sCrypt’s ‘Game of Life’ is Proof