Introducing Fair And Square - A Better Open-Source RNG Standard with On-Chain Settlement
A trustless and transparent alternative to legacy RNG systems.
Randomness lies at the heart of countless online experiences — from gaming and gambling to decentralized applications and loot-based economies. But not all randomness is created equal. In a space where trust and transparency are paramount, traditional systems fall short.
Today, we’re proud to unveil Fair and Square, an open-source, fully on-chain RNG (Random Number Generation) standard that sets a new bar for verifiable fairness, transparency, and performance.
The Problem with Traditional RNG: Why “Provably Fair” Isn’t Enough
For years, “provably fair” systems have been the industry’s response to skepticism around randomness. These systems typically rely on a combination of:
A server seed (controlled by the operator),
A client seed (submitted by the user), and
A hash-based verification after the result is generated.
While this model is a step up from opaque back-end randomness, it still has inherent flaws:
Off-chain computation introduces the potential for manipulation or bugs.
Centralized seed control puts too much trust in the operator.
Verification is after-the-fact, rather than enforced at the point of settlement.
In other words, “provably fair” is still provably trust-based.
Enter Fair and Square: RNG That’s Trustless by Design
Fair and Square eliminates the weaknesses of traditional systems by shifting RNG computation and settlement directly on-chain, ensuring outcomes are:
Tamper-proof,
Publicly auditable, and
Immutable at the moment of execution.
Let’s break down the architecture.
🔒 How Fair and Square Works
At the core of our RNG standard is a smart contract that governs results, random distribution, and event validation. Here are the components that make this system powerful:
1. Multi-Chain Block Hash as Server Seed
Rather than relying on a single source of truth, Fair and Square uses the next block hash from a series of chains (e.g., Ethereum, Arbitrum, Bitcoin etc.) as its server seed. This creates a distributed randomness source with increased entropy that no single actor can control — not even us.
2. Client Seed Hash (SHA-256)
Each user session includes a client seed which can be generated automatically or manually set by the user. This seed, hashed using SHA-256, personalizes each RNG outcome and ensures individual fairness.
3. On-Chain RNG Execution
All computations — from fetching the block hash to generating the final random number — happen on-chain via our Fair and Square smart contract. This eliminates back-end processing entirely and enables instant, auditable results.
4. On-Chain Storage of Results
Every open, validation, and random value is stored immutably on-chain, meaning it’s always accessible for public audit and analysis. Zero trust required.
Why Fair and Square is a Game Changer
Here’s how Fair and Square stacks up against traditional “provably fair” systems:
RNG Computation
Provably Fair: Happens off-chain, typically on a centralized backend server.
Fair and Square: Entirely on-chain, eliminating back-end trust issues.
Trust Model
Provably Fair: Requires some level of trust in the operator's honesty.
Fair and Square: Trustless by design. Everything is enforced by smart contracts.
Source of Randomness
Provably Fair: Combination of server and client seeds, controlled or influenced by the operator.
Fair and Square: Uses unpredictable block hashes from multiple blockchains for tamper-resistant entropy.
Tamper Resistance
Provably Fair: Moderate. Verification is possible, but manipulation isn’t entirely preventable.
Fair and Square: High. On-chain logic guarantees immutable, verifiable outcomes.
Transparency
Provably Fair: Users can verify the result after it happens.
Fair and Square: Results are generated and stored on-chain, auditable in real-time and forever.
Web3 Compatibility
Provably Fair: Built for legacy systems and adapted to Web3 with limitations.
Fair and Square: Built natively for Web3 games, DeFi, and decentralized apps.
Made For Our Ecosystem
Fair and Square is the RNG foundation for all of our projects, including:
🏰 Loot Dynasty — where pack openings are provably tamper-proof.
🐕 Houndrace — where race outcomes are settled using our RNG on-chain.
And more titles to come under our gaming ecosystem.
Optimized for Alpha Dune Network
By moving the Fair and Square system to Alpha Dune Network, our proprietary high-speed blockchain, we gain the best of both worlds:
Blazing-fast execution,
Increased throughput, and
Layered security by sourcing randomness from multiple chains.
This makes Alpha Dune the perfect home for Fair and Square — ensuring it can scale without compromising on transparency or decentralization.
True Open-Source Randomness
Fair and Square isn’t just a feature — it’s a standard. We will open this protocol to our community so that other builders can adopt it for:
Loot-based mechanics
On-chain games
Web3 gambling apps
DeFi randomness needs
You can trust it. You can audit it. You can build with it.
Code Example for Loot Dynasty
Check out a high-level look at the RNG implementation:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "../deps/Ownable.sol";
error NotEditable();
error Forbidden();
contract LootKingdom is Ownable {
event OpensValidated(
bytes32 hashkey,
uint32[] packIds,
uint256[] orderIds,
uint256[] randoms
);
struct Pack {
uint256[] prizes;
uint256[] prices;
bool editable;
}
mapping(uint256 => Pack) public packs;
mapping(address => bool) public validators;
address public houseAddress;
constructor(address _houseAddress) Ownable(msg.sender) {
houseAddress = _houseAddress;
}
function setPack(
uint32 packId,
Pack calldata pack
) external onlyOwner {
if (packs[packId].prizes.length != 0 && !packs[packId].editable) {
revert NotEditable();
}
packs[packId] = pack;
}
function setWhitelist(address[] calldata proposedValidators) external onlyOwner {
for (uint i; i < proposedValidators.length; ++i) {
validators[proposedValidators[i]] = !validators[proposedValidators[i]];
}
}
function setAllowedEditAccess(
uint32 packId
) external onlyOwner {
packs[packId].editable = !packs[packId].editable;
}
function batchValidateOpens(
bytes32 blockHash,
uint32[] calldata packIds,
uint256[] calldata orderIds
) external {
if (!validators[msg.sender]) {
revert Forbidden();
}
uint256[] memory randValues = new uint256[](orderIds.length);
uint256 rand = uint256(blockHash);
for (uint256 i; i < orderIds.length; ++i) {
randValues[i] = rand % packs[packIds[i]].prizes[packs[packIds[i]].prizes.length-1];
}
emit OpensValidated(blockHash, packIds, orderIds, randValues);
}
}
Final Thoughts
Fair and Square represents a leap forward in how we think about randomness in decentralized systems. It’s not just provably fair — it’s verifiably final, secure, and trustless by design.
The age of centralized RNG is over. The future is Fair and Square.