A platform to play provably fair games using the Solana crypto currency as payment.
- Mines 💣
- Plinko ☄️
- Upgrade ⬆️
- Front End: React, motion framer, matter js, along with tailwind + daisy UI.
- Back End: Flask with Solathon to handle Solana transactions.
-
The player selects the number of hidden mine tiles (between 1 - 24) along with a bet amount. The higher the number of mines the higher the risk but higher the reward.
-
Whilst the game is in play the player has the oppurtunity to cashout at any point for the shown multiplier. (TODO - show multiplier)
-
Clicking on an unrevealed tile will either reveal a diamond or one of the hidden mines. A diamond increases the multiplier and the game continues but a mine and the player loses!
Multiplier cannot cross a threshold of 20x and begins with 0.97x
https://youtu.be/94ylCzrVY90?si=KvRA9yjZEf-13H3o - Was used to help determine this formula.
The most challanging of the three games made but I persevered and was the most rewarding to complete. This taught me the basics of matter js.
A now private youtube video from the creator Harkirat Singh FINISH OFF
For each ball dropped
I want to make it clear the system has not been thourughly tested and I have identified a few bugs and most likely vunreble to series of security flaws 😅 However I did want to try and implement my own basic authentication system as its not something I have done before and had fun learning how to do so!!
- The player is required to login before playing any of the games.
- Logging in generates a unique authentication token then stored in the browsers local storage.
- Logging back in re-generates this token and all communications to the back end require this authentication token to verify requests.
- All the logic is calculated in the backend.
I take advantage of the solathon library to handle all transactions on the Solana network.
- When a player creates an account, a new Solana key pair is generated to act as a deposit wallet.
- When a deposit is detected the USD value is accredited to the players balance and Solana tokens then transferd to house wallet.
- Withdraws can then be sent to specified address directly from the house wallet.
I chose to use Solana due to its low transaction cost, accesibility and high speeds.
Testing was done on the "Devnet cluster" (Solana tokens equate to no value) but can be swapped to the "main-net", although this would not be reccomended.
By using a provably fair system it allows players to independently verify the outcome of games played to ensure the outcomes wernt tamperd with.
I take advantage of the seeding function in the random python library. To create this seed 3 inputs are concatened together.
Server Seed: A secret value generated by the server, kept hidden from the player until after the game is played to prevent cheating.
Client Seed: A value provided by the player.
Nonce: A "number used once," which increments with each game played. This ensures that even if the server and client seeds remain the same between games, the outcomes will differ.
Each games seed is hashed and shown to the player using SHA512. The player can then choose to view the previousley secret server seed of a played game and concatinate this along side the known client seed and nonce, hash using SHA512 from there own source and arrive to the same value as shown to the player before the secret was revealed.
Using python version 3.6.5
- Add more games such as roullete
- Chat functionality
- Areas of the codebase need refactoring
- Move to on chain transactions
- Security
- Migrate to websockets
- Hash passwords before saving to the database
- Auto detect new deposits
- Monitor House wallet
- Config + ENV files