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

Fairdice Protocol v0.3 : Game Specific : User-Client

[Definition]
GAME_MESSAGE = "G " GAME_STR " | P " PROTOCOL_STR
GAME_STR = LINK_ID " ^ " GAME_ID
; this identifies the particular game instance being played
PROTOCOL_STR = GAME_INIT | GAME_RAND | GAME_GENR | GAME_VERI
; these stages must be played in order, each sequence happening once.
See also basic definitions and the definitions section of Game_CS.
Stage Initiator Description
GAME_INIT User Initialise the game.
GAME_RAND Client The client decides to play and provides their random input
GAME_GENR Client Once the server has everyone's input, generate the output
GAME_VERI Client Once the server announces the output, verify it is fair

Stage : Initialisation

[Definition]
GAME_INIT = INIT_REQUEST | INIT_RESPONSE | INIT_MODULO
INIT_REQUEST = "join request"
INIT_RESPONSE = "join respond " JOIN_ANSWER
INIT_MODULO = "modulo " MODULO
JOIN_ANSWER = "yes" | "no"

[Sequence]
There are two valid sequences.
  1. user to client : INIT_REQUEST
  2. client to user : INIT_RESPONSE (negative)
or
  1. client to user : INIT_REQUEST
  2. client to user : INIT_RESPONSE (positive)
  3. client to user : INIT_MODULO

Stage : Randomisation

[Definition]
GAME_RAND = RAND_ID
RAND_ID = "id " PLAYER_ID

[Sequence]
There is one valid sequences.
  1. client to user: RAND_ID

Stage : Generation

[Definition]
GAME_GENR = GENR_SIZE
GENR_SIZE = "size " GAME_SIZE

[Sequence]
There is one valid sequence.
  1. client to user : GENR_SIZE

Stage : Verification

[Definition]
GAME_VERI = VERI_OUTCOME | VERI_FINISH | VERI_CLOSING | VERI_CLOSED
VERI_OUTCOME = "outcome " OUTCOME
VERI_FINISH = "finish " ( "fair" | ("fail " DISPLAY_STR) | ("fraud " DISPLAY_STR) )
VERI_CLOSING = "closing"
VERI_CLOSED = "closed"

[Sequence]
There is one valid sequence.
  1. client to user : VERI_OUTCOME
  2. client to user : VERI_FINISH
  3. client to user : VERI_CLOSING
  4. client to user : VERI_CLOSED
however be aware:

Either side can send VERI_CLOSING at any stage of a game. If it is sent before stage VERI, it cancels the game, triggering a VERI_FINISH (fail) being sent to everyone.


(
TOP)(UP)