Kenoのプロヴァブリーフェアの仕組み
CloudbetでのKenoの遊び方と、各抽選がプロヴァブリーフェアであることを確認する方法をご紹介します。
Kenoの遊び方
Kenoは数字を選んで当てる抽選ゲームです。プレイヤーはボード上の数字から好きな数だけを選び、その後ゲーム側が独自に数字を抽選します。選んだ数字の的中数が多いほど配当は大きくなり、配当倍率は最初に選んだ数字の個数によって変わります。数字を選んでベットすると、すぐに抽選が行われ、的中した数字はその場で表示されます。
Cloudbet Originals Keno
Cloudbet独自のOriginals Kenoでは、40個の数字が並ぶボードを使用します。プレイヤーは1〜10個の数字を選び、ゲーム側は10個の数字を抽選します。RTPは99%で、$0.01からベット可能です。選ぶ数字が少ないほどボラティリティが高くなり、的中時の配当は大きくなります。逆に選ぶ数字が多いほど的中頻度は上がりますが、的中あたりの配当は小さくなります。複数ラウンドを自動で進行できるAuto Bet機能もご利用いただけます。
Kenoの抽選は、他のCloudbet Originalsと同様に検証可能な方法で生成されます。Server Seed、Client Seed、NonceがどのようにRound Signatureへ組み合わされ、SHAKE256によって乱数列が生成されるかについては、プロヴァブリーフェアの概要をご覧ください。このページでは、Keno固有の内容、つまりその乱数列が実際の抽選番号の組み合わせへと変換される仕組みについて説明します。
乱数をKenoの抽選結果に変換する仕組み
Kenoのボードには1から40までの数字が並んでいます。この40個の数字の中から、重複することなく1つずつ、合計10個の数字が抽選されます。

まだ抽選されていない残りの数字の個数をPと呼びます。Pは40からスタートし、数字が1つ抽選されるたびに1ずつ減っていきます。

10回の抽選それぞれについて、SHAKE256の出力から0〜4,294,967,295の範囲でランダムな4バイト(32ビット)の数値が生成されます。残りP個の数字の中から公平に1つを選ぶため、棄却サンプリング(棄却サンプリングについてのガイドをご覧ください)を適用し、その結果をPで割った余り(モジュロ)から次に抽選される数字の位置を求めます。まだ抽選すべき数字が残っている場合は、選ばれた数字がプールから除外されてPが1減り、同じ処理が繰り返されます。

この処理は、10個の数字すべてが抽選されるまで続きます。


ゲームプレイ
抽選される10個の数字はすべて、プレイヤーが数字を選ぶ前にサーバー側ですでに生成され、非公開の状態で保持されています。事前に共有されているCommitmentのおかげで、これらの数字が後から気づかれずに変更されることはありません。ラウンドが確定すると、プレイヤーが選んだ数字はこの事前に決定された数字の組み合わせと照合されるだけで、一致した数の分だけ配当が計算されます。
Cloudbet Kenoの結果を自分で検証するためのコード
Server Seed、Client Seed、Nonceを入力すると、ご自身の結果を検証できます。必要な依存関係を1つインストールし、実際に実行することで、ゲーム結果を再現できます。
注:Cloudbet上で終了したゲームのServer Seedを確認するには、あらかじめ新しいラウンドを開始している必要があります(新しいラウンドを開始すると、新しいシードペアに切り替わります)。
依存関係:
npm install js-sha3
コード:
// If you are running this yourself, then you can input your own data here
// You can then compare:
// 1) Cloudbet's provided Commitment to the Commitment outputted here. This proves that the Server Seed was not altered during gameplay.
// 2) Cloudbet's provided mine positions to the mine positions outputted here. This proves that your game's outcome was determined solely by the pre-game seeds and was not altered afterwards.
let myServerSeed = 'your_server_seed'; // ✍️YOUR_INPUT✍️: Enter your (unhashed) Server Seed here
let myClientSeed = 'your_client_seed'; // ✍️YOUR_INPUT✍️: Enter your Client Seed here
let myNonce = 1; // ✍️YOUR_INPUT✍️: Enter your Nonce here
const usingCustomData = false; // Change this to true if you are using your own data
// Load libraries
const crypto = require('crypto');
const { sha3_256, shake256 } = require('js-sha3');
// Step 1: Generate a Server Seed and Commitment
// And generate a Client Seed - either by player input or by the player's browser
function generateServerSeed() {
let seed = crypto.randomBytes(32).toString('hex');
if (usingCustomData) { seed = myServerSeed; }
const commitment = sha3_256(seed);
return { 'serverSeed': seed, 'commitment': commitment };
}
function getClientSeed() {
let seed = crypto.randomBytes(32).toString('hex');
if (usingCustomData) { seed = myClientSeed; }
return seed;
}
// Step 2: Create a Round Signature with SHA3 using a Server Seed, Client Seed and Nonce
function createRoundSignature(serverSeed, clientSeed, nonce) {
return sha3_256(`${serverSeed}:${clientSeed}:${nonce}`);
}
// Step 3: Create a SHAKE256 stream generator from a Round Signature.
// To simplify this example program, this function doesn't create a stream, but instead a sequence of custom length.
function* createRandomNumberSequence(numbersToGenerate, roundSignature) {
const numOfBytes = 4 * numbersToGenerate; // 4 bytes (32 bits) per random number we generate
const byteStream = shake256.create(8 * numOfBytes); // shake takes bits as input
byteStream.update(roundSignature); // Use the Round Signature to seed the generator
const buf = Buffer.from(byteStream.digest()); // The Buffer class lets us package every 4 bytes into one 32-bit integer
for (let i = 0; i < numbersToGenerate; i++) {
yield buf.readUInt32BE(i * 4); // Read buf in 4-byte steps
}
}
// Step 4: Pick a number of unique positions
function pickUniquePositions(numOfPicks, totalPositions, rng) {
const available = Array.from({ length: totalPositions }, (_, i) => i);
const picks = [];
for (let i = 0; i < numOfPicks; ++i) {
const index = sample(available.length, rng);
picks.push(available[index]);
available.splice(index, 1); // Remove chosen pump from list of non-faulty pumps
}
return picks;
}
// Rejection sampling for fair results
function sample(P, rng) {
const maxAcceptable = Math.floor(0x100000000 / P) * P;
// Rejection sampling
let rand;
do {
rand = rng.next().value;
} while (rand >= maxAcceptable);
// Modulo operation
const sampled_number = rand % P;
return sampled_number;
}
// Example usage
(function main() {
let nonce = 1;
if (usingCustomData) { nonce = myNonce; }
const numOfHits = 10;
const totalPositions = 40;
const { serverSeed, commitment } = generateServerSeed();
const clientSeed = getClientSeed();
const roundSignature = createRoundSignature(serverSeed, clientSeed, nonce);
const numbersToGenerate = totalPositions * 2; // We need at least one random number per position, but there is an improbable possibility we'll need two
const rng = createRandomNumberSequence(numbersToGenerate, roundSignature);
let hits = pickUniquePositions(numOfHits, totalPositions, rng);
hits = hits.map((value)=> value + 1 );
hits.sort((a, b)=>a-b);
console.log('📝 Commitment (shown before the game):', commitment);
console.log('🔒 Server Seed (revealed after the game):', serverSeed);
console.log('🎲 Client Seed:', clientSeed);
console.log('🔢 Nonce:', nonce);
console.log('🔁 Round Signature (can be verified after the game):', roundSignature);
console.log(`🎯 Hits:`, hits);
})();
