Core Principle
All game results are generated through cryptographically verifiable random number generation (VRF):
import hmac
import hashlib
def generate_result(server_seed, client_seed, nonce, game_type):
# 种子组合与HMAC-SHA256计算
message = f"{client_seed}:{nonce}".encode()
h = hmac.new(server_seed.encode(), message, hashlib.sha256)
hex_digest = h.hexdigest()
# 转换为整数(取前8字符避免溢出)
random_int = int(hex_digest[:8], 16) # 0~4,294,967,295
if game_type == "integer":
return integer_game_result(random_int)
else:
return float_game_result(random_int)1. Integer Game (0/1) Result Generation
Generation Process

Verification Formula
Technical Specifications
Input Sources
Triple-seed system (server seed + client seed + nonce)
Hash Algorithm
HMAC-SHA256 (collision resistance > 2¹²⁸)
Output Range
Deterministic binary output {0, 1}
Bias Control
Floating-point error eliminated via modulo operation
Verification Tools
Web calculator/SDK provided
Verification Example
2. Floating-Point Game (0.1-9.9) Result Generation
Generation Process

Verification Formula
Distribution Guarantee
Statistical Validation
Mean
5.0
4.997
Standard Deviation
2.87
2.869
χ² Test
p>0.99
p=0.998
Min/Max
0.1/9.9
0.1/9.9
Verifiability Assurance System
Triple-Layer Verification
Pre-commitment Verification
On-chain Result Recording
Public Verification Tool
Anti-Manipulation Features
Seed Control Separation
Server seed: Secured by POFG smart contract (commit-reveal scheme)
Client seed: Submitted by player before game start
Nonce: Auto-incremented per game round
Time-lock Mechanism
Post-audit Interface
This mechanism provides triple-layer assurance through cryptographic binding + decentralized verification + mandatory transparency, ensuring no single party (including POFG system) can manipulate outcomes. Players can independently verify game fairness using open-source tools.
Last updated