Documentation

How BTC Lottery Works

A lottery where the outcome is determined entirely by the Bitcoin blockchain — transparent, tamper-proof, and verifiable by anyone.

What is BTC Lottery?

BTC Lottery is a provably fair number generator that uses Bitcoin block hashes as its source of randomness. Every ~10 minutes, when a new Bitcoin block is mined, a number between 00 and 99 is derived from that block's hash.

Unlike traditional lotteries where the organizer controls the outcome, this system relies on Bitcoin's Proof-of-Work — the most computationally expensive and decentralized process on Earth. No one, not even the lottery operator, can manipulate the result.

// The entire lottery logic in one line:
const number = Number(
BigInt("0x" + blockHash)
% 100n
)
// Result: a number from 00 to 99
// Uniform distribution — no bias

How It Works

01
⛏️
Bitcoin Block is Mined
Approximately every 10 minutes, miners solve a SHA-256d puzzle to add a new block to the Bitcoin blockchain. The block hash is the output of this computation.
02
🔗
Hash is Fetched
The app polls blockstream.info and mempool.space every 30 seconds to detect new blocks and retrieve the latest block hash.
03
🔢
Number is Derived
The full 256-bit block hash is converted to a BigInt, then taken modulo 100. This produces a uniformly distributed integer from 0 to 99.
04
Anyone Can Verify
Click any block hash to open it on mempool.space. Run the same one-line formula yourself. You'll get the exact same result — no trust required.

Why It Cannot Be Manipulated

🔒
Unpredictable Before Mining
A Bitcoin block hash is determined by SHA-256d of the entire block header, which includes the previous hash, Merkle root of all transactions, timestamp, and a nonce. No one knows the hash until the block is found — it is computationally infeasible to predict.
Manipulation Costs Billions
To choose a specific hash, a miner would need to control >51% of Bitcoin's hashrate (~600 EH/s as of 2024). The hardware and energy cost to attempt this is in the tens of billions of dollars — far exceeding any possible lottery gain.
🌐
Publicly Verifiable
Every Bitcoin block hash is permanently recorded on a public, immutable blockchain. Anyone with an internet connection can verify the result independently using any Bitcoin explorer. The formula is one line of open-source code.
🤝
No Trusted Third Party
Neither the lottery operator nor any central server can influence the outcome. The randomness source is Bitcoin's global network of ~18,000 nodes reaching consensus. Trust is replaced entirely by mathematics and cryptography.

Traditional vs. BTC Lottery

Property Traditional Lottery BTC Lottery
Result verifiable by public ✗ Rarely ✓ Always
Operator can manipulate result ✗ Yes ✓ Impossible
Requires trust in organizer ✗ Yes ✓ No
Result can be predicted in advance ✗ Sometimes ✓ Never
Source of randomness RNG server (opaque) Bitcoin Proof-of-Work
Anyone can verify the formula ✗ No ✓ One line of code

Frequently Asked Questions

Everything you need to know about how the system works.

How often does a new number get generated?
Bitcoin produces a new block approximately every 10 minutes. Each block generates a new lottery number. The countdown timer shows the estimated time until the next block.
Why does the number range from 00 to 99?
The block hash (a 256-bit number) is taken modulo 100, giving exactly 100 possible outcomes. This makes each of the 100 numbers equally likely, with no statistical bias.
How do I verify a result myself?
Click any block hash to view it on mempool.space. Then open your browser's developer console and type: Number(BigInt("0x" + "PASTE_HASH_HERE") % 100n)
What data sources does the app use?
The app fetches block data from blockstream.info as the primary source, with mempool.space as a fallback. Both are trusted, open-source Bitcoin block explorers.
Could a miner influence the lottery number?
Theoretically, a miner could discard a found block to try for a different hash — but this costs them the block reward (~3.125 BTC ≈ $300,000+). This makes manipulation economically irrational for any reasonably sized lottery prize.

Ready to See It Live?

Watch real Bitcoin blocks generate provably fair numbers in real time.

View Live Dashboard