Inspiration

Our motivation for this project is to build a simple game that will allow both Web3 and Web2 users to start using Aleo.

We decided to build several fun and simple casino games in a telegram bot using Emojis. Telegram has 55.2 million daily active users and is extremely popular among crypto users. To interact with a bot, no wallet or gas is needed - a user is given a daily allowance of “play” tokens to gamble. Our goal is to involve a user with the Aleo ecosystem rather than profit from a user.

Our bot has no effect on the outcome of the games - the outcome is solely determined by Telegram servers. Because a user doesn’t need to deposit any token to start playing and has nothing at stake, the trust assumption that Telegram random number generator is not rigged doesn’t have any economic impact. In other words, we can assume that there is little to no incentive for Telegram servers to cheat.

What it does

Our project is live and available to anyone to try. The user interacts with the app in the following way. A user adds our bot https://t.me/BetAleoBot and clicks start.

The following commands are available to a user:

/start - Initiates the bot and welcome message. /games - Displays a list of games. /set_bet - Sets the bet amount. /profile - Shows your profile incl. turnover, bets placed, balance and registration /cash_out - Withdraws funds.

By sending the /games command, a user sees 5 games. Initial balance is 100 “crystal tokens” (play money). To start a game, a user just clicks on the game, e.g. “dice” or “slot machine”.

After playing some games, a user can withdraw using the “/cash_out AMOUNT” command. For example, to withdraw 10 tokens, send the “/cash_out 10” command. A user will be given a link with a digital signature signing the amount and a random nonce. This link needs to be open on a desktop browser.

The withdrawal page requires the Puzzle wallet installed. If it’s not installed, a user will be prompted to install it.

Use cases

Our app can help Aleo protocols, DAOs and communities onboard new users by distributing small amounts of tokens to their potential users. Obviously, it is also possible to create a profit-making casino game, in which there will be deposits and the house will have an edge.

How we built it

We built it using Telegram Bot API, Leo, React, Node.js, Rust, AWS Lambda and deployed it to Aleo Testnet and Digital Ocean VPS.

Below is a table displaying the multipliers for different outcomes in six games we support:

Dice (🎲)

Outcome 4: Multiplier 2 Outcome 5: Multiplier 2 Outcome 6: Multiplier 2 Football (⚽)

Outcome 3: Multiplier 1.5 Outcome 4: Multiplier 1.5 Outcome 5: Multiplier 1.5 Basketball (🏀)

Outcome 4 (not a direct basket): Multiplier 1.5 Outcome 5 (direct basket): Multiplier 2.5 Darts (🎯)

Outcome 4: Multiplier 1 Outcome 5: Multiplier 1.5 Outcome 6: Multiplier 3 Bowling (🎳)

Outcome 5: Multiplier 0.5 Outcome 6: Multiplier 5 Slots (🎰)

Outcomes 2, 3, 4, 33, 49, 17, 27, 59, 42, 41, 11, 44: Multiplier 0.25 (🍸🍸, 🍋🍋) Outcomes 6, 23, 24, 54, 38, 21: Multiplier 0.5 (🍇🍇) Outcomes 16, 32, 61, 62, 63, 48: Multiplier 1 (7️⃣7️⃣) Outcome 1: Multiplier 3 (🍸🍸🍸) Outcome 43: Multiplier 5 (🍋🍋🍋) Outcome 22: Multiplier 10 (🍇🍇🍇) Outcome 64: Multiplier 20 (7️⃣7️⃣7️⃣) These multipliers represent the rewards for achieving specific outcomes in each game, with various symbols indicating different levels of success.

Challenges we ran into

We had issues with signing messages in TS/JS SDK, so we had to create a standalone AWS Lambda function in Rust.

Accomplishments that we're proud of

We believe that we came up with a very nice way to onboard users to the Aleo ecosystem - fun, easy and engaging.

What we learned

We learned how to build Telegram bots and sign messages in Rust so that they can be verified in Leo.

What's next for BetAleo

We would love to hear your feedback about our project and hope to improve it, making it a favorite small game for the Aleo community!

Built With

Share this project:

Updates