BTC-Lottery.io – Blockchain-Based Lottery System
BTC-Lottery.io is a decentralized, provably fair lottery platform built on Bitcoin blockchain technology. It generates lottery results using the last 6 characters of each Bitcoin block hash, creating a transparent and tamper-proof gaming system.
Live Website
Key Features
- Provably Fair: Uses BTC block hashes, verifiable via any blockchain explorer.
- Fast Draws: Each draw is tied to every new BTC block (~every 10 minutes).
- Immutable Records: No central RNG, all results are on-chain and public.
- TRC20 USDT Support: Deposits and withdrawals handled via Tron network.
- Secure Wallet Integration: Non-custodial crypto wallet usage.
- CA Licensed: Operates under a Canadian online lottery license.
How It Works
- Users buy lottery tickets using USDT (TRC20).
- Each ticket is assigned a random 6-character hexadecimal code.
- When the next BTC block is mined, the last 6 characters of the hash become the winning code.
- Prizes are distributed to players whose ticket matches the result.
Developer Setup
# Clone the repository
git clone https://github.com/YOUR_ORG/btc-lottery.io.git
# Navigate to the project folder
cd btc-lottery.io
# Install dependencies
npm install
# Start development server
npm run dev
Project Structure
/src
/components → Reusable UI components
/pages → Frontend routes
/lib → Lottery logic, blockchain utils
/api → TRC20 and BTC block handling
/public → Static assets
.env.example → Environment variable sample
Environment Variables
Create a .env file based on .env.example:
NEXT_PUBLIC_API_BASE_URL=https://api.btc-lottery.io
TRONSCAN_API_KEY=your_tronscan_key
BTC_BLOCKCHAIN_API=https://blockchain.info/latestblock
Dependencies
- Next.js for frontend framework
- ethers.js for wallet connectivity
- axios for API communication
- web3.js (if applicable) for on-chain interactions