Nightcast

Random numbers nobody can rig.

Nightcast gives apps on Midnight random values that arrive with a proof. Anyone can check where a number came from. Nobody, including us, can predict it or change it.

Get early access Try a fair draw

Each creature grows from a real value made by Nightcast's operators on Midnight's test network: the network's first two values, and a child whose genes come from both.

On Midnight Preprod

Serving committee
Epoch 6, 3 of 5
Operators
5 active
Contract calls proved
18 of 18
See the network

Every number, start to finish

Apps ask. Operators answer. Each value hatches its own creature and swims back to whoever asked, and the fee goes to the operators who answered in time.

A simulation: the requests, values and results here are made up in your browser. The real ones are on the Network page.

A smart contract can't roll dice. Everything on a blockchain is visible and predictable, so a fair random number has to come from outside, from something nobody controls and everybody can check.

How it works

  1. Your app asks

    It sends a request on Midnight, sealing what the number is for (a draw, a round, a list of entrants) before anyone can know the answer.

  2. Operators answer

    Each operator holds a share of a secret key. Any three of five combine their answers into the one value the key allows, so no one can pick a result.

  3. The proof goes on chain

    A zero-knowledge proof shows the value was made correctly, and Midnight's validators check it before it's accepted.

  4. Anyone checks

    The request, the value and the proof are public. Our SDK or a certificate page confirms them in a second, without trusting us.

Try a fair draw

Put in some names and draw a winner from the value above. Run it again, on any computer, and you get the same winner: the result depends only on the names and the published value.

A demonstration in your browser. In a real draw, the list is sealed on chain before the value exists, so nobody can rearrange it after seeing the answer.

Built for anything that needs chance

Three steps to a fair draw

Seal the list, ask for a value, pick the winners. The SDK turns one value into picks, shuffles, dice or weighted prizes, and anyone can repeat it to check.

import { listCommitment, pickMany } from '@nightcast/sdk';

const entrants = ['Ava', 'Ben', 'Chloe', 'Dev', 'Ella'];

// 1. Seal the list: its fingerprint is the request's seed.
const seed = listCommitment(entrants);

// 2. Nightcast answers on chain with a value and its proof.

// 3. The same value always gives the same winners.
const winners = pickMany(output, entrants, 2);

Trust spread across stake pools

Nightcast's first oracle answers alone, and its proofs already stop it choosing a result. The threshold network goes further: it is built so that a committee of Cardano stake pool operators makes every value. Any three of five, or four of seven, can produce it, and fewer than half of a committee can neither know a value early nor stop one. On the test network our own operators fill the committee for now.

All of this runs on Midnight's test network and hasn't been audited yet. Mainnet follows an independent security audit.

  1. The operators run the network by themselves: a new committee opened, seated and keyed, and a request answered, settled and paid, with nobody at the controls.
  2. A smaller committee forms after a silent operator is stood down. The operator package is built.
  3. The first committee handover, the first fines for operators who stayed silent, and the last of the contract's 18 calls proved on chain.
  4. The threshold network's first random value. Its operators are paid.
  5. Nightcast v1, with request fees and oracle bonds. It answers LunaSpin's spins.
  6. The first Nightcast oracle passes a 24-hour run on Midnight's test network, answering every request on time.

Run a Nightcast operator

Stake pool operators earn a share of every request's fee. One Docker set-up, a small bond and a signature from your pool; then it answers requests and keeps the network moving by itself.

How to run one

Get early access

Nightcast is free to try on the test network now. Leave your email and we'll help you set it up, and tell you when Mainnet opens.

We only use your email for Nightcast early access. We don't share it. Privacy