Project Fairdice
[Home] [Docs] [Users] [Gaming] [Crypto] [Devel] [Download] [Help]

Architecture : Applications

  1. Playing a Game Without Fairdice
  2. Playing a Game With Fairdice
  3. The Four Roles
  4. User Application
  5. Client Application
  6. Server Application
  7. Host Application

Playing a Game Without Fairdice

Lets examine the current way online casinos work by looking at what happens when an example user, Pete Bloggs, plays a game with an online casino, www.fatcat.com. The situation is: The user application might turn out to be a web applet rather than something explicitly downloaded, but the principle is the same: either way Pete does not get to see the code responsible for producing the supposedly random number.

Playing a Game With Fairdice

But suppose PeteBloggs wants to play at LuckySaloon.org who are Fairdice enabled. How do things differ?

The Four Roles

There are four roles: User, Client, Server and Host. In practice it may turn out that some of these roles get merged into a single application. For example The server app functions might get built into the host app. If the user app is open source, then it might build in the client app. However, for design purposes, we can assume that each role will correspond to a seperate application:
App Machine Source Function
User Player Closed Game Logic, Graphics Display, Player Finances
Client Player Open rolling dice (collaborative fair event selection)
Server Casino Open rolling dice (collaborative fair event selection)
Host Casino Closed Game Logic, Player verification, Casino Finances
So, for instance, using a bridge tournament as an example:

User Application

Symbol
U
Source
Closed
Origin
http://www.luckysaloon.com/downloads/dicegame/user.exe
Location
ns38482.dial.pipex.com c:\Program%20Files\LuckySaloon\DiceGameApp\user.exe
Responsibilities
- Draw the pictures of cards on the screen
- Understand the rules of the game.
- Let the player choose which card to play
- Talk directly to the Host app or to the User apps of other players to let them know what card the player chose.
- Talk to the host app to find out which cards the player has been dealt.
- At the end of each game, talk to the client app to verify the deal was fair.
Connections
User:Client (many:one) (port 22100)

Client Application

Symbol
C
Source
Open
Origin
http://fairdice.sourceforge.net/downloads/client.zip
Location
ns38482.dial.pipex.com c:\Program%20Files\Fairdice\client.exe
Responsibilities
- Provide user input to the server app to help it generate the outcome.
- Verify that the outcome generated by the server used the user's input.
- Write its conclusions to a logfile, or otherwise provide a way for the player to check the result independantly of the closed source user app
Connections
User:Client (many:one) (port 22100)
Client:Server (many:many) (port 22200)

Server Application

Symbol
S
Source
Open
Origin
http://fairdice.sourceforge.net/downloads/server.zip
Location
www.luckysaloon.com /usr/local/fairdice/bin/server.exe
Responsibilities
- Listen when the host app says what size random number to generate
- Deal the cards (ie come up with a random number between 0 and 52!-1)
- Listen to the Client apps and verify back to them the deal was fair.
Connections
Client:Server (many:many) (port 22200)
Host:Server (many:one) (port 22300)

Host Application

Symbol
H
Source
Closed
Origin
www.luckysaloon.com /home/dicegame/devel/host.c
Location
www.luckysaloon.com /home/www/22400/cgi-bin/host.exe
Responsibilities
- Tell which players to play againt which other players in each round
- Keep track of which players won each game
- Get the deal from the server and tell each player only the cards they get.
Connections
Host:Server (many:one) (port 22300)


(
TOP) (UP)