Skip to content

Randomness ​

The winning cell comes from the drand evmnet beacon, a public randomness network run by independent organisations. Its signatures are checked by the contract itself.

The beacon follows the close ​

drand evmnet produces a beacon every p=3 seconds since its genesis g=1727521075. Round n is produced at τ(n), and the game assigns round r the beacon

(2)nr=⌊cr−gp⌋+2,τ(n)=g+(n−1)p.

Lemma 1 · The beacon follows the close

For every round r,  cr<τ(nr)≤cr+p.

Proof. Write cr−g=ap+b with a=⌊(cr−g)/p⌋ and 0≤b<p. Then τ(nr)=g+(a+1)p=cr+(p−b) and 0<p−b≤p. ∎

Every bet of round r is placed before the signature σnr exists: no group of drand nodes large enough to produce it has signed round nr yet. The draw follows the close by at most one beacon period, which leaves the 15-second break for publication, settlement and the animation of the result.

Threshold BLS on BN254 ​

The network runs the scheme bls-bn254-unchained-on-g1. Let G1,G2,GT be the groups of prime order q of the BN254 curve with generators g1,g2 and the optimal Ate pairing e:G1×G2→GT, which is bilinear and non-degenerate. The network holds a secret x∈Zq shared among N nodes with threshold t; the group public key is PK=xg2. For round n:

(3)mn=keccak256(be64(n)),σn=x⋅H(mn)∈G1.

H hashes to G1 with expand_message_xmd over keccak-256 and the Shallue–van de Woestijne map, under the tag BLS_SIG_BN254G1_XMD:KECCAK-256_SVDW_RO_NUL_. The scheme is unchained: mn depends on n alone, so any round can be verified without its predecessors. Each node i publishes σn(i)=xiH(mn), and any t partial signatures combine by Lagrange interpolation in the exponent:

(4)σn=∑i∈Sλiσn(i),λi=∏j∈S, j≠ijj−imodq,|S|=t.

The contract accepts a 64-byte σ only if the pairing equation holds, checked with the EIP-197 precompile:

(5)e(σ, g2)=e(H(mnr), PK).

Lemma 2 · Uniqueness

For a fixed public key and round there is exactly one σ∈G1 satisfying (5), namely σ=xH(mn).

Proof. By bilinearity e(H(mn),xg2)=e(xH(mn),g2), so (5) gives e(σ−xH(mn),g2)=1. The map e(⋅,g2) is non-degenerate on the cyclic group G1 of prime order, so its kernel is trivial and σ=xH(mn). ∎

Uniqueness is why settlement can be open to anyone: whoever submits the signature, the outcome is the same, and there is nothing to grind. Unpredictability rests on the threshold assumption that fewer than t drand nodes collude, together with the hardness of computing xH(m) without x.

From signature to cell ​

(6)ρr=SHA256(σnr)∈{0,…,2256−1},wr=ρrmod25,Jr=1[keccak256(ρr)mod625=0].

wr is the winning cell and Jr says whether the jackpot fires.

Proposition 3 · Modulo bias

Let N=2256 and assume ρr is uniform. Since N=25Q+11 with Q=⌊N/25⌋, cells 0 to 10 win with probability (Q+1)/N and cells 11 to 24 with Q/N. The total variation distance from a fair 25-sided die is δTV=11⋅1425⋅2256≈5.3×10−77. For the jackpot, N=625Q′+561 and its probability is 1625+64625N.

(7)Pr[wr=k]=Q+1[k<11]N,|Pr[wr=k]−125|≤1425N.

Proof. Among 0,…,N−1, residues 0 to 10 occur Q+1 times and residues 11 to 24 occur Q times. Then Q+1N−125=1425N and QN−125=−1125N; half the sum of the eleven positive and fourteen negative deviations is the distance above. The same count with 625 and remainder 561 gives the jackpot. ∎

Modelling SHA-256 and keccak-256 as random oracles, the winning cell and the jackpot are independent up to the same negligible terms: Pr[wr=k, Jr=1]=115625+O(2−256).

Settlement and liveness ​

settle(r, σ) can be called by anyone at any time in [cr, cr+Δ) for a round with bets. A keeper calls it a few seconds after each close; in tests settlement lands 3 to 5 seconds after cr and costs about 250,000 gas including the pairing check.

Proposition 4 · No outcome control

No party can change wr or Jr. A party can only refrain from settling; if every party refrains until cr+Δ, each player gets their whole stake back and no fee is charged.

Proof. By Lemma 1 the beacon does not exist while bets are open, by Lemma 2 the contract accepts only the unique signature, and (6) is a deterministic function of it. Settlement after cr+Δ reverts, and from that moment refund(r) pays each player their stake. ∎

Withholding settlement is not a profitable veto: the beacon is public within seconds of the close, and every winner of the round has a reason to submit it.