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

Cryptography : Example

These are the protocol parts from the messages making up a single game, from scenario:single.
Stage Function
Opening - opening the game
Initialisation - setting the parameters
Randomisation - getting the inputs
Generation - producing the output
Verification - checking for fraud
Closing - closing the game
This is the equivalent of two people rolling a six sided die, and it coming up showing the "1" face.

HOST   -> SERVER : P opening
  (game stage = OPENING)
SERVER -> HOST   : P opened
HOST   -> SERVER : P limit size 1
HOST   -> SERVER : P modulo 6
  (game stage = INIT)

USER   -> CLIENT : P join request
CLIENT -> SERVER : P join request
  (user status = CONNECTED)
SERVER -> HOST   : P join request DouglasR
HOST   -> SERVER : P join respond yes DouglasR
  (user status = ACCEPTED)
SERVER -> CLIENT : P join respond yes
CLIENT -> USER   : P join respond yes

SERVER -> CLIENT : P seed casino.reay.org:22300 ^ poker1 ^ 2000-01-01 00:00:01 ^ 30A1E54CA0FA4F75319C06D2AB628D728DC0B5C2C0B9083380A4B02971970FB45073187839E7CB8D891700BDE0BF68010AD93DAD88AC1563E1286971A854310A606B0044628DF0FD5EC133E1516170B4B1F7A5A4B6332C6C9E3899AF525BD45C ^ 

CLIENT -> SERVER : P digest reveal 881573D6EC1225DBB4A921C3236E395AED0234347C715CEE
  (user status = DIGEST)
SERVER -> CLIENT : P id 1
CLIENT -> USER   : P id 1

  (at this point the limit size 1 is met)
  (game stage = RAND)
SERVER -> HOST   : P size 1
SERVER -> CLIENT : P size 1
CLIENT -> USER   : P size 1

CLIENT -> SERVER : P digest request 0
SERVER -> CLIENT : P digest respond 0 A68C4580BF139CD9AF8C3BDDAF5A48DCE6E2DB363B8ADE1A  

CLIENT -> SERVER : P usertext reveal 68B91D90A15F0A6F9E8595AE277E9B397289747B8DF79B5240BEFF53B328A63AA5CA88168F6C6A46F05347A36A1746574E84213DCAC96173C6C622CB047B8A2706116A81E9D87E7AB6874DBDC616400A15AEB4B5A5FC675C69D7F32736C333D766221BB76AB7E41600CCF40701EABABBF45A1DCE82263345797745777B
  (user status = USERTEXT)

  (at this point the server has all the user texts)
  (game stage = GENR)
SERVER -> HOST   : P outcome 1
HOST   -> SERVER : P announce
  (game stage = VERI)
SERVER -> CLIENT : P outcome 1
CLIENT -> USER   : P outcome 1

CLIENT -> SERVER : P usertext request 0
SERVER -> CLIENT : P usertext respond 0 51044B284E9FE6F8973A8D9EB32AE9BE5C956D8E482591FFF240019C8C8AE12A64846E8BB874E4B8C58CF306CF9E7BDE34012EA6E94B0E09CB6A04D9E43758CCBDDA381404ADF4EFAFB38036D46AB9270AEC514C30E0B126DAFC5B57CEEC34ABBB3732D6A703B820C06194CC0901CC7F4CCBE5E5B60A6112B8D4D667CA

CLIENT -> USER   : P finish fair

CLIENT -> USER   : P closing
USER   -> CLIENT : P closed

CLIENT -> SERVER : P closing
  (user status = FINISHED)
SERVER -> CLIENT : P closed

SERVER -> HOST   : P finish fair

SERVER -> HOST   : P closing
  (game stage = CLOSING)
HOST   -> SERVER : P closed


The same game can also be considered by the status changes an individual player goes through while participating. In a multi-player game, it is possible for different players to have different statuses.
Status Function
Unset - player created
Connected - player connected to server
Accepted - player accepted by host
Digest - player has revealed their digest
Usertext - player has revealed their usertext
Finished - player has declared themselves content with the fairness


(
TOP)(UP)