About the Script

How the CryptoLotto SOL/XRP script works: wallets, confirmations, draws, rollover, payouts, and the full tech stack.

About the CryptoLotto Script

CryptoLotto is a self-hosted lottery web app built for Solana (SOL) and XRP. It includes a public frontend for players and a private admin area to configure wallets, create draws, and track winners.

What it does

  • Runs ticket-based draws with a fixed ticket supply (max tickets).
  • Tracks payments on-chain and mints tickets automatically after confirmations.
  • Closes draws automatically when the draw sells out, selects 3 winners, and publishes results.
  • Optionally auto-starts the next draw (auto-rollover) with the same settings.
  • Gives admins a clear winners list so payouts can be made manually and marked as paid.

SOL + XRP confirmations (no payment processor)

Players pay directly to the wallet address you set for each coin. Instead of relying on a custodial payment gateway, the app matches each order by requesting a unique amount (a small nonce added to the ticket total). The backend then polls the relevant chain via RPC APIs to:

  • detect the incoming transfer,
  • track confirmations,
  • and mark the order as confirmed once it reaches your configured threshold.

Note: You can use the default public endpoints, or plug in your own RPC endpoints for maximum control and reliability.

Admin commission per draw

Each draw has a configurable commission amount (your margin). The app calculates ticket price as (prize + commission) / max tickets and requests exact, wallet-safe amounts. Players see the prize target; commission is handled behind the scenes.

How draws are created

  1. Admin sets the SOL/XRP ledger address (where player payments go).
  2. Admin chooses prize amount, commission amount, max tickets, and the prize split for 1st/2nd/3rd place (must total 100%).
  3. The draw opens for sales immediately.
  4. When all tickets are sold, the draw closes and winners are published automatically.

What it looks like

UI snapshots (wallet addresses blurred). Ready to launch? Get the script.

Coin config + round creation
Admin: create a round
Set the receiving wallet, confirmations, payment window, prize, commission, ticket cap, and payout split.
  • Per-coin settings
  • Auto-rollover option
  • Instant publish

Winners list + payout tracking
Admin: winners & payouts
Track winners in one place, filter unpaid entries, and keep payouts organized while winners stay public.
  • Unpaid-only filter
  • Clear payout checklist
  • Public winners list

Payment instructions modal
Payment window
A clean QR + “exact amount” modal with live status updates so users know when their payment is confirmed.
  • QR scan to pay
  • Exact amount shown
  • Live status bar

How winners are paid

The system is non-custodial — winners are paid from your wallet. The admin dashboard lists winners per draw and lets you track who has been paid.

Tech stack

  • Backend: Node.js + Express + PostgreSQL
  • Frontend: React
  • Realtime: Socket.IO (live order/ticket updates)
  • Deployment: Docker + NGINX reverse proxy

Security & operations

  • Admin login with hashed passwords and JWT sessions
  • Private, randomized admin setup path
  • Configurable confirmation requirements and payment expiry windows

You are responsible for legal compliance (including gambling/lottery laws) in your jurisdiction.