Công bằng có thể kiểm chứng
Mọi kết quả BC Originals đều có thể kiểm tra bằng seed máy chủ, seed máy khách và nonce. Chọn một trò chơi để xem cách tính kết quả.
Patti
Xác thựcIs The Game Fair?
Every round has a pre-generated SHA256 hash. The hashes form a chain and are released in reverse order, each corresponding to one round of the game. The SHA256 of a round's hash equals the hash of the previous round, so the results cannot be changed once the chain is published.
The cards of a round are calculated from its hash and a salt. The salt is the hash of Bitcoin block 790,100 (0000000000000000000301e2801a9a9598bfb114e574a91a887f2132f33047e6), which had not been mined when the chain was published.
How Are the Results Calculated?
- seed = HMAC_SHA256 with the round's hash (decoded from hexadecimal into bytes) as the message and the salt as the key.
- Shuffle the 52 cards by the seed (first shuffle), then shuffle the result again by the SHA256 of the seed (second shuffle).
- The first six cards are dealt: Player A gets the 1st, 3rd and 5th cards, and Player B gets the 2nd, 4th and 6th cards.
function seedGenerator(hash, salt) {
const hmac = CryptoJS.HmacSHA256(CryptoJS.enc.Hex.parse(hash), salt);
return hmac.toString(CryptoJS.enc.Hex);
}
function createNums(allNums, hash) {
const nums = [];
let h = CryptoJS.SHA256(hash).toString(CryptoJS.enc.Hex);
allNums.forEach((c) => {
nums.push({ num: c, hash: h });
h = h.substring(1) + h.charAt(0);
});
nums.sort(function (o1, o2) {
if (o1.hash < o2.hash) {
return -1;
} else if (o1.hash === o2.hash) {
return 0;
} else {
return 1;
}
});
return nums;
}