LOOTERY GAMER Whitepaper
LOOTERY GAMER is a set of lottery-style games that run entirely on the WAX blockchain. Every ticket, every draw and every prize is a public transaction handled by a smart contract. Winning numbers come from the official WAX random number oracle. No one, including the operator, can take money out of a prize pot.
1. Design principles
- On-chain and verifiable. The rules live in the smart contracts. The website is only a convenient way to sign transactions; anyone can play, close draws or pay out prizes directly on the blockchain.
- Non-custodial pots. No contract has an action that lets the operator withdraw a jackpot, a frozen pot or an unpaid prize.
- Permissionless operation. Closing a draw, counting winners, paying prizes and cleaning up old data are public actions. An automated bot runs them on time, but if it stops, any user can run them.
- Minimal on-chain cost. Data is stored compactly and deleted as soon as a draw is resolved, so RAM is reused instead of growing forever.
- Public interface. The source code is proprietary, but each contract's interface (its actions and tables) is published on the blockchain, and everything the contracts do (tickets, draws, randomness and payouts) is a public transaction that anyone can follow in a block explorer.
2. PRIMI PRIZE
A classic number lottery. A ticket is one combination of 5 different numbers from 1 to 30. There are 142,506 possible combinations, so each ticket has a 1 in 142,506 chance of winning.
| Step | How it works |
|---|---|
| Play | Send N × ticket price in WAX to the contract with the memo play:3,11,17,24,30 (several tickets separated by ;). Paying and playing happen in a single signature. |
| Split | 90% of every ticket goes to the jackpot and 10% to the operator. The fee can never be set above 10%. |
| Price | Fixed for the whole draw. The operator may set it in US dollars; the price is then adjusted in WAX for the next draw only, so no purchase fails mid-signature. |
| Draw | At closing time the jackpot is frozen and the oracle provides the winning combination. |
| Prize | Only a 5/5 match wins. All winning tickets share the frozen pot equally; rounding remainders stay in the jackpot. |
| Rollover | If nobody matches all 5 numbers, the pot is added to the next jackpot. |
| Limits | Up to 2,000 tickets per wallet per draw. Anyone can donate to the jackpot with the memo jackpot. |
Optional jackpot cap
If the jackpot ever exceeded the value of all 142,506 combinations, buying every combination would be a guaranteed profit. To rule this out, the operator can switch on an optional cap, expressed in tickets so that it follows the ticket price. Anything above the cap is kept in a reserve that refills the jackpot as soon as there is room, for example when the next draw opens. With a cap of 142,506 tickets or less, no strategy has a positive expected value. The reserve belongs to the players: it cannot be withdrawn either. With no cap (the default), the whole amount stays in the jackpot.
3. ONE WISH
A raffle where the ticket is an NFT and one wish takes everything.
| Step | How it works |
|---|---|
| Buy | Send WAX with the memo buy to receive ONE WISH NFTs (AtomicAssets). 90% of the price goes to the pot and 10% to the operator. |
| Wish | Transfer one NFT back to the contract with the memo enter. That NFT becomes your ticket for the open draw. One wish per wallet per draw. |
| Draw | The oracle picks one ticket at random. Its owner wins the whole pot. |
| Rollover | If a draw has no tickets, the pot carries over to the next one. |
| Recycling | Used NFTs return to the contract's stock and are sold again, so new NFTs are minted only when the stock runs out. Each NFT records how many draws it has won (mutable attribute wins, written by the contract); this is a keepsake only and has no effect on its odds in future draws. |
4. LOOT NAR
A free game for Alien Worlds miners on one land chosen by the operator (shown on the game page, e.g. PLANET x:y). The operator can switch to another land; tickets already earned are kept. Mining works exactly as usual and the mined TLM stays with the miner. LOOT NAR only adds a ticket for every mine.
| Step | How it works |
|---|---|
| Mine | The website builds one transaction: (if needed) m.federation::setland to the LOOT NAR land, then m.federation::mine, then lootnar::ticket. |
| Verify | The contract reads its own transaction and only issues a ticket if it contains exactly one successful mine by the same account on the configured land, immediately before the ticket. Apart from resource-provider no-ops, no other actions are allowed in that transaction. |
| Draw | The oracle picks a random ticket. The more mines, the higher the chance. |
| Prize | A fixed amount of TLM per draw, set by the operator and paid from a prize fund that the operator tops up. The prize is reserved from the fund when the draw closes. |
LOOTERY GAMER is not affiliated with Alien Worlds.
5. Randomness
All draws use orng.wax, the official WAX RNG oracle. When a draw closes, the contract requests a
random value, and the oracle answers with a value derived from a signature that it cannot choose freely and
that nobody can predict in advance. The result is stored in the draw so it can be audited.
- PRIMI PRIZE: a partial Fisher-Yates shuffle over the numbers 1–30, where step i uses
sha256(random || i). - ONE WISH: ticket index =
sha256(random)(first 8 bytes, little-endian) modulo the number of tickets. - LOOT NAR: the same formula picks a target among all mines; the winner is the miner whose range of tickets contains it.
Only the first answer for a draw is accepted; late or duplicate answers are ignored. If the oracle does not answer within one hour, anyone can request a new value.
6. Draw lifecycle
- Open: tickets are accepted until the closing time. The schedule (every N hours, chosen weekdays at a set time in UTC or Spanish time, or a date set by hand for each draw) applies from the next draw on. A draw can be unscheduled: until its date is announced nobody can play and it cannot close. The operator can only set or change a draw's date while it has no participants, so once you play, the closing time is fixed.
- Waiting for random: the pot is frozen and the next draw is already open.
- Counting: winners are found in small batches (
settle/pick), so no draw can become too big to resolve. - Paying: each prize is paid in its own action (
payout). If one winner cannot receive the payment, the others are not blocked. - Unclaimable prizes: if a prize still cannot be paid 30 days after the draw (for example, the winner is a contract that rejects transfers),
reclaimreturns it to the jackpot (PRIMI PRIZE, ONE WISH) or to the prize fund (LOOT NAR). - Cleanup: once a draw is resolved, its tickets are deleted in order and the RAM is reused.
7. Security model
What the operator can do
- With the contract key: pause new tickets, change the fee account and the fee (never above 10%), change the LOOT NAR land, and withdraw unreserved LOOT NAR prize fund.
- With a restricted "pricer" permission used by the admin panel: set the price of the next draw, the schedule, the date of a draw that has no participants yet, the optional jackpot cap and buy RAM. RAM can only be paid with pending operator fees.
What nobody can do
- Withdraw a jackpot, a frozen pot, the jackpot reserve or a prize owed to a winner.
- Change the price or the closing time of a draw that is already open.
- Choose the random value or replay an old one.
Other safeguards
- Test-only actions (used to simulate the oracle on testnet) are compiled out of the mainnet build, and the deploy scripts refuse to upload a test build to mainnet.
- The backend never holds player funds or player keys. Players sign every transaction in their own wallet. Login is by email link; linking a wallet requires a signed proof.
8. Fees and on-chain costs
| Game | Player pays | Operator fee |
|---|---|---|
| PRIMI PRIZE | Ticket price in WAX | 10% of each ticket |
| ONE WISH | NFT price in WAX | 10% of each NFT |
| LOOT NAR | Nothing (only the usual mining CPU) | None; the operator funds the TLM prize |
Players never pay for storage. The contracts pay for their own RAM out of operator fees, and data is deleted when each draw is resolved:
- PRIMI PRIZE: about 130 bytes per player per draw plus 4 bytes per ticket, since all of a player's tickets share one record.
- ONE WISH: about 260 bytes per wish, plus 151 bytes for each newly minted NFT (recycled NFTs cost nothing).
- LOOT NAR: about 130 bytes per miner per draw.
A short summary of each finished draw is kept as public history.
9. How to verify
- Read the tables (
state,draws,tickets,entries…) of each contract in any WAX block explorer. - Check the random value stored in each draw against the
orng.waxtransaction, and recompute the winning numbers or ticket with the formulas above. - Check each contract account's permissions (who can sign which actions) and its history of actions.
| Game | Contract (testnet) | Mainnet |
|---|---|---|
| PRIMI PRIZE | looterygamer | To be announced |
| ONE WISH | looterywish1 | To be announced |
| LOOT NAR | looterynar11 | To be announced |
10. Responsible play and legal
LOOTERY GAMER is for adults (18+) only. Play only with money you can afford to lose. Lotteries and raffles are regulated in many countries; it is each player's responsibility to make sure they are allowed to take part where they live. Access may be restricted in some jurisdictions. Nothing in this document is financial advice.
This is a draft. Parameters such as prices, schedules and the LOOT NAR prize will be confirmed before the mainnet launch, and any change to the rules will be reflected here.