🔐 Core Verification Logic
async function verifyFairness() {
// 1. Get user inputs
const serverSeed = document.getElementById("serverSeed").value;
const commitHash = document.getElementById("commitHash").value;
// 2. Use bcrypt.compare() to verify
// This cryptographically checks if:
// bcrypt.hash(serverSeed) === commitHash
const isValid = await bcrypt.compare(serverSeed, commitHash);
// 3. Display the result to user
displayResult(isValid, serverSeed, commitHash);
}
🛡️ Security & Privacy Features
-
100% Client-Side: All verification happens in
your browser, nothing is sent to any server
-
Zero Server Communication: Your lottery data
never leaves your device
-
Open Source & Auditable: You can inspect and
verify every line of code
-
Bcrypt Algorithm: Industry-standard cryptographic
hashing (used by major platforms)
-
Offline Capable: Works completely offline after
initial library load
-
No Analytics or Tracking: No cookies, no
tracking, complete privacy
🔍 How to Independently Verify This Code
-
Press Ctrl+U (or Cmd+U on Mac) to view the
page source
-
Search for
bcrypt.compare to see the exact
verification logic
-
Compare with the
GitHub repository
- Download this file and run it offline on your local machine
-
Inspect the Network tab in DevTools - you'll see no data is sent
anywhere
⚡ Quick Verification Method:
Right-click anywhere on this page → "View Page Source" → Search for
"bcrypt.compare"
You'll see the exact code that performs the cryptographic
verification. That's all there is to it!
🎯 Provably Fair Explained
Provably Fair is a cryptographic technique that
allows you to verify the fairness of a lottery or game without
trusting the operator.
How it works:
-
Before the draw: Operator publishes a
cryptographic hash (commit hash)
-
Tickets are sold: Users buy tickets with the hash
visible
-
After the draw: Operator reveals the server seed
-
Verification: Anyone can verify that
hash(server_seed) = commit_hash
This proves the operator couldn't have changed the server seed after
seeing the tickets, ensuring complete fairness.