How to mint Atomic Assets packs on WAX (and open them!)

stuckatsixpm
11 min readMar 22, 2021

This guide shows you how to bundle your NFTs into packs, set draw rates and rewards, as well as how to unbox your custom packs!

Everyone loves the suspense of opening a mystery box, not knowing what you’ll receive- maybe even a super-rare limited edition card! It’s the reason that trading card booster packs disappear off the shelves as collectors try to find that one card they’re missing. I remember my years of collecting Pokémon cards fondly, and the excitement of opening a pack and finding a rare card is unbeatable.

If you’re an NFT creator, you might decide that you want to give your community the same thrilling experience. Whether you create booster packs for your collectible card game, or give away gift boxes that reveal a random NFT from your collection, NFT packs are an exciting and versatile way to engage your community. However, due to the complexity of setting them up, they are also a very underused aspect of the platform.

This guide aims to give a simple, step-by-step walkthrough of how to create your own NFT packs on WAX, using Bloks.io and AtomicHub.

Important Notes:

  • This guide assumes that you already know how to make Non-Fungible Tokens (NFTs) on WAX. If you need a refresher, check out this guide.
  • I know that this guide is quite a long read, but I would highly recommend reading through it entirely before attempting to create an NFT Pack.
  • I’ll be writing a shorter summary guide on how to unbox/open packs soon! I’ll update this dot point with a link when it’s complete.
  • My WAX account has a custom name stuckatsixpm. WAX accounts created through the WAX Cloud Wallet will have addresses such as a1bc2.wam.

Preparation

Before we can make an/the NFT pack, we need some assets to fill our packs with!

You might already have a collection that you want to use, but for this tutorial, I created a new collection, called “saspmnfttest” (short for stuckatsixpm nft test).

Three colored logos for Assets
Gold, Silver, and Bronze

I have no artistic ability, so I just colorized my logo into a Gold, Silver, and Bronze variant, and then created a minimal template for each one — ignore the blank template (the image didn’t upload to IFPS properly). Importantly, never set a Max Supply that could be exceeded through opening your packs. For example, if you’re making/producing/releasing 50 packs, don’t set the max supply to 25! I personally think it’s best to leave the supply as infinite, because you can limit the number of assets created indirectly by limiting the number of packs you mint.

We also need to create a template for the NFT pack in the same collection. Usually for this you might use a booster pack artwork for a card game, or gift box artwork if it’s a present. You may wish to set a supply limit for the pack template, it’s entirely up to you. This is my Pack Template.

My incredibly artistic PowerPoint Pack Art

Finally, we need to add the atomicpacksx account as an Authorized account on the collection, so that it can mint the tokens!

With those steps out of the way, we can move on to creating our NFT Pack on WAX!

Making an NFT Pack

We come now to the technical part of the tutorial. I’m going to try to break it down as simply as possible, however there will be quite a bit of jumping around between websites.

For all of the following steps, I used bloks.io and the Anchor Desktop wallet, but it should work with any wallet, including the WAX Cloud Wallet.

Buying RAM

In order to create NFT packs and have them open to reveal assets, you need to first deposit some WAX into the atomicpacksx account to buy RAM. It is hard to estimate how much WAX you should deposit- as a rough guide, for this tutorial I deposited 1 WAX and received 7403 bytes. After minting and opening two packs, each with three assets in them, I had 6257 bytes of RAM remaining.

To buy RAM, sign into the WAX version of bloks.io, and then navigate to your wallet. Next, send your chosen amount of WAX to the atomicpacksx account, with the memo:

deposit_collection_ram:<collection name>

So in my case, my collection name is saspmnfttest, so I sent my 1 WAX with the memo:

deposit_collection_ram:saspmnfttest

If I then look at the atomicpacksx account’s activity, I can see that my WAX arrived and was credited to my collection:

If I change tabs at the top of the page over to the Contract tab, and look at the rambalances table, sure enough my allocation of RAM is there.

Navigating to the Contract tab
I have 7403 bytes of RAM available

Creating an NFT Pack

There are 3 steps to actually creating an NFT pack.

  1. Announcing the pack, where we create the NFT pack on the WAX blockchain.
  2. Adding our draw rates and NFT prizes to the pack.
  3. Linking the NFT pack to the Pack Template we created earlier.

Once again, everything here is done on wax.bloks.io.

Announcing the Pack

On the atomicassetsx account → contract tab, navigate to actions, and then click announcepack. Here, enter your account name, the collection name, and an unlock time.

Unlock Time is how long since the epoch (in seconds) you want your pack to be open-able. The easiest way to find a value is to go to a converter (such as this site: Unix Time Stamp — Epoch Converter), and enter the date and time you want your packs to be open-able from. Hit convert, and then copy the UNIX timestamp value.

You can also choose a time that has already passed if you want your packs to be open-able straight away. One example where postponing opening of your NFT pack might be useful is ensuring people can’t open a gift NFT pack until Christmas Day.

Display_data acts as a description of sorts, and the value here depends on the platform you’re using to create your NFT Pack. Submit the transaction, and we’ve created our NFT pack!

There’s just one thing left to do. We need to find the Pack ID number. There are two ways to find this:

  1. Look for your Pack in the packs table of the atomicpacksx contract tab.
  2. Go to your account page on wax.bloks.io, and look for your announcepack event. Click the hyperlinked transaction, and find the traces tab. Here you will find the Pack ID.
The Pack ID number, found using method 2.

In this case, my pack_id is 29. Write your number down somewhere, as we’ll need it later.

Adding NFTs to the Pack

Head back over to AtomicHub or wherever you’ve been creating your templates. Note down the template IDs of any NFTs you wish to include in your packs, and decide at what rate you wish each one to appear.

In my case, I have:

  • Pack Tutorial Gold: #77327 — 5% chance
  • Pack Tutorial Silver: #77325 — 35% chance
  • Pack Tutorial Bronze: #77324 — 60% chance

Back on Bloks.io , we now need to go to the addpackroll action, and create a “roll” event that will award either a Gold, Silver, or Bronze pack tutorial token when the pack is opened.

The dialogue looks like this:

Everything is fairly self-explanatory until you get to Outcomes. You might at this stage ask “what the heck is that thing in the outcomes field?”. That outcomes field is where we drop all of the information about what NFTs the pack should give and with what odds.

Let’s look at how to generate the outcomes.

[{"odds":60,"template_id":77324},{"odds":35,"template_id":77325},{"odds":5,"template_id":77327}]

The outcomes are a JSON formatted string that look something like this when we space it out a bit:

[
{
"odds": 60,
"template_id": 77324
},
{
"odds": 35,
"template_id": 77325
},
{
"odds": 5,
"template_id": 77327
}
]

You can see that we have several groups of odds and template_ids, surrounded by curly brackets. The odds are the chance of the NFT being selected randomly when the pack is opened, and the template_id that corresponds to the NFT. IMPORTANT: The NFTs must be listed in descending order of odds.

To work out what odds value to use, consider that the draw rate is:

odds/(sum of all the odds for all NFTs in the draw

So for my example, the chance of getting the first possibility (the Bronze Token) is:

60/(60+35+5) = 60/100 = 60%

You can copy my spaced-out example, and then adjust the odds and template_ids, and add or remove extra options as needed. For example, if I wanted to add another option to the roll, I could change the JSON to the following:

[
{
"odds": 60,
"template_id": 77324
},
{
"odds": 25,
"template_id": 77325
},
{
"odds": 10,
"template_id": 77327
},
{
"odds": 5,
"template_id": 12345
}
]

Your odds don’t need to add up to 100, but I recommend keeping it as a power of 10 (10, 100, 1000, etc) for simplicity’s sake. Just remember that the NFTs must be listed in descending order of odds.

When you’re done adjusting the odds and template_ids, copy-paste it into this site: Best JSON Minifier, JSON Minify and JSON Compressor (codebeautify.org). This site will automatically “minify” the JSON into one line, which you can then insert into the Outcomes field. Add up all your odds and use that value for the total_odds field.

Hit submit and the roll has been added! At this point in time, if someone were to open one of our NFT packs, they would receive a single NFT. We can continue adding more draws to the pack by submitting the addpackroll action again. Each submission of the addpackroll action will add another NFT draw to your pack.

By doing this, you can allow people who open packs to receive more than one NFT. You might keep the same odds, or even design a pack in which someone is guaranteed 4 common NFTs and 1 rare one!

In my example, I’m going to repeat the same addpackroll action twice, resulting in 3 NFTs being generated for anyone who opens one of my NFT packs.

I can also check my pack rolls by going to the packrollstable and using my Pack ID as the scope:

All three rolls are there, so we’re almost done! Keep in mind that this also means that your pack draw rates are public on the blockchain, and can be viewed by anyone.

Completing the NFT Pack creation

To finish off, we just need to do the completepack action, in which we use our account, our pack_id, and the template_id of the Template associated with our pack (in my example, it’s 77329).

This action links our “Pack NFT” (the triangle), to our “NFT Pack” (rules on the blockchain about what NFTs to create when a pack is opened).

Congratulations! You’ve created your NFT pack! Well done!

Minting an NFT Pack

All that’s left to do is mint the pack, using our Pack template. You do this the same way you normally mint an NFT on AtomicHub. Obviously, treat minting the NFT Packs like you would any other asset.

The minting page, after 2 successful mints.

Opening an NFT pack

Once you’ve created your NFT pack, you might sell or distribute them, but your community might need some help to actually unbox the pack. AtomicHub is working on tools to simplify this for verified collections, but until then, you can follow these steps.

Before opening a pack created by someone else, first check that it is an AtomicPacks pack. There are other ways to make packs on WAX, and the opening method may differ for these other methods.

There are 2 steps involved in unboxing (opening) an NFT pack.

  1. Sending the pack to atomicpacksx (for the love of Satoshi, please read ahead. DO NOT just send your NFT pack to the account.
  2. Claiming your NFT goodies.

Sending the NFT Pack

The first step is to transfer your Pack NFT to the atomicpacksx account, with the memo “unbox”.

If you check the activity of the atomicpacksx account after you send it, you’ll see a number of events have occurred, including the burning of the pack, and the random draws to decide what you get. You’ll want to copy the Pack Asset ID, which is the same as the ID of the Pack NFT.

Claiming the NFTs

To claim the NFTs that you pulled from the pack, go to the claimunboxed action, and enter your Pack Asset ID, and a sequence of numbers in the Origin Roll IDs field. This should be just 0 to however many rolls you set for your pack minus 1. See the circled region of the screenshot below.

For my tutorial pack, I set there to be three rolls, so my value for Origin Roll IDs should be [0,1,2]. If you’re opening someone else’s pack, or you’re unsure, try searching for your Pack Asset ID in the unboxassets table of the atomicpacksx account.

After you submit the claimunboxed action, you should see the NFTs appear in your NFT inventory!

Success! I pulled 2 Bronze Tutorial tokens and even managed to get lucky and get the 5% chance Gold token.

That’s it!

I hope you’ve found this guide useful. If you liked it and would like to give a tip, my WAX address is stuckatsixpm. Alternatively, buy me a coffee!

If you want to take a look at the Assets used in this tutorial, you can find them all in this Schema: https://wax.atomichub.io/explorer/schema/saspmnfttest/packtutorial

If you need help, check out the WAX Discord, where I’m fairly active, or contact me on Twitter.

Lastly, thanks for reading, and I hope you have fun creating NFT packs for your communities!

--

--

stuckatsixpm

I’m an community dev who likes to spend his free time playing around with Python.