Mini Jackpot

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

Visit Repo
Mini Jackpot banner

About

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.

2. 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.

3. 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.

4. 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.

5. 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.

  • 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.

7. 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.

From the public ETHGlobal showcase page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.

Entropy Wheel

A trustless crypto roulette and daily lottery using Pyth Entropy for verifiable randomness.

myawesomeproject

Decentralized blockchain lottery platform: Host transparent, tamper-proof contests with smart contracts. Fair, secure, and easily verifiable.

LottoWin

LottoWin exemplifies how blockchain technology can revolutionize the lottery industry, setting a new standard for fairness and transparency while providing participants with an exciting and secure gaming experience.