GFTB #7: Chainlink VRF & Gaming With Patrick Collins

Chainlink VRF and Gaming with Patrick Collins

Welcome to the 7th episode of Games From The Block, today George talks with Patrick Collins, Developer advocate for Chainlink about the Chainlink VRF technology and the effect it has on blockchain and gaming.

Chainlink VRF went live on Ethereum recently and a game we are familiar with, The Six Dragons, is already using it for Crafting and Enchanting.

Read the interview below or listen to the podcast using your favourite player.

Tell us about Chainlink VRF.

Chainlink VRF finally went live on Ethereum Mainnet. And this is incredibly exciting because getting random numbers in solidity, smart contracts, blockchain, and decentralized applications has historically been really hard. Getting a random number and deterministic system is impossible.

So now, there’s finally a way where you can get a provably random and secured number for your smart contract.

Why is random number generation impossible?

Excellent question. Historically in computer science, getting random numbers has been challenging and specifically in the blockchain.

It isn’t easy because Blockchains are supposed to be deterministic systems. They’re supposed to be set up in a way where if you replayed the first block and then every single transaction all the way up to the current block.

This determinism makes it difficult to create random numbers because of the deterministic system. That way, random number, it’s not really random anymore.

Chainlink tap into gaming with VRF (Verifiable Random Function)

What’s an example of VRF usage?

The lottery. Let’s say you’re a miner, and you sign up for a decentralized lottery on the blockchain where you could win a million dollars. Now you’re going along, and mine a block. That would be the winning block.

But it’s not the lottery number that you picked. So what do you do? You throw it out. You just don’t publish it. So you can be financially incentivized to start being unfair.

Let’s say you get a group of miners who are also involved in this lottery. They start throwing up blocks, and now you don’t have this really fair, random system anymore. Now you have a group of miners who are actually manipulating the probability of their number being pulled as opposed to it being truly fair.

So this is why using the block hash is not a good use case. And there’s a ton of mining pools that would also be financially incentivized to act like this way.

That’s why it’s actually really important to use Chainlink yourself to get your random number because you prove you’re getting a provably verifiably random number as opposed to relying on these entities.

So how does Chainlink VRF works?

There’s a little bit of cryptographic magic that goes on behind the scenes. For those of you who are interested, you can go and check out the paper.

It’s based on Goldberg’s verifiable random function. What it does is you send a seed along with your request for a random number, and each Chainlink node has a key hash, both a public and a private key.

That public key is used in conjunction with that seed phrase to return a provably random value. When the Chainlink node(s) returns the random number onchain, you can verify right away whether or not it’s provably truly random based on those nodes specific keys.

So this is powerful. And the worst thing that a node can do is just not respond. And that that’s easily solved by having a decentralized network of nodes.

Chainlink tap into gaming with VRF (Verifiable Random Function)

What are some Chainlink VRF applications?

Gaming is a huge one, and randomness, in general, is a crucial piece in any system and computer science. You could think of, you know, life sciences, for example, if you want to run randomly sampled clinical trials, you’re going to need random numbers.

For gaming, we have loot boxes, random spawns, random drops. There are tons of different places there. The sky’s the limit when it comes to no limits.

Since Chainlink VRF went live on Ethereum Mainnet, are new projects using it?

We’re seeing more and more users, more and more companies picking it up. We have a blog coming up pretty soon, with many other ones planning on using it. For example, in our hackathon, many gaming projects did use Chainlink VRF to create their random in-game items or random drop rates, which was exciting to see.

Is Chainlink VRF free to use?

Whenever you make an off-chain request, similar to an online request, you have to pay what’s called GAS—a little bit to the miners or the validators who mine your transaction.
It’s the same thing when you’re working with Oracles. So you pay a little bit of Chainlink (LINK) to the Oracle to say, thank you for getting my provably random number. And that’s how that works.

What’s next for Chainlink?

There’s a lot of fascinating things coming down the pipeline. Some of the really exciting ones that I’m interested in are often reporting and threshold signatures. So those are two pieces that allow people to get data way cheaper.
I’m also excited about the DeFi space to keep exploding right now. Chainlink is securing a number of the top projects in the DeFi space. It’s securing billions of dollars right now. I’m excited to see this space keep exploding and chainlink kind of keep leading.

The Six Dragons VRF integration with Chainlink

What does Chainlink do for DeFi?

DeFi stands for decentralized finance. Right? And something crucial in finance is getting data right. You know, what’s the price of Ethereum right now? Chainlink is doing for the pipeline to bring on decentralized data. And the most popular data right now is pricing data by far. So the change in price feeds is being used by a number of the top five projects to get reliable pricing data.

We’re seeing more and more price feeds come online, more and more products looking to get price feeds. And even outside of price feeds, you can get any data that you want in a decentralized manner right now. So we see more and more products start to pick up on that. But right now, the most famous piece is price feeds in the device space.

Visit Chainlink website.