Skip to content

Repository files navigation

Who's Your Guy? - Aleo Blockchain Edition

Introduction Welcome to "Who's Your Guy?" - an innovative social guessing game deployed using the Aleo Blockchain. Inspired by the puzzle gaming platform's "wheres_alex?", this game combines the excitement of social interactions with the security and transparency of blockchain technology. This README file provides essential information on the game, guiding you through the installation process and offering an overview of the game's features.

Your guy's name is hidden onchain from the other party, and the entire game is hidden from everyone on chain so you can bet as much as you want without judgement :)

Built with Puzzle Wallet & Puzzle SDK -- uses programmable private multisigs under the hood!

Puzzle SDK Docs: link

Puzzle Devtools Site: link

Puzzle Wallet Google Chrome Download link

Puzzle Wallet iOS Download link

About Who's your guy?

Who is your guy? is a fun experiment that aims to be a fun 1v1 game to showcase how to have a completely private multiparty game on Aleo! This technical overview reviews the issues with multiparty privacy and how this is solved using programmable private multisigs and incentives!


What is the " Who Is Your Guy? Game"

"Who Is Your Guy?" brings a fresh approach to social gaming. Picture this: hide a mystery person in a secret location within the Aleo Blockchain and challenge your friends to guess who it is. If they guess right, the prize pot is theirs; if not, you win the rewards. This game is not just about guessing; it's about strategy, deduction, and the unpredictable fun that comes with it.

So what's the point of the game?

Have fun with other members of the Aleo community, rack up some wins and rack up some puzzle pieces!

How does the game work?

The FE for the game utilizes key multisig features using the Puzzle Wallet and Puzzle SDK described below.

The game is split into 3 Leo Programs described below:

  1. my_puzzle_pieces token program (with n of n programmable multisig functions)
  2. Multiparty PVP utils program
  3. Who's your guy program

  1. Accepting a new game (opponent)
  • mint puzzle pieces if you don't have already
  • match wager from the challenger
  • accept the game and lock in the wagers to win if you guess correct!

  1. Finishing a game (challenger)
  • Reveal your answer
  • Finish the game and payout the wagers to you if the opponent guessed wrong or the opponent if they guessed right!

How Who's your guy showcases how to solve issues in multiparty privacy

Defining Multiparty Privacy

Multiparty privacy is a broad category and can be split into multiple categories based on use cases like:

  1. n:1
  2. 1:1:1
  3. n:n

n:1 multiparty privacy

One category of multiparty privacy is n:1 like a company's bank account


A company's bank account is multiparty and private -- n people have ability to view/share an account, everyone outside of those n people can't see the account balance, and it requires t approvals to do an action on one account.

1:1:1 multiparty privacy

Another category of multiparty privacy is 1:1:1 is like a game like Guess Who?


The users share a single game state that is multiparty while pieces of that shared game state are private to each individual.

Each player in the game has state that is private to themselves but needs to interactive with another player. The game state and individual private values may/may not be private to others outside of the two players, but each player wants to keep certain information private from the other.

image


The main issues with multiparty privacy

Multiparty privacy suffers from 3 problems

  1. Guarantees on privacy of data
  2. Guarantees on routing of information between parties
  3. Multiparty computation attacks: timeout, collusion, and denial of service

We can understand these problems specifically by looking at a game of online poker in web2.

image


1. Guarantees on privacy of data
The terms of service, the auditing by government, and the enforcement of law by the company's operating jurisdiction is the only guarantee you get that your hand is private to other players as well as the dealer. If you don't know or trust the brand/company, it's likely you won't feel the game is fair.

The most common complaint of online poker is that the game is rigged because other players or the house can see your cards somehow to know to increase wager or fold.

2. Guarantees on routing of information between parties
The terms of service, the auditing by government, and the enforcement of law by the company's operating jurisdiction is the only guarantee you get that your actions to up a bet, match wager, or fold is actually carried out. Again, if you don't know or trust the brand/company, it's likely you won't feel the game is fair.

Another common complaint of online poker is that the game lags or fails to record your action and folds your hand or matches your wager when you didn't want it to.

3. Multiparty computation attacks: timeout and denial of service
These attacks currently have no mitigation

  • if the online poker site shuts down, then you have no mitigation
  • if the opponent rage quits, then you have no mitigation
  • if players collude, you have no mitigation or recourse

These are the last most common complaints of an online poker game -- opponents will rage quit or the online poker service may fail/shut down mid game.


How Where's Alex solves the issues with multiparty privacy


1. Guarantees on privacy of data
In private/public ZKP blockchains like Aleo, your data is guaranteed to be private to other players in the game as long as they don't have your private keys and that the smart contract/program functions don't reveal your data to others.

This alleviates the concern that the game is rigged because you have guarantees your information is hidden from other players/house and you can verify yourself onchain.


2. Guarantees on routing of information between parties
Puzzle's SDK has operations to CreateSharedState and ImportSharedState that work with Puzzle Wallet to create multisig keys and import multisig keys for generating a place to send information to parties in a game. In private/public ZKP blockchains like Aleo, your information is recorded onchain and guaranteed to be available to anyone that runs or communicates with a node. Additionally, Puzzle wallet makes it easy for you to find your game state that's recorded on chain.


This alleviates the concern that your actions will be carried out and reach the other parties -- you can verify that it has been processed on chain.


3. Multiparty computation attacks: timeout and denial of service
The secret sauce of Where's Alex is solving the rage-quit, colllusion and denial of service problem with incentive engineering and game design.


This is done by forcing a challenger to commit a wager to a 2/2 multisig between the challenger & opponent when proposing a game. Once the opponent accepts the game and submits their guess -- the challenger's wager is locked and will be lost if the challenger rage quits or never reveals the answer. Importantly -- thanks to programmability of the multisig -- there are exit routes the challenger can take to retrieve their funds from the multisig if the opponent rejects or never responds so it's not stuck at the beginning as well. Because the game is a simple 1v1 -- we also don't have to worry about the collusion risk as well.


How Where's Alex works


Below we'll walk through the following:

  1. How the Where's Alex? game works at a high level with Leo programs, Puzzle Wallet, and Puzzle SDK
  2. How the Where's Alex? Leo programs work in depth

License This game is released under the MIT License.

Acknowledgments Special thanks to the puzzle gaming platform for inspiring this project and to the Aleo Blockchain community for their support

Walking through the Who is your guy Leo programs

Repo here

About

"Who's Your Guy?" brings a fresh approach to social gaming. Picture this: hide a mystery person in a secret location within the Aleo Blockchain and challenge your friends to guess who it is. If they guess right, the prize pot is theirs; if not, you win the rewards. This game is not just about guessing; it's about strategy.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages