How to Get a Random Number on Polygon

This article was first published on Chainlink
-----

How to Get a Random Number on Polygon

Polygon (formerly known as Matic Network) is a protocol and a framework for building and connecting Ethereum-compatible blockchain networks. Initially focusing on Ethereum scaling solutions that utilize Proof of Stake (PoS) sidechains and a Plasma framework, in rebranding to Polygon, they’ve also added other major scaling solutions such as zk-Rollups and Optimistic Rollups, as well as inter-chain communication protocols.

As the most widely adopted decentralized oracle network, Chainlink is the preferred oracle network within Polygon for securely obtaining external data and using tamper-proof data feeds. Recently, Chainlink VRF went live on Polygon mainnet, offering developers the ability to request verifiably random numbers in their smart contracts. In this technical tutorial, we’ll show you how to deploy a smart contract to Polygon and obtain a provably random number using Chainlink VRF.

The Need for Verifiable Randomness

Chainlink VRF is a provably fair and verifiable source of randomness designed for smart contracts. Solidity developers can use it as a tamper-proof random number generator to build safe and reliable smart contracts for Ethereum applications that rely on unpredictable outcomes. Critically, Chainlink VRF not only provides random numbers, but also cryptographic proof that the number has not been tampered with to generate certain predictable outcomes.

Having verifiably random numbers in smart contracts enables developers to build for a wide array of use cases, such as randomness in gaming, random rewards in NFTs, lotteries, and Fair Participant or Random Node Selection.  

One noteworthy real-world example is the NFT gaming dApp Aavegotchi, which integrated Chainlink VRF as its source of provably fair randomness to help determine an Aavegotchi’s unique characteristics, generate unpredictable game scenarios, and randomly select DAO jurors. Aavegotchi has launched on Polygon’s layer 2 PoS chain, allowing them to cost-effectively scale to meet user demand thanks to near ...

-----
To keep reading, please go to the original article at:
Chainlink

Comments (No)

Leave a Reply