LuckPicker

Provably Fair Draws: Commit and Reveal

Publish a hash before the draw, publish the seed after. A worked example, start to finish.

Commit-and-reveal is a way to prove you decided something before you knew the outcome. It uses one idea — a hash — and no cryptography beyond running a hash function.

The problem it solves is specific. Publishing a seed after a draw proves nothing, because you could have tried hundreds of seeds and published the flattering one. Publishing it before the draw solves that and lets everyone compute the winner early.

Commit-and-reveal gets both: you lock in the seed without revealing it, then reveal it afterwards.

What a hash gives you

A cryptographic hash function takes any input and produces a fixed-length string. Two properties make it useful here: the same input always produces the same output, and finding a different input that produces the same output is computationally infeasible.

The second property is what makes a hash a commitment. If you publish the hash of your seed, you cannot later claim a different seed — any other seed would hash differently, and everyone can check.

The first property is what makes verification trivial. Anyone can take your revealed seed, hash it, and compare against what you published. No keys, no trust, no special software: a hash function is available in every browser and in every programming language.

The commitment, in three lines

  • Before: publish hash('amber-flint-glade-472') — a fixed-length string revealing nothing.
  • After: publish the seed itself.
  • Anyone: hash the revealed seed, compare to the published commitment. They match or they do not.

The full protocol

Five steps, in strict order. First, choose a seed. Second, publish its hash. Third, open and then close entries, publishing the frozen list. Fourth, run the draw from the seed. Fifth, publish the seed and the result.

The order is the protocol. Committing before entries close means the seed cannot have been chosen with the entrant list in view, which closes the remaining hole. If you commit after entries close, you could still have searched for a seed favourable to a specific entrant.

Verification is then two checks that anyone can perform: hash the revealed seed and confirm it matches the commitment, then run the seeded draw over the published list and confirm it produces the announced result.

  • 1. Choose a seed.
  • 2. Publish hash(seed) — before entries close.
  • 3. Close entries and publish the frozen list.
  • 4. Run the seeded draw.
  • 5. Publish the seed and the result.

A worked example

Suppose you are giving away one prize and expect around fifty entrants. Before opening entries you pick the seed `amber-flint-glade-472`, hash it, and post the resulting string with the announcement: "the draw seed hashes to this; I will publish the seed when I draw."

Entries run for a week. You close them, post the full list of fifty names in the order they arrived, and state that you will shuffle with the committed seed and take the first name.

You run the draw, post the seed and the winner. Anyone can now hash `amber-flint-glade-472`, confirm it matches the string you published a week earlier, paste the fifty names into a seeded shuffler with that seed, and see the same first name. Nothing in that chain requires trusting you.

What a sceptic actually does

  • 1. Hash the revealed seed. Does it match the commitment posted before entries opened?
  • 2. Paste the published list, in the published order, into a seeded shuffler.
  • 3. Enter the revealed seed. Compare the first name to the announced winner.
  • Three steps, no special tools, no trust required.

Where it can still go wrong

The list order matters and is easy to overlook. A seeded shuffle applied to the same names in a different order gives a different result, so the published list must be in the exact order used. Publishing an alphabetised list and shuffling an arrival-ordered one breaks verification for no good reason.

The seed must be genuinely committed before it could have been chosen advantageously. Committing after entries close is much weaker; committing after seeing the list is worthless.

And the whole thing assumes you actually publish the seed afterwards. A commitment with no reveal proves only that you had a seed, which is not a claim anybody doubted.

When it is worth the ceremony

This is more process than most draws need, and using it for a draw among friends is odd rather than diligent. The threshold is roughly: does anyone have a material incentive to doubt the result, and would a doubt be expensive to resolve.

For a public giveaway with a valuable prize, an audience that includes strangers, or any situation where an accusation would be costly to answer, it is proportionate and cheap. The whole protocol is two extra posts.

For anything where the draw might be scrutinised formally, it is the strongest available evidence short of an independent observer, and it has the advantage of being checkable by anyone at any time afterwards rather than only by whoever was watching.

Frequently asked questions

What does commit-and-reveal prove?

That the seed was fixed before the outcome was known. Publishing a seed afterwards proves nothing, because you could have searched for a favourable one.

Do I need special software?

No. Hash functions are available in every browser and every language, and verification is running one hash and one shuffle.

When should I publish the commitment?

Before entries close, ideally before they open. Committing after you can see the list is much weaker.

Why does the list order matter?

Because a seeded shuffle over the same names in a different order gives a different result. Publish the list in the exact order used.

What does a verifier actually do?

Hash the revealed seed and compare to the commitment, then run the seeded shuffle over the published list and compare the result.

Can I use this without a seeded generator?

Not usefully. The reveal only means something if the seed determines the outcome, which requires a deterministic draw.

Is this overkill for a small giveaway?

For a draw among friends, yes. The threshold is whether anyone has a material incentive to doubt the result.

What if I forget to publish the seed?

The commitment proves only that you had a seed, which nobody doubted. The reveal is the half that carries the evidence.

Tools that use this

Related guides

← All guides