What is MoneyPot?
MoneyPot is a crypto casino where game developers can create their own games.
For players:
- Unique games created by independent developers
- Crypto deposits and withdrawals backed by Uniwire
For game developers:
- 50/50 profit share with the casino
- Build on top of our game server
Architecture
Users
Users register accounts on MoneyPot.com. They have an email address and they can deposit and withdraw crypto currencies to and from the casino.
Controllers
Users can create Controllers which are basically a type of programmatic bot with API access to its own balance and currency transfers.
A game server is a @moneypot/hub server that uses a controller’s API key to manage player balances and transfers across any number of experiences on the casino.
If you want to build a game server, see Controller dev
Experiences
An experience is a game frontend that’s tied to a single controller and an iframe URL.
Every experience on the casino has a url like /play/dan/dice
which renders a page that iframes the experience iframe URL: <iframe src="{iframeUrl}?userToken=<JWT>"></iframe>
.
The experience frontend then sends the userToken to its own hub server, and the hub server exchanges the userToken with the casino to authenticate the user.
When a player puts money into an experience, what’s really happening is that they are creating a transfer from their balance to the controller’s balance that’s tagged with the experience ID.
In a nutshell
User POV
Here’s how MoneyPot works in a nutshell from the player’s perspective:
- Player1 visits a user-created game like /play/dan/pachinko which iframes a game frontend that talks to a game server
- Player1 puts 100 HOUSE tokens into the game and now has a 100 token balance in the game
- Player1 plays the game and wins 50 HOUSE tokens
- Player1 withdraws 150 HOUSE tokens back to their casino balance
Game dev POV
Here’s that scenario from Dan’s perspective, a game developer:
Simple example
- Dan (user) creates a Controller
DanController1
(a bot with API access) - Dan extends our @moneypot/hub game server with custom game logic and database tables
- Dan creates a Javascript frontend
- Dan creates an Experience on moneypot.com with
DanController1
as its controller andhttps://dan-pachinko.example.com
as its iframe URL - Player1 visits the experience at
/play/dan/pachinko
, puts money into the game, and plays the iframed game.
More detailed example (Click to expand)
- Dan (user) creates a Controller named
DanController1
that can be thought of as a programmatic user with API access to its own balance - Dan launches his own instance of our @moneypot/hub game server at
https://dan-hub.example.com
and configures it to useDanController1
’s API key for moneypot.com.- Dan could create game-specific API methods, but he doesn’t have to since the hub server comes with a generic bet method.
- Dan creates a React frontend at
https://dan-pachinko.example.com
configured to usehttps://dan-hub.example.com/graphql
’s GraphQL API, and he builds the pachinko game frontend - Dan creates an Experience on moneypot.com with
DanController1
as its controller andhttps://dan-pachinko.example.com
as its iframe URL - Player1 visits
/play/dan/pachinko
which loadshttps://dan-pachinko.example.com?userToken=<JWT>
in an iframe. The pachinko frontend sends("https://moneypot.com", <JWT>)
to the hub server which responds that the user is authenticated. - Player1 uses the casino’s Put button to put 100 HOUSE tokens into the game
- Dan’s hub server sees that DanController1 received a transfer for 100 HOUSE tokens, it uses the casino API to claim the transfer, and then it credits Player1 with +100 HOUSE tokens in its own
hub.balance
database table - Player1 plays the game and wins +50 HOUSE tokens in the hub database.
- Player1 uses the casino’s “Take” button to request that pachinko’s controller (DanController1) send them 150 HOUSE tokens.
- Dan’s hub server sees the take request on the casino API and creates a transfer from DanController1 to Player1 on the casino.