Settings

Dark mode

BTC-Lottery.io – Blockchain-Based Lottery System

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

https://btc-lottery.io


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

  1. Users buy lottery tickets using USDT (TRC20).
  2. Each ticket is assigned a random 6-character hexadecimal code.
  3. When the next BTC block is mined, the last 6 characters of the hash become the winning code.
  4. Prizes are distributed to players whose ticket matches the result.

Developer Setup

<code># 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</code>

Project Structure

<code>/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</code>

Environment Variables

Create a .env file based on .env.example:

<code>NEXT_PUBLIC_API_BASE_URL=https://api.btc-lottery.io
TRONSCAN_API_KEY=your_tronscan_key
BTC_BLOCKCHAIN_API=https://blockchain.info/latestblock</code>

Dependencies

  • Next.js for frontend framework
  • ethers.js for wallet connectivity
  • axios for API communication
  • web3.js (if applicable) for on-chain interactions

Testing

<code>npm run test</code>

Tests include:

  • Draw logic accuracy
  • Wallet and deposit verification
  • Edge-case handling

License

MIT License
© BTC-Lottery.io 2025

Contributing

Contributions are welcome! Please open an issue first to discuss what you'd like to change.

Contact

For technical or business inquiries:
[email protected]