COIN FLIPPING WORKSHEET V1.3

INTRODUCTION

The protocol operates based on a commitment scheme that allows one participant to commit to a choice (like flipping a coin to heads or tails) without revealing it, while the other tries to guess the outcome. The magic of this approach is that neither party can cheat without the other noticing. To ensure the fairness of this coin flip, both participants will engage in a series of calculations and exchanges, the steps for which are clearly outlined in the worksheet.

BEFORE STARTING

1. Verify that both participants are using the same version of the protocol.

2. Read through the entire document before you start.

3. Determine the role: participant A will initiate the process.

4. Go to the corresponding section of your determined role.

COMMON MISTAKES TO WATCH OUT FOR

Not Keeping Secrets: The secret number that Participant A chooses should be kept hidden until the reveal step. Revealing it prematurely defeats the purpose of the protocol.

Inconsistent Calculations: Make sure to follow each mathematical step as outlined. Any deviations can lead to inconsistencies in the final hash value.

Guessing Before Hash Reveal: Participant B should make sure they don't announce their guess until after they receive the hash value from Participant A.

Skipping Steps: Each step, no matter how trivial it may seem, is essential for the protocol's integrity. Don't skip any steps, and ensure each calculation is done correctly.

Not Verifying Results: Participant B should diligently verify the results after the reveal step. This ensures the integrity of the process and confirms that Participant A was honest in their commitment.


PARTICIPANT A

Step 1: Secret Preparation

1.1. Secret Number: Think of a secret random number (r). Do not reveal this number to Participant B.

r = _______________

1.2. Bit Choice: Choose a bit (b). This represents your 'coin flip'. (0 for head and 1 for tail).

b = _______________ (Choose either 0 or 1)

Step 2: Receive Participant B's Random Number

2.1. Receive Random Number: Participant A receives a public random number, s, from Participant B.

s = _______________

Step 3: Hashing

3.1. Calculate Total: Add your secret number (r), your bit (b), and Participant B's random number (s).

r + b + s = _______________

3.2. Multiply by Prime: Multiply the result from step 3.1 by 17.

(r + b + s) x 17 = _______________

3.3. Modulus Operation: Find the modulus of the result from step 3.2 by 100.

(r + b + s) x 17 mod 100 = _______________

Step 4: Commitment

4.1. Share Hash: Share the result from step 3.3 with Participant B. This is your hash value (h).

h = _______________

Step 5: Reveal

5.1. Check: After Participant B makes their guess, reveal your secret number (r) and your bit (b) to them. If their guess matches your bit, they win the coin flip, and vice versa.


PARTICIPANT B

STEP 1: GENERATE AND SHARE A RANDOM NUMBER

1.1. Generate Random Number: Participant B decides on a random public number, s, and shares it with Participant A.

s = _______________

STEP 2: RECEIVE HASH

2.1. Hash Value: Receive the hash value (h) from Participant A. Write it down.

h = _______________

STEP 3: MAKE YOUR GUESS

3.1. Bit Guess: Guess the bit (b) you think Participant A chose. This is your guess (g).

g = _______________ (Guess either 0 or 1)

STEP 4: VERIFICATION

4.1. Secret Number & Bit: Once Participant A reveals their (r) and (b), note them down:

r (from Participant A) = _______________

b (from Participant A) = _______________

4.2. Hashing: Use the above values to compute the hash:

(r + b + s) x 17 mod 100 = _______________

4.3. Check: Compare the value from step 4.2 with the hash value (h) you received earlier. If they mismatch, it means the process was compromised. Otherwise, proceed to the result.

4.4. Result: If the bit (b) revealed by Participant A matches your guess (g), you "win" the coin flip. Otherwise, Participant A "wins".


CREDIT

Worksheet created by KD2TAI Hisen Zhang and inspired by COIN FLIPPING BY TELEPHONE A PROTOCOL FOR SOLVING IMPOSSIBLE PROBLEMS by Manuel Blum in 1981.