Yes, it's a game.
Not done yet, but will do!
Yes, we use it for on-chain randomness.
We use zk-proofs to prove the private state of our game, including proving we drew the correct card according to on-chain randomness, and that we correctly updated the merkle roots representing the player's hands and deck contents.
Not done yet, but will do!
0xFable is a trading card game in the style of Magic the Gathering, where players summon creatures to battle each other in a fight for survival.
The game logic lives entirely on-chain. This enables developers to fork the contracts and implement new game modes using the cards.
Developers can also create their very own card collections.
Because blockchains are transparent by default, we need to use zero-knowledge proofs to enable the private elements of the game. In particular, we need to hide the cards in the player deck's and hands, as well as ensure that cards are drawn randomly from the deck.
To do this, we implemented three ZK circuits:
proof of draw: proves that the correct card was drawn using on-chain randomness, and that the merkle roots commiting to a player's hand and remaining deck content are updated correctly
proof of play: proves that the player played a card that was indeed in his hand
proof of setup: proves that the player drew an initial hand of card according to on-chain randomness (basically an iterated proof of draw)
Our frontend allows players to create, join and play games. The art for the cards was AI-generated using MidJourney.
Video: https://www.loom.com/share/c5b6e1033a184ff681c727d811bfead3