Prophet Integrates With Chainlink To Create A No-Loss Decentralized Lottery With Verifiable Randomness

Prophet
4 min readJan 19, 2021

Last week, we announced the launch of “The Offertory” decentralized lottery, which uses the Chainlink Verifiable Randomness Function (VRF) to obtain a secure, on-chain source of randomness. This verifiable randomness is then used to select lottery winners in a provably fair and unbiased manner, where neither users nor Prophet themselves can game or tamper with the outcome.

Today, we’ll go into more technical details of the integration, including how Chainlink VRF works and why we chose Chainlink as our oracle solution.

What Is PROPHET’s No-Loss Decentralized Lottery?

As you probably know, the Prophet protocol relies on trading volume to return positive yield to holders. The idea behind The Offertory lottery is to allow participants a chance to win part of a prize pool, consisting of an initial deposit amount as well as passive interest collected by the entries.

The Offertory is considered a “no-loss” lottery because users can reclaim their initial deposit (less on-chain fees).

Tickets are purchased in PROPHET and all transactions return more PROPHET to holders.

Winners are selected automatically and randomly from the pool of tickets purchased during the seven day collection period.

The Randomness Dilemma

Normally, it’s quite a challenge integrating a random number generator that’s provably-fair and tamper-proof. For example, off-chain RNG solutions are usually opaque and require unverifiable trust in the external RNG data provider to not have any special access to the source of randomness. On the other hand, on-chain RNG solutions like blockhash are subject to miner frontrunning, particularly as the value of the potential reward increases. That’s exactly where Chainlink comes in.

Chainlink VRF enables smart contracts to access randomness without compromising on security, usability, or transparency. With every new request for randomness, Chainlink VRF generates a random number and cryptographic proof of how that number was determined.

The proof is published and verified on-chain before it can be used by any consuming applications. This process ensures that the results were not tampered with or manipulated by anyone, including oracle operators, miners, users, and even smart contract developers. By generating the verifiable proof on-chain, Prophet ticket holders can be certain they have a fair chance at being selected as winners.

Chainlink Integration — Technical Details

In short, The Offertory smart contract provides a seed value to the Chainlink VRF oracle as part of its request for a random number.

This seed is unpredictable to the oracle and will be used to generate the random number. Each oracle then uses its own private keys to both generate the randomness (along with the seed) and to provide an on-chain signature as proof of its secure generation. After the results and proofs are published on the chain, the oracle’s public key and provided seed are used for verification of the VRF process.

This method takes advantage of the famous signature verification function of blockchains, and contracts can only use random numbers that have been verified in the same blockchain environment.

“We decided to go with Chainlink because of oracle security. Even if a node is attacked, the node cannot manipulate or influence the final result because it cannot bypass the encryption verification on the blockchain. This gives our engineers and users extremely high assurances that lottery selections are fair, unbiased, and tamperproof.”

Poseidon0x, project manager, Prophet.finance

Try Out The Offertory Yourself

Soon, the second round of the Offertory app will be LIVE and you can enter for a chance to win a part of the prize pool of 2,000 PROPHET!

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 chain.link, subscribe to the Chainlink newsletter, and follow @chainlink on Twitter.

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

PROPHET Links and Resources

--

--