The market for randomness
Choice is the cornerstone of markets, and drives innovation through competition between service providers. In order to get the largest share of customer dollars, companies are incentivized to out-compete others by providing the product with the best market fit.
This means that those with skin in the game must constantly be looking to improve, both against what they have done in the past, but also against what their competitors are doing now or might do in the future.
Not only do services get better thanks to this mechanic, they also get less expensive. If customers don’t like the price of a good or service, they have the choice to move elsewhere. With competition, market forces can honestly balance cost against what is being offered.
Thanks Capitalism!
A market for randomness
True randomness requires that there be no pattern or predictability to events.
It is so important to humans that objects identified as dice have been found all over the globe dating back thousand of years and into pre-history, and with all this time playing with randomness, we’ve found many uses for it.
Games and gambling frequently employ randomness in the form of selecting winners and losers (like in roulette, or straws), or in deciding the abilities of players like the dice in Monopoly that move players around the board.
The government in ancient Athens used random selection for its members. Various committees managing important affairs were formed and reformed regularly by drawing from the citizens at random, much like jury duty is assigned today.
The Athenians saw random selection as the best way to allign with their principle of equality.
Even with all this time playing with randomness the only true source that we have found is nature, but when have you known humans to let a little nature limit their imagination?
Let’s get into the two best ways of introducing randomness to your Web3 project.
- Verifiable random functions
- Quantum random number generation
Cryptographic proof of randomness
VRF stands for “Verifiable Random Function”. These functions are composed of three parts:
- A generator function which makes a public/secret key pair k bits in length.
GEN(1k) = (PK,SK)
2. A main function that outputs a variable about the randomness based on the secret key.
FSK(x) = (r,π)
3. A verifier function that verifies that the randomness was calculated correctly based on the public key.
VERPK(x,r,π) = True/False
Along with a number, VRFs also output a cryptographic proof about how that number was generated.
The proof makes computation reproducible, enabling trustless consensus verification.
However, VRFs are technically pseudo-random number generators (PRNGs) because of a mechanic that causes the numbers to start repeating after a long enough period of time.
When you use algorithms to generate randomness, their programmatic method inherently follows a structure that results in patterns given enough time; they more approximate randomness than really generate it (hence PRNG).
Also, PRNGs security is dependent on limitations in computational power, since they’re deterministic algorithms.
We must return to the natural world for true randomness.
Quantum randomness
“The quantum theory basically tells us that in empty space, you still have… virtual particles forming and disappearing… And that’s what we’re seeing… I think that that’s why people are quite fascinated that from nothing comes this sequence of infinite random numbers” — Professor Koy Lam of the Quantum Optics Group of the Australian National University
At the ANU, they create this empty space by holding a vacuum inside a gold box, and then use a laser to detect the particles phasing in and out of existence. That measurement is turned into binary code used to generate random numbers.
Random input yields truely random output.
Digitizing physics
The ANU Quantum Random Number Generator experiment is specifically optimized to benefit cryptography, and is set up to be secure even in the presence of an adversary.
The QRNG looks for noise in a vacuum. Think of this noise as a kind of static, which is made up of electromatic, thermal and quantum information. The cool thing is that the ratio of what makes up the noise follows a predictable distribution known as the quantum-to-classical-noise ratio, which we’ll see is a key factor in the security of the data collected.
The thermal and electromagnetic signals are comparatively easy for an adversary to monitor or control. However in order to manipulate the quantum signal, humans would need to know how to apparate matter remotely, which isn’t on the table at the moment.
Thus, the scientists are able to use the quantum-to-classical-noise ratio to cancel out what could possibly be predicted or controlled by an adversary, and generate numbers based only on the quantum data that their laser is detecting. Currently, this yields random bits of information at a rate of 5.7 Gbits/s — faster than the bandwidth available to broadcast the data.
The ANU API delivers new and unique random numbers for every call it receives, and has been doing just that for the last 10 years. There is a constant stream of data coming from the experiment that results in an answer unknown to anyone before a request is fielded.
From Australia, to the world, to Web3
On top of their world-class research into quantum physics, the scientists at the Australian National University have been providing random number generation to Web2 for the last ten years. However, the technical challenge of integrating a 3rd-party oracle node into the mix stopped them from being able to provide the same service to Web3 blockchain projects.
With API3’s first-party Airnode taking down barriers, ANU was able to easily expand their service base to Web3.
Now smart contracts can make requests to their API and receive a truly random output in the forms of numbers, texts, colors, and so on.
Compared to the incumbent VRF options, API3 QRNG has some cool pros:
- Free-to-use.
- Available on ten chains VRF isn’t, and three chains VRF is (full list here).
- True randomness thanks to entropy.
- Breaks up a near ecosystem-wide monopoly on random number generation, which can only benefit devs and dApp users in the long-run.
A richer Web3 ecosystem
With API3 QRNG, developers on 10 new chains have access to random number generation. 3 others now have the choice between API3 QRNG and VRF.
There will undoubtedly be critiques, but I’m excited to see how a new player entering the game changes the board. So pop some popcorn, and let’s watch randomness work its magic — innovation is unpredictable.
More about QRNG
Demo project: Quantumon — Quantumon uses QRNG to generate NFTs with random characteristics
Tutorial: Building Quantumon — Ashar Shahid walks you through how to build this project.
QRNG Documentation — Learn about how to implement QRNG in your dApp.
New to trading? Try crypto trading bots or copy trading