Dec 18, 2020

4 min read

Randomness in Debaseonomics: Mainnet Integration with Chainlink VRF

We are happy to announce that randomness in Debase is now being provided by the Chainlink Verifiable Randomness Function (VRF) on mainnet.

We are happy to announce that randomness in Debaseonomics is now provided by Chainlink VRF on mainnet, a move directly in line with our commitment to decentralization, security, reliability, and fairness of the protocol. Chainlink VRF uses a verifiable random number generating function to provide a secure and provably fair source of randomness based on a seed provided by users.

Our Stabilizer-pool 1 (SP1), which provides rewards to liquidity providers (LPs) at random (but not arbitrary) intervals, utilizes the Chainlink VRF solution (SP1 code can be found here). The random number provided by the VRF is used to sample from the values of a normal distribution, so the Debase rewards system mechanics have expected, parameterizable tendencies while still retaining some unpredictability.

The goal of a stabilizer-pool (s-pool) in our protocol is to stabilize the price of the algorithmic stablecoin DEBASE. SP1 is the first s-pool, which achieves this aim during positive rebase cycles by inflating part of the total supply held by LPs when a certain number (k) of positive rebases are hit (consecutively or otherwise), after which the rewards are paid out over a period of m equal time durations (or under certain circumstances until a non-positive rebase is hit). Once the threshold k is hit, and the rewards begin to distribute, the whole process starts over once again. The randomness in choosing the threshold helps incentivize consistency in the liquidity that is provided (in time) by disincentivizing the gaming of the rewards system.

The random threshold (k) is chosen by sampling the values of a normal distribution. We transform the random number provided by the VRF (r) by first passing on-chain an array A of size s, populated with integers, sampled from a modified normal distribution. Governance evaluates sampling integrity using statistical inference. After every rebase call, the random number generated from the VRF (r) is used to generate the threshold k using the following formula:

k = A [r modulo s]

If the k obtained is ≤ the number of positive rebases counted so far, then the rewards distribution begins and the positive rebase counter resets.

Chainlink VRF ensures that we have guarantees around security, reliability, and fairness. Using an off-chain random number generator (RNG) to sample a normal distribution is trivial; however, this setup can’t provide on-chain proof of randomness being tamperproof (making it insecure), or strong guarantees that it will not go off-line (making it unreliable). For example, the managers of the RNG process may be able to predict future values, opening it up to potential bias. Additionally, using sources of on-chain randomness (e.g., the lastest blockhash) to calculate a random number leaves it vulnerable to miner manipulation, thus making it gameable, and to some extent centralized.

Chainlink VRF users provide (ideally pseudo-random) seeds as inputs. VRF uses the seed to generate a random number, and the randomization process can be verified on-chain by referencing a cryptographic signature. This process creates strong security guarantees as the nodes can only produce a valid on-chain signature using the supplied seed, meaning they cannot tamper with the outcome. It also adds verifiable transparency and fairness to the protocol since reward distribution is equally unpredictable to all stakeholders. We can also expect high reliability from the VRF, due to multiple oracle nodes providing redundant coverage to minimize downtime.

In addition to the specific integration detailed above, in the future, we will explore how to use the VRF to sample from different probability distributions on-chain. For these reasons, Debaseonomics is happy to integrate Chainlink VRF as our source of RNG.

About Debaseonomics

Debaseonomics is a DeFi protocol that aims to create the first truly decentralized, governable algorithmic stable coin by using an architecture that allows for open-ended external stabilization through smart contracts called “stabilizer-pools” (s-pools), which are mediated by governance. This design can be used to overcome the problems faced by other algorithmic (and non-algorithmic) stablecoins, mainly the lack of being able to target price during negative rebase cycles and AMMs like Uniswap setting the price post-rebase in unintuitive ways. Learn more here.

About Chainlink

Chainlink is the most widely used and secure way to power universal smart contracts. With Chainlink, developers can connect any blockchain with high-quality data sources from other blockchains as well as real-world data. Managed by a global, decentralized community of hundreds of thousands of people, Chainlink is introducing a fairer model for contracts. Its network currently secures billions of dollars in value for smart contracts across the decentralized finance (DeFi), insurance and gaming ecosystems, among others.

Chainlink is trusted by hundreds of organizations to deliver definitive truth via secure, reliable data feeds. To learn more, visit, subscribe to the Chainlink newsletter, and follow @chainlink on Twitter.

Docs | Discord | Reddit | YouTube | Telegram | Events | GitHub | Price Feeds | DeFi | VRF