Pumpにおけるプロバブリーフェアの仕組み
CloudbetでのPumpの遊び方と、各ラウンドの故障ポンプがプロバブリーフェアであることを確認する方法をご紹介します。
Pumpの遊び方
Pumpは、行けるところまで攻めるタイプのゲームです。何か(Cloudbet版では風船)をポンプで膨らませていくたびに、倍率が上昇していきます。いつでもキャッシュアウトして勝利金を確定できますが、膨らませすぎると風船が割れてしまい、ベットした金額を失います。開始前には通常、どこまで安全に進められるかと倍率の上昇スピードのバランスを決める難易度レベルを選びます。
ベットを確定したら、Pumpを押して風船を1段階ずつ膨らませます。ポンプが成功するたびに、獲得できる可能性のある配当が上昇します。ポンプの後にはいつでもキャッシュアウトを押して、その時点の倍率を確定できます——あるいは、より大きな倍率を狙ってポンプを続けることもできます。次のポンプがそのラウンドの故障ポンプに当たった場合、風船はその場で割れてしまい、そのラウンドは配当なしで終了します。
Cloudbet Originals Pump
CloudbetオリジナルのPumpには、Easy・Medium・Hard・Expert・Masterの5つの難易度レベルがあり、そのラウンドの25回のポンプのうち何回が「故障」(風船を割ってしまうもの)かをコントロールします。RTPは99%、最大勝利額は$1,000,000で、$0.01からベットできます。Autobetモードでは、ベット額、1ラウンドあたりのポンプ回数、利益・損失の上限、自動でプレイするラウンド数を設定できます——もちろん、手動プレイ(「Pump waits for YOUR input」)も常に利用できます。
サーバーシード、クライアントシード、ノンス、ハッシュ化、ラウンドシグネチャーの生成方法など、プロバブリーフェアの一般的な仕組みについては、Cloudbetのプロバブリーフェアガイドをご覧ください。以下では、その乱数列が具体的にどのようにPumpラウンドの結果になるのかを解説します。
乱数からゲームレイアウトへの変換
Pumpの25回分のポンプには、追跡できるようAからYまでのラベルが付けられています。

すべてのポンプは最初、非故障の状態から始まります。ゲームの乱数列の最初の数値を使って、インデックスによって非故障のポンプを1つ選び、それを故障状態にします。

そのポンプは非故障ポンプのリストから除外され、次の選定は残りのポンプの中からのみ行われます。

これを、そのラウンドの難易度レベルに設定された故障ポンプの数に達するまで繰り返します(ここではMedium=3回の例を示しています)。

そのラウンドのすべての故障ポンプが選ばれると、選定に使った数値そのものはもう不要になり、残るのはどのポンプが故障かという情報だけです。

ポンプは順番に(A、次にB、次にC……という具合に)1つずつ作動するため、実際に重要なのはプレイヤーが到達する最初の故障ポンプだけであり、それ以降のポンプは決して作動しません。そのため、レイアウトはその1つの該当するポンプだけに単純化されます。

技術的な詳細
非故障ポンプの数をPと呼びます。SHAKE256から得られる乱数バイト列は、4バイトの符号なし整数(0~2³²−1)に分割されます。どのポンプを故障にするか公正に選ぶため、リジェクションサンプリングをPに対して適用し、その余り(+1)を、故障にする非故障ポンプのインデックスとして使います。まだ故障ポンプが必要な場合は、選ばれたポンプがリストから除外され、Pが1減り、新しい数値がサンプリングされます——このプロセスを、そのラウンドの故障ポンプ数に達するまで繰り返します。
最終的な故障ポンプのレイアウトは、ラウンドが始まる前にサーバー側で生成・保存され、プレイヤーにすでに共有されているコミットメントを破ることなしに、その後変更することはできません。プレイヤーが押した各ポンプは、この事前に確定されたレイアウトと照合されます。
ご自身で検証する
Cloudbetの実際のPump実装に忠実な、簡単なNode.jsプログラムを用意しました——サーバーシード、クライアントシード、ノンス、難易度レベルを入力すれば、そのラウンドの結果を再現できます。(補足:Cloudbetでラウンドのサーバーシードを公開するには、すでに新しいシードペアにローテーションしている必要があります。)
// 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 game outcome to the game outcome 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
let myDifficultyLevel = 'easy'; // ✍️YOUR_INPUT✍️: Enter your difficulty level here (easy, medium, hard, expert, or master)
const usingCustomData = false; // Change this to true if you are using your own data
// These are the possible difficulty levels (and how many faulty pumps there are per difficulty level)
const faultyPumpsPerDiff = {
'easy': 1,
'medium': 3,
'hard': 5,
'expert': 9,
'master': 12
};
// 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); // shaker256 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
}
throw new Error("No more numbers in the random number sequence! Fix: make 'numbersToGenerate' larger.");
}
// Step 4: Generate indices of the faulty pumps
function pickUniquePositions(numOfFaultyPumps, totalPumps, rng) {
const available = Array.from({ length: totalPumps }, (_, i) => i);
const faultyPumps = [];
for (let i = 0; i < numOfFaultyPumps; ++i) {
const index = sample(available.length, rng);
faultyPumps.push(available[index]);
available.splice(index, 1); // Remove chosen pump from list of non-faulty pumps
}
return faultyPumps;
}
// 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() {
const totalPumps = 25;
let difficultyLevel = 'easy';
let nonce = 1;
if (usingCustomData) { difficultyLevel = myDifficultyLevel; nonce = myNonce; }
const numOfFaultyPumps = faultyPumpsPerDiff[difficultyLevel];
const { serverSeed, commitment } = generateServerSeed();
const clientSeed = getClientSeed();
const roundSignature = createRoundSignature(serverSeed, clientSeed, nonce);
const numbersToGenerate = 12 * 2; // We have at most 12 faulty pumps, however due to rejection sampling we may need more numbers
const rng = createRandomNumberSequence(numbersToGenerate, roundSignature);
const faultyPumps = pickUniquePositions(numOfFaultyPumps, totalPumps, rng);
let firstFaultyPump = Math.min(...faultyPumps); // Select the smallest/first faulty pump
firstFaultyPump += 1; // Increment the index so that it starts with 1, 2, 3, ... instead of 0, 1, 2
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('🎯 Difficulty level:', difficultyLevel);
console.log('💣 First faulty pump (zero-indexed, i.e., 1, 2, 3, ...):', firstFaultyPump);
})();
依存パッケージのインストールが必要です:
npm install js-sha3
