This document describes a cryptographic protocol to be used by a single server S and N players X1 to Xn.

Note: the following messages may well get wrapped in a larger messages saying for instance who the user is, and perhaps signing the packet, saying how much money they stake, and how they will pay. But that is exterraneous to the basic protocol. As are possible acknowledgement of receipt, use of SSL, etc.

Step 1
S -> general
"The game is now open."
(Optional) "The game will close at no later than time TCLOSE."
(Optional) "The game will accept at most NMAX players."
(Optional) "I understand the following hash algorithms R1,R2,etc."
"The seed prefix you must include is SEED."
"The modulo number is MOD."
Step 2
X1 -> S
"I wish to join the game."
"Here is my hash: HASH_X1."
"I am using algorithm R1
"This is a submission to game SEED."
Step 3
S -> X
"The game is now closed. No further players may join."
"These are the hashes that I have received: HASH_X1:R_X1 ... HASH_Xn:R_Xn"
"Here is my hash: HASH_S:R_S."
"Reveal your choices."
Step 4
X1 -> S
"This was my plaintext: PLAINTEXT_X1."
"This was my choice: CHOICE_X1."
HASH_X1 = hashof(SEED + PLAINTEXT_X1)
CHOICE_X1 = PLAINTEXT_X1 mod MOD
Step 5
S -> X
"Here is the selection: SELECTION"
SELECTION = (CHOICE_X1 + ... + CHOICE_XN + CHOICE_S) mod MOD
"Here is the proof: PLAINTEXT_S, PLAINTEXT_X1 ... PLAINTEXT_XN"
Step 6
Software verifies proof to the player or calls cheat.