# Randomness for NFT packs on Flow

**URL:** <https://forum.flow.com/t/randomness-for-nft-packs-on-flow/1830>\
**Category:** 🏄🏻‍♀️ Cadence\
**Created:** [April 28, 2021, 7:00pm UTC](https://forum.flow.com/t/randomness-for-nft-packs-on-flow/1830 "2021-04-28T19:00:45Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![bluesign](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/bluesign/32/1359_2.png) [@bluesign](https://forum.flow.com/u/bluesign)\
**Post date:** [May 28, 2021, 8:21am UTC](https://forum.flow.com/t/randomness-for-nft-packs-on-flow/1830/5 "2021-05-28T08:21:52Z")

</div>

I understand the transaction cancel and retry part. It is the obvious probable attack.

> [@qvvg](#):
>
> You can then say, well just make it so the randomness is decided in a different transaction to the delivery of the value, so that the sale can’t be stopped if the purchaser doesn’t like the outcome. Which is correct, and I believe the answer to the question @zach8302 asked.

This is also unsafe imo, consider this:

- Imagine I am distributing TS packs with single moment inside (let’s say 100k packs), and in each pack you have chance to get 1/100k odds Lebron Moment

- I am making lets say 100 transactions per block to speed up delivery.

Problems:

- all those 100 transactions (in the same block which blockID is the seed), will have the same pack content. So instead of different packs, you will give 100x same pack

- if one of the packs (1/1000) has Lebron, 1/100 chance, you will give away 100 Lebron. So instead of expected value of 1 Lebron in 100k packs, you will either have 100 Lebron with 1% chance, or No Lebron at all 99%

This variance is usually not good from a business perspective too.

Also, I didn’t check how blockID is calculated, but potentially I am guessing, the malicious users can also affect that part.

---

_[View the full topic](https://forum.flow.com/t/randomness-for-nft-packs-on-flow/1830)._
