Dice'ta provably fair nasıl çalışır
Cloudbet'te Dice'ı nasıl oynayacağınızı ve her atışın provably fair olduğunu nasıl kontrol edeceğinizi burada bulabilirsiniz.
Dice nasıl oynanır
Dice, rastgele üretilen bir sayının seçtiğiniz bir hedefin üzerinde mi yoksa altında mı kalacağına bahis yaptığınız hızlı tempolu bir oyundur. Bir hedef sayı seçin ve sonucun bu hedefin üzerinde (Roll Over) mi yoksa altında (Roll Under) mı kalacağına bahis yapacağınızı belirleyin. Hedefiniz aralığın kenarına ne kadar yakınsa, kazanma olasılığınız o kadar düşer — ama kazandığınızda ödemeniz o kadar büyük olur. Bahsinizi yerleştirdiğinizde sonuç anında açıklanır.
Cloudbet Originals Dice
Cloudbet'in kendi Originals Dice'ı 0,00 ile 100,00 arasında bir hedef aralığı, %99 RTP, x9.800'lük maksimum çarpan kullanır ve 0,01 $ ile 10.000 $ arasında bahisleri kabul eder. Bir dizi turu otomatikleştirmek için Auto Bet kullanılabilir.
Bu sayfa, Dice'ın doğrulanmış bir rastgele sayıyı atışınıza nasıl dönüştürdüğünü ele alır. Altta yatan rastgeleliğin kendisinin nasıl üretilip güvence altına alındığı — sunucu çekirdeği, müşteri çekirdeği, nonce, hashleme — için provably fair sayfamıza bakın. Dice: Golden Ticket mi oynuyorsunuz? Zar değerini burada açıklanan şekilde örnekler, ardından üzerine bir Golden Ticket değeri ve çarpanı ekler.
Rastgele sayıları bir Dice sonucuna dönüştürmek
Dice'ın sonucu, diğer her Cloudbet Original'ı gibi aynı doğrulanabilir rastgeleliğe kanıtlanabilir şekilde bağlı olmalıdır. Bir turun rastgele sayı dizisi üretildikten sonra (SHAKE256 aracılığıyla — bu süreç için provably fair sürecine bakın), Dice bunu şöyle kullanır:
Diziden 0 ile 10.000 arasında (dahil) tam bir sayı örneklenir, ardından 100'e bölünür — bu, iki ondalık basamaklı, 0 ile 100 arasında bir değer verir. Bu, Dice sonucunuzdur.
Örnekleme nasıl çalışır
Dice'ın 10.001 olası sonucu vardır (0,01 adımlarla 0,00'dan 100,00'a kadar), bu yüzden bu oyun için P = 10.001'dir.
Bu 10.001 sonuç arasından adil bir seçim yapmak için Dice, provably fair rehberimizde açıklanan aynı reddetme örneklemesi yöntemini kullanır — rastgele 32 bitlik bir sayı üretilir, ardından sonucu çarpıtacaksa reddedilip adil biri bulunana kadar yeniden örneklenir. Bu sayı daha sonra 0 ile 10.000 arasında bir değere ulaşmak için 10.001'e göre bir modulo işleminden geçirilir ve bu da nihai sonuç için 100'e bölünür.

Oynanış
Sonuç, siz bahsinizi yerleştirmeden önce sunucuda üretilir ve kilitlenir — tur başladıktan sonra fark edilmeden değiştirilemez veya değişiklik yapılamaz. Bahis yaptıktan sonra, seçtiğiniz eşik, doğru tahmin edip etmediğinizi belirlemek için bu önceden üretilmiş sayıyla karşılaştırılır.
Dice'ın provably fair niteliğinin bağımsız doğrulaması için kod
Bu program, Cloudbet'in Dice uygulamasıyla birebir aynıdır. Kendi sonuçlarınızı doğrulamak için Sunucu Çekirdeğinizi, Müşteri Çekirdeğinizi ve Nonce'unuzu girin. Not: Cloudbet'te bir oyunun Sunucu Çekirdeğini açığa çıkarmak için önce yeni bir Sunucu Çekirdeğine geçmeniz gerekir.
Bağımlılıklar:
npm install js-sha3
Kod:
// 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
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 getDiceResult(rng) {
const diceMinValue = 0;
const diceMaxValue = 10000;
let number = sampleFromRange(diceMinValue, diceMaxValue, rng);
number = number / 100; // So that the dice's value ranges from 0 to 100
return number;
}
// Sample a number between 'min' to 'max' (inclusive) using Rejection Sampling
function sampleFromRange(min, max, rng) {
const P = max - min + 1
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 + min;
}
// Example usage
(function main() {
let nonce = 1;
if (usingCustomData) { nonce = myNonce; }
const { serverSeed, commitment } = generateServerSeed();
const clientSeed = getClientSeed();
const roundSignature = createRoundSignature(serverSeed, clientSeed, nonce);
const numbersToGenerate = 1 * 2; // We need 1 random number, however due to rejection sampling we may need more
const rng = createRandomNumberSequence(numbersToGenerate, roundSignature);
const diceValue = getDiceResult(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('🔁 Round Signature (can be verified after the game):', roundSignature);
console.log('🎯 Dice landed on:', diceValue);
})();


