Inspiration

We are game developers and we are trying to create a fully on chain game, which is driven by sequences of bitcoin tx.

What it does

There can be as many as possible players engaging in one room to compete in one Tetris game.

Each round, all players can send the 'action tx' to get the chance of actually trigger a new move. (one single move per player per round)

The host (the initiator) would pick 3 of the players who did send tx, and perform their actions one by one to the game area. Players sent tx but not chosen would have their tx back to the sending address.

Every action has bsv satoshis included, so every block in the game area has money in it. Having this in mind, once a player can make a full row of blocks, he can immediately get all money in the blocks of this row, and have this row vanished in game area.

For detailed description and rules of the game, please check out: https://github.com/mc-gulu/TetrisOnChain

How I built it

We used our production Bitcoin SV python library 'svlet' which helps invoking MAPI from three different parties: MemPool/MetaSV/WhatsOnChain, in this way, the system can be robust without worrying one of them being offline.

We also used 'operate' for layer-2 automation of the money dispatching logic. In this way, the automatically executed code (which is published in a tx being fully open-sourced and accountable)

Challenges I ran into

The availability of the third-party APIs. In order to make it fully on-chain, we formed better error-handling logic to have a more robust game.

Accomplishments that I'm proud of

It's the first fully on-chain game and driven by tx completely, which shows the bsv network capacities and possibilities in different aspects with strong evidences to game industry.

What I learned

A lot. Like how to build a fair-proven and verifiable randomness on chain.

What's next for TetrisOnChain

We will build the prototype into a product in coming months, no matter how it performs in hackathon, because we believe it will be a great multi-player endless game on chain.

Built With

Share this project:

Updates