Using VRF to create unique NFT's

Last Updated 12/12/2021

To create something truly random on the blockchain is no easy task. Computers are designed to be exact and predictable, the opposite of random. This is where chainlink comes in with VRF or Verifiable Random Function. A quote from there site describes it like this “a provably-fair and verifiable source of randomness designed for smart contracts”. This solidity contract uses OpenZeppelin and the ERC 721 standard to gain full token functionality. From there the random number from chainlink is used to set several parameters in an SVG file. SVG is uniquely suited for this project because it is “an XML-based vector image format for two-dimensional graphics”

This allows for a text file to be saved to the block chain and then is read by a browser. This saves on on-chain storage space, making it much cheaper to mint and transfer than a png or img file, yet it will still produce an image for the user to enjoy.

You can check out the code for this project here:

Randomized NFT