How the randomness works
The short version: we do not choose the random number, and we could not choose it even if we wanted to. It comes from Solana's own block production, combined with a seed we commit to before anyone can know the result. Here is the long version, because in a game people are staking money on, "trust us" is not an answer.
Where the number comes from
Solana keeps a sysvar called SlotHashes: a rolling window of the hashes of recent
slots, produced by the validator network. Our program reads the slot hash from it itself; nobody
passes it in. The one other input is a secret seed that our operator service picks when a table or
round opens. Its hash is written on chain at that moment, and at settlement the program accepts the
seed only if it matches that hash. The result is derived from both.
The order of events, which is the whole point
- A table or round opens, and the hash of our service's seed is written on chain. From here on the seed cannot be changed.
- The outcome is locked: when an opponent joins a duel, or once a pool round's betting has closed, the program writes down a target slot two slots ahead. That slot has not happened yet, so its hash does not exist yet — nobody, including us, can know it.
- Once that slot has been produced, the round is sealed: the hash is read out of
SlotHashesand stored on the round's account. - Our service reveals the seed. The program checks it against the hash from step 1, computes the result from the seed and the sealed slot hash, and settles the round (in The Mine and the Lottery the payouts follow in separate transactions).
Because the seed is fixed in step 1 and the slot hash only exists after step 2, nobody can see the outcome while stakes can still be placed or taken back. (What stops anyone from quietly discarding a result after that is the seal — see below.)
Blackjack and Tower Duel are played after step 3. Once the slot hash is sealed, the deck — or where the bombs are — is fixed, and only then do the players make their moves. From that moment our service, which deals, knows the deck and the bombs. It cannot change them: after settlement the seed is public and anyone can recompute both. The house never takes a seat.
Anyone can seal
Step 3 is normally done by our operator service within a second or two. But the seal instruction
is open to anyone: any player, or any stranger, can send it. That matters because
SlotHashes only keeps recent slots, a few minutes' worth. A round that nobody seals in
that window can no longer use its target slot and has to be re-locked to a new one. Whoever knows the
seed could see a result coming and let the window lapse to get a second draw; sealing closes that door
for good, and because anyone can seal, nobody has to rely on us to do it. Every re-lock is also a
public transaction on the round's account.
In Blackjack and Tower Duel the app shows you a seal button if your joined table sits unsealed. Coin Flip and the pool games have no such button in the app, but their seal instruction is just as open: you can send it with any Solana tool.
Sealing fixes the random value; it does not pay anyone. Settling a round needs its seed, and only our service holds it (see below).
Checking a round yourself
All six games are one program on Solana mainnet:
317Lud1kySc4NkJTDQvT6gBKEgJfbrB6PQR4kSrpS9AS
Every round is a public account under it, and every settlement is a public transaction. The app links each finished round straight to a block explorer. You do not need our cooperation, our API, or an account to read any of it.
What this does not claim
- It does not claim the operator is trustless in every respect. Our service opens tables and rounds, seals them promptly, deals Blackjack and lays out Tower Duel from the committed seed, and settles every round by revealing that seed. The seed exists only on our side, so if our service stopped for good, nobody else could settle a duel that has been joined or a pool round that has locked, and their stakes would stay in the program's escrow. What you can do without us: cancel a table of yours that nobody has joined (after a one-minute cooldown, in all three duel games), seal a slot hash, and collect money the program already owes you — Mine payouts and Lottery prizes after a draw, and refunds from a cancelled Fortune Wheel or Mine round. A pool round that only one player has bet in is cancelled by our service, and the Lottery has no refunds.
- It does not claim validators cannot influence a slot hash at the margins. It claims that we cannot, that the target is fixed before the value exists, and that everything is on a public ledger where a pattern would show.
短版本:随机数不是我们选的,而且就算想选也选不了。它来自 Solana 自己的出块, 再加上一个我们在结果可知之前就已承诺上链的种子。下面是长版本 —— 在一个要押真钱的玩法里, 「相信我们」不算一个答案。
数从哪儿来
Solana 有一个叫 SlotHashes 的 sysvar:一个滚动窗口,装着最近若干个 slot 的哈希,
由验证者网络产生。我们的程序自己从里面读 slot 哈希,没有任何人能把它当参数传进来。另一个输入是
运营服务在开桌、开轮时挑的一个秘密种子:那一刻它的哈希就写上了链,结算时程序只接受和这个哈希对得上的种子。
结果由这两样共同推出。
顺序才是关键
- 开桌或开轮,运营服务种子的哈希写上链。从这一刻起种子就改不了。
- 锁定结果:对赌有人加入、或者彩池停止下注之后,程序在链上写下一个往后数两个 slot 的目标 slot。它还没发生,哈希还不存在 —— 包括我们在内,没有人能知道那会是什么。
- 等那个 slot 产出之后,这一局被封存:从
SlotHashes里把哈希读出来,写进这一局的账户。 - 运营服务公开种子。程序先拿它核对第 1 步的哈希,再用种子和封存下来的 slot 哈希算出结果、完成结算(矿区和乐透的派奖随后用单独的交易发出)。
种子在第 1 步就定死,而 slot 哈希要到第 2 步之后才存在,所以在还能下注或撤回的时候, 谁都看不到结果。(那之后谁也没法悄悄扔掉一个结果,靠的是封存,见下文。)
21 点和爬塔对战是在第 3 步之后才开打的。slot 哈希一封存,整副牌(或者雷的位置)就定了, 玩家随后才出牌、开格子。从那一刻起,负责发牌的运营服务知道整副牌和雷在哪,但改不了: 结算后种子公开,任何人都能把它们复算出来。庄家从不下场。
封存这一步谁都能做
第 3 步通常由运营服务在一两秒内完成。但封存指令是无许可的:任何玩家、甚至任何一个陌生人都能发。
这一点很重要,因为 SlotHashes 只保留最近几分钟的 slot。没人在这个窗口里封存的一局,
就用不了原来的目标 slot,只能重新锁一个新的。知道种子的一方可以提前算出结果、故意放过这个窗口换一次重抽;
封存把这扇门永久关上,而且谁都能封存,不必指望我们。每一次重新锁定也都是这一局账户上的一笔公开交易。
21 点和爬塔对战里,你的桌子有人加入后迟迟没封存,App 会给你一个封存按钮。翻币和三个彩池玩法 在 App 里没有这个按钮,但它们的封存指令一样是公开的,用任何 Solana 工具都能发。
封存只是把随机值定下来,不会付钱给任何人。结算一局需要它的种子,而种子只在我们的服务手里(见下文)。
自己核对一局
六个玩法是主网上同一个程序:
317Lud1kySc4NkJTDQvT6gBKEgJfbrB6PQR4kSrpS9AS
每一局都是它下面的一个公开账户,每一次结算都是一笔公开交易。App 里每局结束都直接给出 区块浏览器链接。读这些东西不需要我们配合、不需要我们的接口,也不需要账号。
这里没有声称的事
- 没有声称运营方在每个环节都不需要被信任。开桌开轮、及时封存、用承诺过的种子给 21 点发牌和给爬塔布雷、 公开种子结算每一局,都是我们的服务在做。种子只在我们这边,所以如果我们的服务永久停摆, 已有人加入的对赌、已锁定的彩池,别人都无法结算,本金会一直留在程序托管里。不靠我们你能做的是: 撤掉自己开的、还没人加入的桌子(三个对赌玩法都是过 1 分钟冷却即可)、 封存 slot 哈希、领回程序已经欠你的钱 —— 开奖之后的矿区派奖和乐透奖金,以及被取消的幸运转盘或矿区那一轮的退款。 只有一个人下注的彩池轮由我们的服务取消,乐透没有退款。
- 没有声称验证者在边缘情况下完全无法影响一个 slot 哈希。声称的是:我们不能, 目标在值存在之前就定死了,而且一切都在公开账本上 —— 真有规律会露出来。