project screenshot 1
project screenshot 2
project screenshot 3

Mini Jackpot

Decentralized MiniJackpot using Pyth Entropy for secure, verifiable random winner selection.

Mini Jackpot

Created At

ETHGlobal Prague

Project Description

MiniJackpot — Decentralized Secure Lottery Using Pyth Entropy

This project is a smart contract-based decentralized lottery game built on Ethereum-compatible blockchains. It leverages the Pyth Network's Entropy SDK to obtain secure, unbiased, and verifiable randomness for fair winner selection. The key goal is to create a transparent and trustless jackpot system where users can participate by sending a small entry fee and potentially win the entire jackpot pool.

How It Works:

  1. User Participation:
  • Users call the play function, sending a random number generated off-chain and paying a fee that covers the entropy provider's cost.
  • The contract accumulates the entry fees (minus the fee paid to the entropy provider) into a jackpot pool.
  1. Requesting Secure Randomness:
  • The contract requests a random number from the Pyth Entropy service, passing along the user's random number as input.
  • Pyth Entropy acts as an oracle providing unbiased random values with cryptographic guarantees.
  1. Entropy Callback:
  • Once Pyth Entropy generates a random number, it calls back the contract's entropyCallback method, providing the random value.
  • The contract maps the callback to the player who initiated the request.
  1. Determining the Winner:
  • The contract calculates a simple probabilistic condition to decide if the player won:

bool won = (uint256(randomNumber) % 100) < 5;

This means there is a 5% chance to win, determined fairly and securely by the entropy random number.

  • If the player wins, they receive the entire jackpot pool amount, and the pool resets to zero.
  • If the player loses, the pool grows with more entries, increasing the prize for future players.
  1. Events and Transparency:
  • The contract emits events for each play and result, including the raw random number used to decide the outcome. This makes all results transparent and auditable on-chain.
  • Anyone can verify the fairness of the game by checking the emitted random numbers and outcomes.
  1. Why Use Pyth Entropy?
  • Traditional on-chain randomness (like blockhash or timestamp) is susceptible to manipulation or prediction by miners/validators.
  • Pyth Entropy provides verifiable randomness from off-chain sources with cryptographic proofs, ensuring fairness and security.
  • Using Entropy decouples randomness generation from the contract, reducing complexity and gas costs.
  1. Key Features:
  • Decentralized and Trustless: No single party controls the outcome; randomness is provided by a trusted oracle.
  • Fairness: Secure, unbiased random numbers determine winners.
  • Transparency: Events log every request and outcome.
  • Gas Efficiency: Minimal on-chain computation; heavy work is offloaded to Entropy.
  • Simple UX: Users only need to provide a random seed and pay a small fee to participate.

How it's Made

We developed the MiniJackpot smart contract in Solidity using Foundry (Forge) for fast testing and deployment. The contract integrates with Pyth Entropy SDK to securely request and receive verifiable random numbers for fair jackpot draws.

The frontend is built with React and deployed on Vercel for a smooth user experience and quick updates. Users connect their wallets to play by submitting a random seed and paying the required fee.

We use Blockscout to verify contract transactions and events on-chain, ensuring transparency and easy auditing of jackpot entries and results.

Key features include secure entropy callbacks, dynamic fee handling, and gas-efficient state management. The project combines trusted randomness, seamless user interaction, and full on-chain transparency.

background image mobile

Join the mailing list

Get the latest news and updates