-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PRNG - Pseudo Random Number Generator #104
Comments
Hi @justjoolz - thanks again for your proposal! We're reviewing and will follow up shortly. |
Hi @justjoolz - thanks for your patience! Just wanted to let you know that we've accepted this submission and will be following up directly with next steps. Thanks! |
Hi @chrisackermann - thanks for the great news! |
Hey Joolz, I have in my database that only the first milestone was completed, given that this was quite a long time ago and changes made with the randomness beacon, I don't think this is relevant anymore. I'm going to close this, please let me know if this is a mistake [email protected]. |
PRNG - Pseudo Random Number Generator
Grant category
Please select one:
Description
A fully on-chain pseudo-random number generator written in Cadence and an off-chain Javascript equivalent that uses the exact same seeding mechanism (blockHash mixed with resourceID) and hence replicates the same stream of random data.
Problem statement
Using randomness is a big part of many NFT drops (randomized traits) and it's usually always done off-chain. This means it's harder to achieve transparency (most projects don't even attempt to). Also, it's prone to manipulation as has happened to several of Dapper's products.
Developers + creators who value transparency.
15 posts on the forum mentioning randomness: https://forum.onflow.org/search?q=random and plenty in discord too, a very common question with no solutions
Off-chain randomness exploits:
https://blog.nbatopshot.com/posts/elite-pack-distribution-audit
https://blog.nflallday.com/posts/update-rams-team-nft-drop
https://nftevening.com/dapper-labs-hand-out-free-nfts-after-their-ufc-drop-is-a-total-disaster/
Proposed solution
A resource-based PRNG that lives in its own contract and can supply a stream of randomness from a provided initial seed.
Including helper functions for picking numbers in more useful and dev-friendly ways than unsafeRandom provides.
ie.
pickFrom(["sandwich","noodles", [1,9] )
one in ten chance I get a sandwich, 9/10 noodlesrange(10,15)
returns a random number between 10 and 15Impact
This will allow developers to use randomness in their contracts in a far safer and more versatile way than is currently offered.
Milestones and funding
Total funding proposed: 25k
Team
The text was updated successfully, but these errors were encountered: