Skip to main content
You want to launch an NFT collection on Sui? Great choice! Sui is one of the few blockchains where NFTs are alive. Sui NFTs are dynamic, and you can make them evolve. This article will guide you through the end-to-end process of launching an NFT collection on Sui. Ultimately, you should have an NFT that’s tradable on marketplaces.

Getting Started & Prerequisites

This article assumes you understand Sui Move and have already installed your development environment with an IDE and Sui CLI. If you don’t, check out this article to get set up Once you’re all set up, create a new project with this command:
[Terminal]
Great, now add these imports to the top of the file where you’re writing your code:
[sui.move]
Now, let’s get our hands dirty defining structs for our NFT

Building an NFT on Sui

Before defining your structs, you need to understand your aim and your NFT collection’s traits, habits, and features. In this tutorial, we want an NFT collection with life, so we’d give it an account. The NFT collection should be able to hold assets. This is great if you want to create an NFT collection with revenue or airdrops to holders.
[sui.move]
The GOODYLILI_NFT struct represents the NFT collection with all the necessary fields, including a balance field. Notice that the struct has the key and store abilities. The NFTMinted struct is for emitting events whenever a new NFT is minted. Now, you’ll need an init function that will execute once to initialize traits and claim the publisher capability. The publisher capability allows you admin controls over the NFT collection.
[sui.move]
The publisher variable has this capability, and once the init function runs, it will be sent to the address that deploys the contract. You’ll also need a mint function to mint new NFTs into circulation. Here’s how to declare one.
[sui.move]
All you needed to do was create a new instance of the struct. Cool right? Here, we are emitting an event with details of our minted NFT. Anybody should be able to fund the NFT’s account, so you’ll need to make the add function a public entry function.
[sui.move]
The coin_balance is the balance of the Coin<T> passed in by the caller, stored in the object. Then, the paid is a split off the amount from the balance. The balance::join function joins the NFT’s balance with the amount paid. You’ll also need a function for holders to withdraw funds from the NFT.
[sui.move]
In this case, you’re using the balance::split function to split the amount from the NFT’s balance before sending the funds to the transaction sender.

Launching NFTs with Kiosk

Sui provides kiosks that are more ergonomic than on-chain assets. It’s like opening a brand for items, and then you get to specify and enforce policies over the items. Many of your favourite NFT collections, including Prime Machin and Rootlets, use Kiosk. First, you need to add all these imports to your package.
[sui.move]
You’re importing the usual suspects: strings, coins, and balances plus transfer_policy, which is the real star of this section. The transfer_policy module defines how assets can be transferred and enforces rules on those transfers. Here’s a table of the transfer policy features: Now that you understand the transfer policy. Let’s define the NFT struct and specify transfer policies on the NFT.
[sui.move]
We’ll need to define a rule and a configuration to charge a fee or enforce conditions:
[sui.move]
This creates a new rule type, Rule, and an empty Config. We’ll plug this into the policy later. Here’s a basic function to mint a new Art NFT:
[sui.move]
It creates a new object and assigns it a name, image, and zero token balance. Now we need to create a transfer policy like this:
[sui.move]
Here’s what’s happening:
  • transfer_policy::new creates the policy and its capability (cap)
  • The policy is made shared so everyone can access it
  • The cap is transferred to the caller so only they can manage the policy
This step is mandatory. Without a policy, Kiosk listings won’t be enforceable. Now, we can attach the rule to the policy like this:
[sui.move]
This registers your custom rule (Rule) and its config. This function can only be called by whoever holds the TransferPolicyCap. Here’s the critical part: enforcing a 1 SUI transfer fee:
[sui.move]
What’s happening here:
  • It checks the coin’s value is exactly 1 SUI (in Mist)
  • Adds that payment to the policy’s internal balance
  • Marks the TransferRequest as passed for this rule
Once all rules are satisfied, the buyer must confirm the request:
[sui.move]
The transfer is considered pending until this step is completed, and ownership won’t be finalized. This step is essential. Without calling confirm_request(), the item is stuck in limbo. That’s why TradePort asks recipients to claim from Kiosks.

Conclusion

You now know how to launch NFTs on Sui. Ideally, you’ll need a decentralized storage to store your NFTs; check out Walrus for that. There’s a Walrus client tutorial in this series you should check out to learn how to store your NFTs on Walrus