Not all Random Number Generators are Created Equal: Here’s Why

Would you bet on a lottery where the numbers are not randomly picked? How about a game that has a biased pattern of rewarding in-game items? I bet you answered “no” to these questions. After all, no one wants to put all that time and money into something, only to end up with very little. Yet most of us always assume that lottery numbers are picked randomly. Or that in-game items are allocated fairly.

Reality may surprise you.

In the world of technology and Blockchain, randomness plays a pivotal role in ensuring fairness, security, and unpredictability. Whether you’re participating in an online lottery, trying to get allocated rare non-fungible tokens (NFTs), or playing a game for its rare game items, the need for truly random numbers is paramount.

This is where Random Number Generators (RNGs) come into play. However, not all RNGs are created equal.

To know if you are encountering true randomness, you need to understand what RNGs are, the problems with existing solutions, and what makes a good RNG.

What is a Random Number Generator?

A Random Number Generator (RNG) is a fundamental component of modern computing and Blockchain technology. It’s a tool that produces a sequence of numbers or values that does not follow any discernible pattern. There are three primary types of RNGs:

1. Pseudorandom Number Generators (PRNGs)

PRNGs generate numbers using algorithms and a seed value. While they appear random, they are actually deterministic and produce the same sequence of numbers if given the same initial seed.

Imagine using a password generator that spins up passwords that can be recreated because it was not randomly generated. That is the risk of using PRNGs. They are widely used in software applications but are not suitable for applications requiring true randomness.

2. True Random Number Generators (TRNGs)

TRNGs rely on physical processes, like electronic noise or radioactive decay, to generate truly random numbers. They provide a higher level of unpredictability compared to PRNGs, as these physical phenomena are expected to be random.

However, the physical processes that TRNGs rely on may exhibit certain patterns over a long enough time period, compromising its randomness. Furthermore, TRNGs are limited in speed, as sufficient entropy must be collected- i.e., the physical phenomena need to play out for the output to be truly random. This makes it difficult to apply TRNG solutions at scale.

3. Hardware Random Number Generators (HRNGs)

HRNGs are dedicated hardware devices that generate random numbers based on physical phenomena within the hardware itself. These hardware devices have constant access to a physical entropy source that generates statistically random signals. They offer a high degree of security and are often used in cryptographic applications.

However, just like all physical objects, HRNGs are subject to physical decay. As the HRNG goes through decay, the numbers generated are no longer random. This situation is hard to detect, making it difficult to know when the randomness is compromised.

Why Do We Need Random Number Generators?

There are many scenarios where randomness is needed. From gambling to network security, the emergence of Web3 projects and protocols has escalated the need for verifiable random number generators.

Let’s explore a few use cases where RNGs are a must and not a “nice-to-have”.

Ensure fair NFT allocations and pick unbiased lottery numbers

It seemed like a lifetime ago when Non-Fungible Tokens (NFTs) were highly sought-after commodities. Back then, NFTs that were unique and rare were selling for sky-high prices. While the NFT market currently remains bearish, this is a good opportunity to implement RNGs before the next bull run. RNGs provide a transparent and provably fair mechanism for distributing NFTs.

Furthermore, unique traits of an NFT are allocated in a random manner using RNGs. This not only safeguards the value of the NFT but also enhances trust among collectors and creators alike. Making NFTs a legitimate asset class in the eyes of the mainstream.

RNGs also play an instrumental role in conducting efficient and fair lotteries. Each number has an equal chance of being picked and is not influenced by past results. This ensures that every participant has an equal chance of winning, thus fostering transparency and trust in lottery draws.

Unbiased selection of block producers

Block producers are rewarded by the network for their work. Therefore, malicious actors are incentivized to tamper with the block producer selection process. The random number generation process in some Blockchain networks can be easily manipulated. For example, a network may use block hashes as the source of randomness. In such a situation, malicious actors can withhold the block, which negatively affects the network’s security.

RNGs are instrumental in randomly selecting block producers, reinforcing the decentralization of Blockchain networks, and preventing potential tampering. As the value of the network increases, it becomes more crucial to use RNGs in the selection process. Verifiably generating random numbers guarantees that block production remains a truly random process, preventing centralization tendencies.

Make Web3 games fun and credible

Gaming may be the next wave that brings in new users to Web3 and drives the next bull run. The most exciting games are fair and unpredictable. They always give each player hope of winning, knowing that a single win can land them that rare item that turns the tide.

RNG has the potential to make Web3 games fun and exciting. Knowing that each person has the same “luck” and that their skill is what sets them apart, will drive players to play harder at the game. Any disputes by players about the game can be resolved in a transparent and fair manner.

What Makes a Random Number Generator Great?

There are two components to a Random Number Generator (RNG). It needs to:

  1.  Be able to generate numbers
  2. Generate numbers that are verifiably random

Most users have no issues with finding an RNG that does point number 1. However, the true value-add is from doing point 2 well.

A great Verifiable Random Number Generator (RNG) produces random numbers that:

  1. Can be verified to be random
  2. Has a decentralized source of randomness (no single point of failure)
  3. Is able to withstand attacks

Let’s dive deep into each of these points.

Can be verified to be random

The output of an RNG is random if each number produced by the RNG is statistically independent of others, ensuring that selecting one random number does not affect the probability distribution of subsequent selections. Put simply, each number has an equal chance of being selected.

Furthermore, anyone can prove that the random numbers generated by an RNG are valid. This can be done by verifying the correctness of the hash output. The proof can be calculated to ensure its verifiability, and this is key to resolving disputes. This ensures that the RNG’s output remains consistent and dependable in scenarios where multiple random selections are required.

Has a decentralized source of randomness (no single point of failure)

A good RNG has decentralization at the core of its design. It does not have a single point of failure, ensuring it is highly resistant to manipulation. I.e., The output of the RNG is verified by a network of nodes, instead of a single source.

By distributing the generation process across multiple nodes in a decentralized network, it becomes nearly impossible for any single entity to exert undue influence, thus guaranteeing the integrity of the generated random numbers.

Is able to withstand attacks

RNGs are always open to attacks from malicious actors who want to manipulate the outputs in their favor. A good RNG is built to withstand attacks aimed at predicting or controlling the generated numbers.

Robust cryptographic algorithms and secure protocols are employed to safeguard the integrity of the RNG, making it a trustworthy source of randomness for a wide range of use cases.

Consequences of not using RNGs

We have established the benchmarks for a good RNG. But what if good RNGs are few and far between? What if games, Blockchain networks, and Decentralized Applications (DApps) do not see the need for RNGs and hence do not use them?

First, the network security will be compromised. If validators know that the block producer selection process is not random, they can manipulate outcomes that only benefit themselves. Compromising the integrity of the network and giving control of the network to these malicious actors.

Secondly, not using RNGs in games and NFT allocations means that rare in-game items and unique NFTs will be distributed according to a pattern. Players who are aware of the pattern will consistently receive benefits that far outweigh their skill set and the time they spend on the game.

Sensing that the game is rigged, honest players will lose interest over time and leave the game. Before long, the game will go into a downward spiral where players leave, and the value of in-game items drops leading to even more quitting the game.

Lastly, not using RNGs will stunt the growth of Autonomous Worlds, a concept where games are fully decentralized and owned by the players themselves. In the Autonomous World, the games are powered by Blockchain technology, and every in-game transaction can be verified on chain.

Instead of trusting the company that developed the game like what we see in Web2 games, players in the Autonomous World put their trust in the underlying Blockchain technology. However, if the game outcomes that rely on chance are found to be biased, the community will lose trust in Blockchain technology.

Related News:

ARPA Network Releases MainNet

VRRB Labs Raised Development Support for User-Friendly Blockchain Applications


About Author

Yemu Xu is a serial entrepreneur, investor and early adopter of crypto assets. He is co-founder at Coinbase-listed ARPA Network and Binance-listed Bella Protocol, as well as ZX Squared Capital, an option strategy--focused crypto hedge fund.