Verifiable randomness for onchain games and finance on KUB. Provably fair, ownerless, and adversarially reviewed: every result is recomputable from public chain data. No oracle, no VRF service, no trusted operator.
Randomness comes from the hash of a future block, unknown to everyone (including the caller) at commit time. Settlement is permissionless and stays entirely on-chain.
Atomic grinding is impossible. Because reveal reverts until the next block is mined, an attacker cannot compute the result and revert on a loss inside one transaction. The most common on-chain gambling exploit is closed by construction.
A primitive that handles value should never overclaim, so we document exactly what it defends and what it does not. It has been tested and adversarially reviewed across multiple passes, with zero confirmed vulnerabilities so far. A formal third-party audit is still pending.
No package to install on-chain. Import one interface, point at the canonical address, and call two functions. Read the full integration guide, with ABI and frontend snippets →
// commit: take payment, reserve a future-block roll function commitMint() external payable { require(msg.value == PRICE); pending[msg.sender] = entropy.request(bytes32(uint256(uint160(msg.sender)))); } // reveal: permissionless, mints to the user, no re-roll possible function claimMint(address user) external { uint256 r = entropy.reveal(pending[user]); delete pending[user]; _mint(user, pickTier(r)); // grind-proof: payment already committed }
uint256 r = entropy.reveal(drawId); uint256 winning = r.digits(6); // 482917
uint256 r = entropy.reveal(spinId); uint8 pocket = uint8(r.pick(0, 37)); // 0 to 36
Derive as many independent values as you need from a single reveal with the MIT helper library. Each demo draw below commits and then waits for a real future block to seal, so it can't be rushed.
Every value is keccak256 of a real, unpredictable KUB block hash, so the output is uniformly distributed and nothing the caller controls can bias it. Roll a die hundreds of times from a single block and watch the faces level out. The one caveat is economic, not statistical: a block producer can bias a single block, so cap per-round value.
Connect a wallet and the draw runs the live DurianEntropy contract for real: request() then reveal(), two transactions, about 0.003 KUB. No wallet? Run a gasless read-only preview that reads the same block entropy.