Polywhale Using Chainlink VRF on Polygon Mainnet for Secure On-Chain Randomness

Whale
Polywhale
Published in
5 min readMay 12, 2021

We are pleased to announce that Polywhale, the first yield farming platform on the Polygon network, has integrated Chainlink Verifiable Random Function (VRF) on mainnet to secure the Polywhale Lottery system. As the industry-leading Random Number Generator (RNG) solution for smart contracts, Chainlink VRF provides Polywhale with a verifiable source of on-chain randomness directly on Polygon that’s used to choose winners in a tamper-proof, low-cost, and provably unbiased manner.

This integration of Chainlink VRF ensures that all applications that rely on randomness in the Polywhale ecosystem are fully auditable and high-integrity processes, leading to a transparent and fair experience for everyone. As Polywhale continues to develop gamified features, our integration with Chainlink will continue to expand, such as leveraging the Chainlink’s widely used Price Feeds to access a variety of real-time asset prices.

Securing the Polywhale Ecosystem with Chainlink Oracles

Polywhale is a Polygon-based platform that aims to provide users with a full spectrum DeFi solution based on powerful incentive structures and gamified experiences. In this pursuit, Polywhale launched one of the initial yield farms on the Polygon network. Additionally, Polywhale will be releasing one of the first launchpads on Polygon called Polypad, as well as one of the first permissionless lottery systems.

The Polywhale lottery is a gamified on-chain experience that allows users to purchase tickets for 0.1 KRILL tokens each, which gives them the chance to win a portion of the pool. With each ticket, users will supply a four digit combination where each digit needs to be between 1–14 (e.g. 1–9–3–2). Users need to match all four numbers in the right order to win 50% of the pool, match three numbers in the exact order to win 20% of the pool, or match two numbers in the exact order to win 10% of the pool; with the remaining 20% of the pot is burned.

In order to determine the winners, Polywhale requires a secure source of on-chain randomness to pick the four final winning numbers in order. However, generating a random value that cannot be manipulated by any entities is not an easy task and traditional solutions come with many downsides. For example, on-chain randomness solutions like using the blockhash can be manipulated by miners, while off-chain randomness solutions are highly opaque, requiring users to trust that the given value isn’t manipulated. Both solutions become increasingly concerning as the amount of value held by the Polywhale lottery rises.

For these reasons, we choose to integrate with the industry-leading oracle solution Chainlink and use their Verifiable Random Function (VRF). Chainlink VRF works by combining block data that is still unknown when the request is made with the oracle node’s pre-committed private key to generate both a random number and a cryptographic proof. The Polywhale smart contract only accepts the random number if it has a valid cryptographic proof backing it, which can only be generated if the VRF process hasn’t been tampered with.

The use of Chainlink VRF provides users with automated and verifiable assurances directly on-chain that each lottery drawing is provably fair and was not tampered with by the oracle, outside entities, or the Polywhale team.

Future Integrations With The Chainlink Network

We selected Chainlink as our oracle solution because it’s the most widely used, time-tested, and fully-functional oracle infrastructure, possessing a long track record of servicing decentralized applications with a wide range of data that secures billions of dollars in user funds. With price feeds and other various data feeds available through Chainlink, Polywhale can overcome the “oracle problem” and build a variety of new data-driven use cases within its ecosystem, such as dynamic NFTs, Defi products, and more.

Going forward, Polywhale plans to:

  • Use the Chainlink framework to connect to various off-chain API data feeds.
  • Use Chainlink VRF in order to ensure provably fair and unpredictable applications.
  • Use Chainlink Price Feeds to power more upcoming DeFI features.

As we continue to develop new DeFi solutions like Polypad and NFTs, Chainlink oracles will provide the secure data feeds required to create complex financial instruments. Additionally, accurate price feed data will be essential in having a reliable way to preview data to users before they make transactions. We will continue to research new ways of powering our smart contracts with secure inputs and outputs using the Chainlink Network.

“Integrating Chainlink VRF into the Polywhale lottery system has allowed us to provide users definitive proof that winners are chosen in a verifiably fair manner, without any possibility of tampering by the oracles, users, or even the Polywhale team,” stated Mr Smith, Polywhale Co-Founder. “Into the future, we will continue to expand this integration to leverage Chainlink Price and Data Feeds as a means of launching many more innovative DeFi and NFT applications that benefit the Polygon ecosystem as a whole.”

About Chainlink

Chainlink is the most widely used and secure way to power universally connected 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

About Polywhale

Website: https://polywhale.finance/
Twitter: https://twitter.com/polywhalefi
Telegram: https://t.me/polywhalefi

If you have any questions about Polywhale, feel free to reach out by email: support@polywhale.finance

--

--