GoL2: An experiment in Layer 2 gaming

Yuki Labs
4 min readSep 20, 2022

We’re delighted to announce GoL2 (Game of Life 2) on StarkNet. An on-chain remix of the classic “Game of Life” by John Conway.

Yuki teamed up with StarkWare to explore on-chain gaming. We built GoL2 to explore how StarkNet computation can power web3 gaming.

What is the original Game of Life?

Mathematician and gigabrain John Conway created the game in 1970 while exploring cellular automaton. It consists of a grid of cells which, based on a few mathematical rules, can live, die or multiply. The initial pattern of cells activated in the game and any further cell interaction from users determines how the game progresses. The end result is turing-complete and can simulate a universal constructor.

We wrote more about the origins of the game on twitter.

Cool, so what is GoL2?

GoL2 is our tribute to a classic and an experiment in building games on StarkNet. We explore on-chain computation, how tokens can be used in-game and more. Interested to learn how we built it? Follow us on twitter @gol2io.

GoL2 retains the core mathematical rules of the original but experiments with how players interact with the game across two modes:

Infinite mode: a multiplayer, never ending game where any player can influence the direction of the game by giving life to cells and evolving the game until the end of time.

Creator mode: Games created by the community, the creator chooses any pattern they want to start the game. Choose carefully, once the game starts it can only be evolved by the community. No more cells can be given life!

GOL tokens

The game uses GOL tokens to influence gameplay. Players earn GOL tokens when they Evolve a game. Evolving a game moves the game forward, one step at a time. These GOL tokens can then be used to create their own games in Creator mode and to Give Life to cells in Infinite mode.

Snapshots: proof-of-play

Snapshots are moments in time of the Infinite game mode, each snapshot represents one generation of the game.

Evolve the infinite mode to claim yours!

The best way to learn? Go play → www.gol2.io

Why build on StarkNet?

Cheap on-chain computation.

As Ethereum takes its rightful place as the secure global settlement layer, it shifts the overwhelming demand on its blockspace to Layer 2’s. StarkNet is one such L2 that steps in to help scale Ethereum, performing computation on StarkNet and settlement on Ethereum.

The end result means computation is trivially cheap. Ethereum only needs to verify a single proof (with the magic of STARK proofs) and so doesn’t need to re-execute every individual transaction included.

Due to Ethereum’s gas costs, most blockchain games to date have limited their on-chain footprint. The gaming logic exists off-chain, often on trusted, centralized servers. StarkNet allows developers to make the game logic itself trustless and decentralized.

In GoL2, every single interaction within the game — the game logic itself — is verified on-chain, without breaking the bank. It’s a powerful demonstration of how compute-hungry dapps, that are impractical on L1, can thrive on L2.

Learn how we built GoL2

Follow us on twitter @gol2io. Over the coming weeks we will release a breakdown of how the game was built and open up repos so you can take a look. We’ll cover:

  • Cairo contracts
  • Indexer and database
  • The Application
  • Anything else you’d like to know? Ask on twitter @gol2io

Feedback

Have a feature idea? Spotted a bug? Let us know on our discussion board or ping us on twitter.

--

--