Games

Jumpball

WeBall's open-source on-chain randomness, and how to check any draw yourself.

What Jumpball is

Jumpball is a randomness program on Solana, built and run by WeBall. Other programs use it when they need a random number nobody can steer: not the player, not the validator, not WeBall. It's open source under Apache-2.0, in the public repository github.com/weballdotfun/jumpball, and kept separate from the rest of WeBall.

The Jumpball page shows the live feed, the latest draws and the addresses to check.

How a draw works

  1. Commit. WeBall generates a chain of 1,000,000 secrets off chain. Each one is the hash of the next. The end of the chain is published on chain by a commit authority held on a hardware wallet. From then on every secret is fixed.
  2. Lock. A program locks a draw at a slot. The draw will use the hash of a later slot, which nobody can know yet.
  3. Reveal. WeBall's operator reveals the next secret. Jumpball checks that it hashes to the one before it. The result is the hash of the secret and the slot hash.
  4. Fallback. If a reveal doesn't come in time, anyone can settle the draw from the hash of a slot at least 8 slots after the reveal window closes. Every draw settled this way is counted publicly. A draw nobody settles in the fallback window is refunded by the program that asked for it.

Checking a draw

  • Every draw on the Jumpball page links to its transaction. That transaction's log holds everything you need to re-check the result.
  • The page counts draws, reveals, fallback settlements and failures for the feed.
  • The operator key that reveals draws can only act on Jumpball and moves no money.
  • The program's upgrade authority is on a hardware wallet.

Checking the program itself

The program on chain is built reproducibly from the public source. You can rebuild it and compare hashes with solana-verify:

solana-verify verify-from-repo -u mainnet-beta --program-id HdTE57SKuE4MrzYaBSxV3BaFe6wmmaKg2ZNkj2vB6EeF https://github.com/weballdotfun/jumpball --commit-hash 383f3d6

The hash should match the one shown on the Jumpball page.

Using it in your program

WeBall runs a public feed that any program or client can use.

  1. Request a draw on the public feed. Your request names the most it will pay, so a fee raised later can't charge you more.
  2. Wait for the draw to be revealed.
  3. Read the 32-byte result.
  4. Close the draw to get its rent back.

The fee is $0.10 worth of $BALL per draw. Half is burned and half goes to the $BALL liquidity wallet. The keeper reprices it every 10 minutes when it's more than 5% off, using the median of the last 3 price reads. Each change moves it by at most 25%, and it always stays between set limits. The TypeScript client and a reference crank are in the repository.

Picking from a list fairly

WeBall uses Jumpball for its own giveaways, and you can follow the same method:

  1. Publish the full list of entries and its SHA-256 hash.
  2. Request a draw with that hash as its nonce. This ties the draw to that exact list.
  3. The chosen entry is number (result mod n) + 1 in the published order.

Anyone can then re-check the list, the hash, the draw and the result.

Not financial advice. Memecoins can go to zero.