spaghettiwires calc

Heads or tails, from a distance

Write the question, pick when the coin lands and send the link to whoever is deciding with you. While it's in the air nobody can know how it will fall, not even us: the result comes from drand, a network of independent organisations that publishes a random number every 30 seconds.

[[ mode === 'flip' ? t.form_title_another : t.form_title ]]

Say what heads means and what tails means. [[ questionLeft ]]

When it lands

[[ plannedText ]]

The link only proves something if the others get it before the coin lands. That's why you get a few minutes to share it.

[[ mode === 'flip' ? t.badge_flip : t.badge_minute ]]

[[ t.q_open + question + t.q_close ]]

[[ fmt(t.share_preview, { text: shareText }) ]]

[[ t.verify_title ]] [[ t.verify_badge_ok ]] [[ t.verify_badge_bad ]]
[[ t.verify_round ]]
[[ round ]] · [[ whenText(at) ]]
randomness
[[ beacon.randomness ]]
[[ t.verify_question ]]
[[ question ? t.q_open + question + t.q_close : t.verify_no_question ]]
[[ t.verify_digest ]]
[[ digest.slice(0, -1) ]][[ lastDigit ]]
[[ t.verify_result ]]
[[ fmt(t.verify_rule, { digit: lastDigit, parity: parseInt(lastDigit, 16) % 2 ? t.odd : t.even, side: sideName }) ]]
[[ t.verify_signature ]]
[[ t['verify_sig_' + signature] ]]

How it works

Flipping a coin on a video call convinces nobody: whoever flips can try again until they like the result. Here the coin is flipped by an outside network, at a time agreed in advance, and anyone can work the result out again from public data.

Where the result comes from

drand is the randomness service of the League of Entropy, a group of independent organisations including Cloudflare, Protocol Labs, EPFL and several universities. Since 2020 it has published a number every 30 seconds, signed jointly by the nodes of the network: making one takes many of them working together, and no single node can predict or pick it. Every number stays available forever, and its signature can be checked against the network's public key. This page does exactly that, in your browser.

Why the link must go out first

The link holds the question and the landing time. If you receive it while the coin is still in the air, whoever made it couldn't know how it would fall. If it reaches you afterwards, it proves nothing: anyone can make a link with a past time once they've seen the result.

  • The proof is the time on the chat message: if the link arrived before the landing time, the flip counts.
  • If someone sends you a flip that has already landed, ask them for a new one.
  • When you share with the button, the message already says the coin is in the air and when it lands. The link preview, though, is the page's generic one.

The maths, if you want to redo it

t is the landing time in Unix seconds (UTC), always a whole minute. The drand round at that moment gives the signature and the random number:

round = (t − 1595431050) / 30 + 1

randomness = sha256(signature)

digest = sha256(randomness + question)

last digit of digest even → heads, odd → tails

The question goes into the hash exactly as written in the link: two different questions at the same time get independent flips, and the same question at the same time always gets the same result. The "Check it" box under the coin shows every value, with a link to drand's original data.

New here?