หลักการทำงานของความยุติธรรมที่พิสูจน์ได้ใน Roulette

นี่คือวิธีเล่น Roulette บน Cloudbet และวิธีตรวจสอบว่าการหมุนแต่ละครั้งเป็นไปตามหลักความยุติธรรมที่พิสูจน์ได้

วิธีเล่น Roulette

Roulette เป็นเกมคาสิโนคลาสสิกที่คุณเดิมพันว่าลูกบอลที่หมุนจะตกลงตรงไหนบนวงล้อที่มีตัวเลข คุณวางเดิมพันหนึ่งรายการหรือมากกว่าบนโต๊ะตัวเลข จากนั้นวงล้อจะหมุนและลูกบอลจะถูกปล่อยลง เมื่อมันตกลงในช่องที่มีหมายเลขแล้ว นั่นคือเลขที่ชนะ การเดิมพันใดก็ตามที่ครอบคลุมเลขนั้นจะได้รับเงินรางวัล ส่วนที่เหลือจะแพ้

การวางเดิมพัน

คุณสามารถเดิมพันผลลัพธ์ได้หลายวิธี และสามารถรวมเดิมพันหลายแบบในรอบเดียวกันได้อย่างอิสระ เดิมพันภายใน (Inside bets บนตัวเลขเฉพาะ) จ่ายมากกว่าแต่ยากกว่าที่จะถูก เดิมพันภายนอก (Outside bets บนกลุ่มที่กว้างกว่า) จ่ายน้อยกว่าแต่ถูกบ่อยกว่า:

  1. Straight-up / Single Number (35:1): เดิมพันตัวเลขเดียว (0–36 หรือ 00 ใน American Roulette)
  2. Split (17:1): สองตัวเลขที่อยู่ติดกัน
  3. Street (11:1): สามตัวเลขในแถวเดียว
  4. Corner (8:1): สี่ตัวเลขที่พบกันที่มุม
  5. First Four / Top Line (8:1 European / 6:1 American): ครอบคลุม 0 (และ 00 ใน American), 1, 2, 3
  6. Six Line (5:1): สองแถวที่อยู่ติดกัน หกตัวเลข
  7. Column (2:1): หนึ่งในสามคอลัมน์แนวตั้ง
  8. Dozens (2:1): 1–12, 13–24 หรือ 25–36
  9. Red/Black, Odd/Even, High/Low (1:1 แต่ละแบบ)

European vs. American Roulette

Cloudbet มีให้เลือกทั้งสองเวอร์ชัน European Roulette มีเลขศูนย์เดียว (37 ผลลัพธ์ที่เป็นไปได้ RTP 97.30%) ส่วน American Roulette มีช่อง "00" เพิ่มอีกหนึ่งช่อง (38 ผลลัพธ์ที่เป็นไปได้ RTP 97%) ซึ่งเพิ่มความได้เปรียบของเจ้ามือเล็กน้อย เวอร์ชันที่คุณกำลังเล่นควรแสดงให้เห็นชัดเจนก่อนที่คุณจะวางเดิมพัน ทั้งสองเวอร์ชันมีโหมด Autoplay สำหรับการหมุนต่อเนื่องพร้อมมูลค่าชิปและจำนวนครั้งที่ตั้งไว้ล่วงหน้า

เมื่อวางเดิมพันแล้วและรอบตัดสินผล การเดิมพันที่ชนะจะได้รับเงินรางวัลโดยอัตโนมัติตามอัตราต่อรอง แล้วโต๊ะจะรีเซ็ตสำหรับรอบถัดไป

หน้านี้จะกล่าวถึงวิธีที่ Roulette แปลงลำดับตัวเลขสุ่มที่ยุติธรรมที่พิสูจน์ได้ให้กลายเป็นเลขที่ชนะ ส่วนวิธีที่ลำดับตัวเลขสุ่มนั้นถูกสร้างขึ้นตั้งแต่แรก ทั้ง Server Seed, Client Seed, Nonce, การแฮช, SHAKE256 ดูได้ที่คำอธิบายความยุติธรรมที่พิสูจน์ได้ของ Cloudbet

แปลงตัวเลขสุ่มให้กลายเป็นผลลัพธ์ Roulette

สำหรับ Roulette ระบบความยุติธรรมที่พิสูจน์ได้ต้องพิสูจน์ว่าเลขที่ชนะถูกเลือกด้วยความสุ่มที่ตรวจสอบได้ ไม่ใช่ถูกเลือกภายหลัง

กระบวนการนี้ง่ายมาก: ใน European Roulette ตัวเลขเต็มหนึ่งตัวระหว่าง 0 ถึง 36 จะถูกสุ่มจากลำดับตัวเลขสุ่ม นั่นคือเลขที่ชนะ ใน American Roulette ตัวเลขที่สุ่มได้อาจอยู่ในช่วง 0 ถึง 37 โดย "37" จะถูกแปลงเป็นเลขศูนย์คู่ "00" ส่วนผลลัพธ์ 0 ถึง 36 จะถูกใช้ตามที่เป็น

วิธีเลือกเลขที่ชนะ

ไบต์สุ่มที่สร้างโดย SHAKE256 (ดูที่หน้าความยุติธรรมที่พิสูจน์ได้ของเรา) จะถูกแบ่งออกเป็นจำนวนเต็มไม่มีเครื่องหมายขนาด 4 ไบต์ มีค่าตั้งแต่ 0 ถึง 2³²−1 เลขที่ชนะของ Roulette ถูกเลือกจากผลลัพธ์ที่เป็นไปได้ 37 แบบ (European) หรือ 38 แบบ (American) ดังนั้นในขั้นตอนด้านล่างนี้ P คือ 37 หรือ 38

เพื่อเลือกเลขที่ชนะอย่างยุติธรรมจากผลลัพธ์ P แบบนั้น เราใช้ Rejection Sampling (ดูหลักการทำงานของความยุติธรรมที่พิสูจน์ได้) แล้วนำตัวเลขที่ได้มา Modulo กับ P เศษที่เหลือจะกลายเป็นเลขที่ชนะ (สำหรับ American Roulette "37" จะแสดงเป็น "00")

แผนผังลำดับแสดงวิธีที่ระบบ Roulette ที่ยุติธรรมพิสูจน์ได้ของ Cloudbet ใช้ rejection sampling และการดำเนินการโมดูโลเพื่อกำหนดหมายเลขที่ชนะ

เมื่อสร้างขึ้นแล้ว เลขที่ชนะจะถูกบันทึกและซ่อนไว้ฝั่งเซิร์ฟเวอร์ ไม่สามารถเปลี่ยนแปลงหรือถูกแก้ไขโดยไม่ถูกตรวจจับได้หลังจากรอบเริ่มขึ้นแล้ว เมื่อคุณวางเดิมพันแล้ว มันจะถูกนำไปเปรียบเทียบกับเลขที่กำหนดไว้ล่วงหน้านี้เพื่อตัดสินผลของรอบ

ตรวจสอบผลลัพธ์ Roulette ของคุณเอง

เราเขียนโปรแกรม Node.js ขนาดเล็กที่ตรงกับการทำงานของ Roulette บน Cloudbet (ทั้ง European และ American) ใส่ Server Seed, Client Seed และ Nonce ของคุณเพื่อสร้างผลลัพธ์ของคุณขึ้นใหม่ (ข้อควรจำ: หากต้องการเปิดเผย Server Seed ของรอบบน Cloudbet คุณต้องได้ Rotate ไปเป็น 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 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.
const Version = Object.freeze({ AMERICAN: "american", EUROPEAN: "european" }); // Here the possible versions are listed
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 myRouletteVersion = Version.AMERICAN;   // ✍️YOUR_INPUT✍️: Enter your roulette version (either Version.AMERICAN or Version.EUROPEAN)
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
  }
  throw new Error("No more numbers in the random number sequence! Fix: make 'numbersToGenerate' larger.");
}

// Step 4: Draw from the random number sequence to calculate the game result
function getGameResult(rouletteVersion, rng) {
  let numOfOutcomes = 0;
  if (rouletteVersion === Version.EUROPEAN) {
    numOfOutcomes = 37;
  } else if (rouletteVersion === Version.AMERICAN) {
    numOfOutcomes = 38;
  }

  let result = String(sample(numOfOutcomes, rng))

  // Convert the result '37' to '00'
  if (result === '37') {
    result = '00';
  }
  return result;
}
// Sample a number from P number of outcomes using Rejection Sampling
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;
  let rouletteVersion = Version.AMERICAN;
  if (usingCustomData) { nonce = myNonce; rouletteVersion = myRouletteVersion; }

  const { serverSeed, commitment } = generateServerSeed();
  const clientSeed = getClientSeed();

  const roundSignature = createRoundSignature(serverSeed, clientSeed, nonce);
  const numbersToGenerate = 1 * 2; // We need 1 random number, but there is an improbable case we'll need two
  const rng = createRandomNumberSequence(numbersToGenerate, roundSignature);

  const value = getGameResult(rouletteVersion, rng);

  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(`🎯 Winning Number (in the ${rouletteVersion} version):`, value);
})();

คำอธิบายเกมที่ยุติธรรมที่พิสูจน์ได้เพิ่มเติม:

  1. ความยุติธรรมที่พิสูจน์ได้ใน Mines
  2. ความยุติธรรมที่พิสูจน์ได้ใน Pump
  3. ความยุติธรรมที่พิสูจน์ได้ใน Plinko
  4. ความยุติธรรมที่พิสูจน์ได้ใน Dice
  5. ความยุติธรรมที่พิสูจน์ได้ใน Dice: Golden Ticket
  6. ความยุติธรรมที่พิสูจน์ได้ใน Limbo
  7. ความยุติธรรมที่พิสูจน์ได้ใน Keno