如何保证每个游戏的公平性?
我们的可证明公平系统通过使用加密方法确保公平性,特别是通过使用未来挖出的EOS区块。我们通过将预定的服务器种子与未来的EOS区块ID组合来为每个游戏生成随机结果。根据游戏模式,服务器种子哈希和EOS区块号通常在游戏开始前显示,以确保所有结果都是预先确定的。
Overview
In our Jackpot game, each participant places a bet. Each bet allocates a continuous ticket range in the order bets arrive (e.g., if the first player bets 100, their range is 0–99, the next 200, their range is 100–299, etc.). The more you bet, the larger the portion of 0–100 you cover.
Once bets close, a random percentage from 0 to 100 (rounded to six decimal places) is generated using the server seed and the EOS block. We reveal our server seed after the round ends, so anyone can verify the exact roll number themselves.
typescript
1function generateTicketValue(
2 serverSeed: string,
3 clientSeed: string,
4 nonce: number | string,
5 range: { min: number; max: number; fixed: number },
6): number {
7 const chanceHash = `${serverSeed}-${clientSeed}-${nonce}`;
8 const percentage = new Chance(chanceHash).floating(range) / 100;
9 return percentage;
10}typescript
1import { createHmac } from 'crypto';
2
3function deterministicShuffle<T>(items: T[], seed: string): T[] {
4 const shuffled = [...items];
5 for (let i = shuffled.length - 1; i > 0; i--) {
6 const hash = createHmac('sha256', seed)
7 .update(String(i))
8 .digest('hex');
9 const j = parseInt(hash.substring(0, 8), 16) % (i + 1);
10 [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
11 }
12 return shuffled;
13}
14
15// Usage:
16const shuffleSeed = `${serverSeed}:${clientSeed}:shuffle`;
17const shuffledBets = deterministicShuffle(bets, shuffleSeed);
18// Tickets are then assigned in shuffledBets orderJackpot Example
- Your bet secures a slice of the 0–100 range proportional to your wager amount.
- We generate a random percentage (0–100, six decimals) using the server seed and the EOS block.
- Whoever's ticket range includes that percentage wins the pot.
- Suppose three bets have been placed in order: 100, 200, and 700 (total pot = 1,000).
- A random percentage (e.g., 36.42%) is generated from our provably fair method.
- We multiply 36.42% by 1,000, giving a "winning ticket" value of 364.2.
- Ticket ranges: 0–99 (first bet), 100–299 (second), 300–999 (third). Since 364.2 falls in 300–999, the third bet wins.
- Because the server seed, public seed, and EOS block are revealed, anyone can replicate the result.


