I am thinking of developing small DApp where user would collect cards (NFT). Each card would have some image and value associated with it. User collects cards by purchasing
Pack of Five Cards which user can open and get 5 random cards of different value. Some cards would me more rare than others... This would create marketplace where users can buy/sell cards...
The problem I have is how to generate these random cards. I read a lot about randomness on blockchain and how it can be exploited so I have few options.
Use Chainlink's VRF which gives me number like this:
60 281 005 833 581 254 158 276 701 724 503 448 998 474 868 621 179 906 924 992 243 038 007 226 057 672
Which has 77 digits (I am not sure if this is always the case, but testing on kovan network it seems it always has 77 digits). I can use these group of 3 digits which will give me random card... But this way user is limited to buying max 5 (or less) x
Packs of Five Cards... I need to use group of three digits or more depending on how many cards are there in a set and different cards would have different weights so I would use those weights to pick random card from set.
User approves some stable coins to contract address via MetaMask, and calls my backend which in turns has private keys to contract and backend picks all random cards and just sends instructions to contract to mint new NFTs and assign them to user who bought it...
But in this approach I need to pay for gas fees, and also I suppose that gas fees would be high for creating like 100 tokens at once (if user bought 20
Packs of Five Cards)
I don't know if this is possible, but is there a way to create contract on Chainlink node, which would generate as much random numbers as needed... I would still limit users to buy max 10 packs, and chainlink contract would in return generate max 50 random numbers in range 1 and 1000 (or a bit more depending on sum of all weights of cards in set) and return them to my contract which would then mint these NFTs...
Is there any other way how to implement this. And also I suppose Option B would create some negative comments since that would be outside of blockchain and it won't be transparent...