Chains

BNB Smart Chain

Build Web3 dApps effortlessly

BNB Beacon Chain

Sunset soon

BNB Chain ecosystem’s staking & governance layer

DocumentationGitHubFaucetStake BNBBscScanBSCTraceDev ToolsLearn more about FusionDocumentationBeacon Chain ExplorerStake BNBDocumentationGitHubFaucetBridgeGreenfieldScanDCellarDev ToolsDocumentationGitHubFaucetBridgeopBNBScanDev ToolsDocumentationGitHubFaucetBridgezkBNBScanMarketplace

Developers

Developers

Start building on BNB Chain

Start Building
Developers
BNB Smart ChainBNB Beacon ChainBNB GreenfieldopBNBzkBNBDAU Incentive ProgramTVL Incentive ProgramKickstartMVB Accelerator ProgramBuilder GrantsSpace BMEME Innovation ProgramSee All Programs
Contact UsStart Building
Contact UsStart Building

Chainlink Brings VRF v2 to BNB Chain, Providing Scalable, Configurable, and Low-Cost On-Chain Randomness

2022.2.25  •  4 min read
Blog post image.

BNB Chain developers community is committed to providing the best infrastructure to smart contract developers, enabling them to create full-fledged and highly secure dApps. That’s why Chainlink Price Feeds, Chainlink Verifiable Random Function (VRF), and Chainlink Keepers were previously integrated on BNB Chain. These integrations provide developers with a high-quality decentralized market data solution for building tamper-proof DeFi apps, a secure random number generator (RNG) solution to support blockchain gaming and NFT applications, and a reliable smart contract automation solution for executing DevOps tasks in a decentralized and reliable manner.

Today, the BNB Chain developers community is excited to announce that Chainlink VRF v2 is now live on the BNB Chain mainnet as the recommended solution for developers needing a highly secure and configurable RNG solution. With many of its new features developed in response to feedback from users, Chainlink VRF v2 offers a new and improved version of the industry-standard on-chain RNG solution, making it easier to configure and scale randomness requests at a significantly reduced cost. As a result, developers in the BNB Chain ecosystem can now build more advanced, fully-fledged dApps with reduced operational costs and more flexibility when it comes to speed and security.

If you want to start building with Chainlink VRF v2, join the Chainlink Discord and refer to the developer documentation.

Since its launch, Chainlink VRF has served more than 3M+ requests for fair and unbiased random numbers across leading blockchains, with use cases ranging from NFT mint randomization and supporting blockchain gaming metaverse features to helping ensure provably random reward distribution. In the following section, we explore some of the major benefits introduced by Chainlink VRF v2.

Cost-Efficient Randomness Requests

With Chainlink VRF v2, smart contract applications can now fund multiple requests for random values using a single token balance. To fulfill each randomness request, the amount of gas needed to pay for the response transaction is automatically calculated, converted using a Chainlink Price Feed, and deducted from the balance of the subscription contract along with a flat per-request fee.

This improvement helps reduce the cost of VRF requests significantly, enabling projects to scale faster and eliminating the need to transfer tokens for each request.

Variable Callback Gas Limit

Chainlink VRF v2 offers users the ability to set the callback gas limit depending on the specific needs of their application. As a result, smart contracts can execute more sophisticated smart contract logic in the same transaction that delivers verifiable randomness to their application. This enables developers to execute critical tasks involving randomness even during times of network congestion, allowing for more flexibility and reliability.

The callback gas limit can be set to a maximum of 2.5M gas—a more than 10x improvement over VRF V1.

More Flexibility in Defining Security Parameters

Chainlink VRF v2 allows users to define the number of block confirmations that must happen after a request is made before verifiable randomness is generated and delivered, ranging from a 3-block minimum to a 200-block maximum.

The ability to configure block confirmation time for randomness requests gives development teams additional flexibility between increased security through additional protection against block re-organization attacks and control over speed through latency between request and response.

More Randomness Per Request: Single Request, Multiple Random Outputs

With the improved VRF v2 Coordinator contract, users can request multiple random numbers in a single transaction, with the multiple random outputs delivered in a single transaction. This enhancement further reduces the cost of using VRF v2 and also reduces response latency.

This upgrade is particularly beneficial for applications with a high frequency of randomness requests. Users who need multiple randomized values can significantly save gas costs by batching multiple random requests and responses into single transactions.

Unified Billing—Subscription Balance Delegation Between Multiple Addresses

Chainlink VRF v2 offers up to 100 smart contract addresses to fund their randomness requests from a single subscription balance managed by the subscription owner.

This improvement further saves on gas costs and simplifies funds management for developers who operate multiple contracts requiring verifiable randomness. By making randomness requests more streamlined across multiple smart contracts, developers can create advanced dApps with a cost-efficient way to fund randomness requests across all of them.

With the combination of Chainlink VRF v2 and BNB Chain, developers can create advanced dApps powered by a verifiably unbiased source of randomness securely, resulting in a transparent and engaging experience for users, with truly unpredictable and fair outcomes.

For an in-depth exploration of on-chain RNG use cases in smart contract applications, read the 35+ Blockchain RNG Use Cases Enabled by Chainlink VRF blog post.

“Chainlink VRF v2 enables developers in the rapidly growing BNB Chain ecosystem to access a verifiable source of on-chain randomness with increased flexibility and at a reduced cost,” said Samy Karim, BNB Chain Ecosystem Coordinator. “This integration will help us in our mission to provide the best infrastructure and tooling to the BNB Chain ecosystem, empowering developers to create exciting and feature-rich applications.”

We would like to thank all VRF v2 beta testers on BNB Chain, including:

BetSwirl, BiFrost, Black Eye Galaxy, Coin98, DestinyDAO, DexKit, DogeVille, Elemon, Fantasy Arena, InuWars, LuckyChip, Magic Beasties, PolyFight, Polyroll, PolyWantsACracker, Ridotto, TreasureKey, Oddblox, Yarloo

“We’re thrilled that Chainlink VRF v2 is now live on BNB Chain, enabling developers to build next-generation hybrid smart contracts leveraging provably fair on-chain randomness,” stated Niki Ariyasinghe, Head of Blockchain Partnerships at Chainlink Labs. “With the increased configuration flexibilities and scalability improvements of Chainlink VRF v2, developers can provide even more value to their users in a more cost-efficient manner supported by enhanced capabilities.”

Chainlink is the industry standard for building, accessing, and selling oracle services needed to power hybrid smart contracts on any blockchain. Chainlink oracle networks provide smart contracts with a way to reliably connect to any external API and leverage secure off-chain computations for enabling feature-rich applications. Chainlink currently secures tens of billions of dollars across DeFi, insurance, gaming, and other major industries and offers global enterprises and leading data providers a universal gateway to all blockchains.

Learn more about Chainlink by visiting chain.link or reading the developer documentation at docs.chain.link. To discuss an integration, reach out to an expert.

Follow us to stay updated on everything BNB Chain!

Website | Twitter | Telegram | Youtube | Gitcoin | Discord | Build N' Build Forum

Share