How the randomness works

Commit–reveal over Solana slot hashes

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. 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 from it. It does not accept a random number as an argument from anybody — not from the player, not from the operator service.

The order of events, which is the whole point

  1. A round opens. The program writes down a target slot in the future.
  2. The round plays out. The target slot has not happened yet, so its hash does not exist yet — nobody, including us, can know what it will be.
  3. Once that slot has been produced, the round is sealed: the hash is read out of SlotHashes and stored on the round's account.
  4. The round settles against the sealed value.

Because the target slot is fixed in step 1 and the hash only exists after step 2, there is no point at which anyone can look at the outcome and then decide whether to go ahead.

Sealing is permissionless

Step 3 is normally done by our operator service, within a second or two. But the instruction is open to anyone. If we went offline, or stalled a round because we did not like the look of it, any player — or any stranger — can send that instruction themselves and the round settles just the same. The app exposes this: if a round sits unsealed for too long, it offers you the button.

The window is finite. SlotHashes only keeps recent slots, so a round that nobody seals in time can no longer be settled against that slot and has to be re-locked to a new target. That costs time, and it does not hand anyone a choice about the result — the new target is in the future again.

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

← What SolRoyale is Open SolRoyale →

短版本:随机数不是我们选的,而且就算想选也选不了。它来自 Solana 自己的出块。 下面是长版本 —— 在一个要押真钱的玩法里,「相信我们」不算一个答案。

数从哪儿来

Solana 有一个叫 SlotHashes 的 sysvar:一个滚动窗口,装着最近若干个 slot 的哈希, 由验证者网络产生。我们的程序从里面读。它不接受任何人把一个随机数当参数传进来 —— 玩家不行, 运营方也不行。

顺序才是关键

  1. 开一局。程序在链上写下一个未来的目标 slot。
  2. 这一局打完。目标 slot 还没发生,它的哈希还不存在 —— 包括我们在内,没有人能知道那会是什么。
  3. 等那个 slot 产出之后,这一局被封存:从 SlotHashes 里把哈希读出来,写进这一局的账户。
  4. 按封存下来的值结算。

目标 slot 在第 1 步就定死,而哈希要到第 2 步之后才存在,所以不存在任何一个时刻, 有人能先看到结果再决定要不要继续。

封存这一步谁都能做

第 3 步通常由我们的运营服务在一两秒内完成。但那条指令是无许可的。如果我们掉线了, 或者看着某一局不顺眼故意拖着,任何玩家 —— 或者任何一个陌生人 —— 都可以自己发这条指令, 这一局照样结算。App 里就摆着这个入口:一局迟迟没封存,它会把按钮给你。

窗口是有限的。SlotHashes 只保留最近的 slot,所以没人及时封存的那一局, 就不能再按那个 slot 结算,必须重新锁一个新的目标。这会多花时间,但不会让任何人对结果有选择权 —— 新目标同样在未来。

自己核对一局

六个玩法是主网上同一个程序:

317Lud1kySc4NkJTDQvT6gBKEgJfbrB6PQR4kSrpS9AS

每一局都是它下面的一个公开账户,每一次结算都是一笔公开交易。App 里每局结束都直接给出 区块浏览器链接。读这些东西不需要我们配合、不需要我们的接口,也不需要账号。

这里没有声称的事

← SolRoyale 是什么 打开 SolRoyale →