Sui.

Post

Share your knowledge.

article banner.
D’versacy .
Aug 15, 2025
Article

🚀 How to Design, Mint & Trade NFTs on Sui — Safely and Efficiently

Problem: “How do I design, mint, and trade NFTs on Sui while keeping things safe, efficient, and marketplace-ready? 🤔”

Why this happens: If you’ve built NFTs for EVM before, you’re probably used to approve/transfer. But on Sui, NFTs are on-chain objects 🗝, and transfers happen by moving that object. This means marketplaces need escrow objects and explicit transfers to make sales atomic and secure.

Goal: Let’s break down the full NFT lifecycle on Sui — from design 🛠 to minting 🪙, royalties 💰, escrow 🔒, and marketplace trading.


1️⃣ NFT as a Move Object — The Canonical Design

On Sui, an NFT is just a Move resource with a key. Example:

module MyNFT {
  use std::vector;

  struct NFT has key {
    id: u64,
    metadata_hash: vector<u8>,
    creator: address,
    royalty_percentage: u64, // e.g. parts-per-10k
  }

  public fun mint(creator: &signer, id: u64, metadata_hash: vector<u8>, royalty: u64) {
    let nft = NFT { 
      id, 
      metadata_hash, 
      creator: signer::address_of(creator), 
      royalty_percentage: royalty 
    };
    move_to(creator, nft);
  }
}

✅ Owning the NFT object is ownership. Moving it = instant transfer.


2️⃣ Royalties & Immutable On-Chain Properties 💸

  • Immutable royalties — Store royalty_percentage & creator right in the NFT. During sales, your marketplace can route payments automatically to the creator.
  • Upgradeable royalties — Use a separate Royalty object that receives payments and can have its rules updated if needed.

3️⃣ Listing & Escrow — Safe Marketplace Flow 🔒

A typical list NFT step:

struct Listing has key {
  nft: NFT,
  seller: address,
  price: u64
}

How it works:

  1. Seller moves NFT into a Listing/Escrow object.
  2. Marketplace holds this object so it can guarantee a safe, atomic sale.

Buying involves a single atomic PTB (Programmable Transaction Block) that:

  • Moves buyer’s payment 💵 to seller + royalty recipients.
  • Moves NFT from escrow to buyer.
  • Pays gas in one go.

No approvals. No double-spend risk. ✅


4️⃣ TypeScript Flow — Listing + Buy Example 🖥

Listing flow:

  • Seller signs & executes a transaction to move NFT into escrow (one Move call).

Buying flow:

  • Build PTB that sends funds, pays royalties, moves NFT to buyer, and pays gas — all in one transaction.

Check Sui PTB docs + SDK for exact function calls.


5️⃣ Metadata & Storage 📦

Keep big files (images, videos) off-chain — IPFS, Arweave, or a CDN.

  • Store only a content hash + URI in the NFT object.
  • Always verify hash integrity when loading data.

🔑 Key Takeaways

  • Sui NFTs = on-chain objects — move, don’t approve.
  • Use escrow listings for safe, atomic sales.
  • Build royalties right into your NFT or a separate royalty object.
  • Batch transactions in PTBs for lower gas + better UX.
  • Sui
0
Share
Comments
.