Alice and Bob have divorced (Bob had an affair with Eve ). Now they quarrel about who gets the computer. They could throw a fair coin, but alas, they aren't at the same place. Neither do they trust each other or any mediator (otherwise they could both send a number to a third party, if the sum is even etc.).
Is there a no-trust protocol simulating a fair coin?
Yes, there is a no-trust protocol that simulates a fair coin flip. It's called the "Mental Poker" protocol, and it allows two parties to play a fair game of poker without revealing their cards to each other or a third party. Here's how it would work:
Alice and Bob agree on a large prime number, $p$ and a generator $g$ where $g$ is a primitive root modulo $p$.
Alice chooses a random secret number $a$ between $1$ and $p-1$ and sends Bob the value $A = g^a$ mod $p$.
Bob chooses a random secret number $b$ between $1$ and $p-1$ and sends Alice the value $B = g^b$ mod $p$.
Alice computes $K = B^a$ mod $p$.
Bob computes $K = A^b$ mod $p$.
Both Alice and Bob now have the same $K$, which is a shared secret. They can use $K$ to generate a random bit by computing $K$ mod $2$. If the result is $0$, they say the coin came up heads. If the result is $1$, they say the coin came up tails.