Creating Objects and NFTs - Encode Club Sui Series #3

·

Sui’s innovative blockchain architecture redefines how developers interact with digital assets by placing objects at the core of its data model. In this third installment of the Encode Club Sui Series, we dive deep into the fundamentals of object creation and explore how these principles directly enable the development of non-fungible tokens (NFTs) on Sui.

This developer-focused series, created in collaboration with the Sui Foundation, is designed to guide builders from foundational concepts to advanced smart contract implementation. Whether you're exploring blockchain development for the first time or expanding your expertise in object-centric programming, this guide offers actionable insights into Sui’s unique approach.


Understanding Sui’s Object-Centric Model

At the heart of Sui’s design is an object-first philosophy. Unlike traditional blockchains where state is stored in account-based models, Sui treats every piece of data as an object—a self-contained unit with ownership, lifecycle, and behavior.

Objects in Sui are defined using Move structs that include a UID (Unique Identifier) as their first field and possess the key ability, allowing them to be uniquely identifiable and directly owned.

There are four primary types of object ownership models in Sui:

1. Address-Owned Objects

An address-owned object belongs to a user’s wallet address. It can be transferred, deleted, or used in transactions initiated by the owner.

struct ObjectA has key { id: UID }
public entry fun create_object_owned_by_an_address(ctx: &mut TxContext) {
    transfer::transfer(ObjectA { id: object::new(ctx) }, tx_context::sender(ctx))
}

👉 Discover how real-world applications leverage address-owned objects for secure digital asset management.

2. Object-Owned Objects

These objects are owned by another object rather than a user address. This enables hierarchical structures—ideal for game inventories or nested digital assets.

struct ObjectB has key, store { id: UID }
public entry fun create_object_owned_by_an_object(parent: &mut ObjectA, ctx: &mut TxContext) {
    let child = ObjectB { id: object::new(ctx) };
    ofield::add(&mut parent.id, b"child", child);
}

3. Shared Objects

Shared objects can be accessed and mutated by multiple users without transfer of ownership. They are essential for decentralized applications requiring collaborative interactions.

struct ObjectC has key { id: UID }
public entry fun create_shared_object(ctx: &mut TxContext) {
    transfer::share_object(ObjectC { id: object::new(ctx) })
}

4. Immutable Objects

Once created, immutable objects cannot be modified or deleted. This ensures permanent records—perfect for certificates, historical data, or censorship-resistant content.

struct ObjectD has key { id: UID }
public entry fun create_immutable_object(ctx: &mut TxContext) {
    transfer::freeze_object(ObjectD { id: object::new(ctx) })
}

The Relationship Between Objects and NFTs

One of the most powerful aspects of Sui’s architecture is that all NFTs are objects—but not all objects are NFTs. Due to Sui’s use of globally unique identifiers (UIDs), every object inherently possesses non-fungibility at the system level.

Let’s examine the UID structure from Sui’s standard library:

struct UID has store {
    id: ID,
}

Every time object::new(ctx) is called during transaction execution, Sui generates a cryptographically unique ID. This guarantees that even if two objects have identical fields (name, description, image URL), they are still distinct because their UID differs.

This eliminates the need for manual token ID tracking or centralized registries—non-fungibility is built into the fabric of the network.

Building an NFT on Sui

Creating an NFT on Sui is both intuitive and flexible thanks to its native support for object semantics. Here's a basic implementation:

struct NFT has key, store {
    id: UID,
    name: String,
    description: String,
    url: Url,
}

This minimal structure captures essential metadata. However, Sui’s dynamic fields and composability allow developers to extend NFT functionality far beyond static media:

Such capabilities open doors for next-generation use cases in gaming, social identity, digital art, and decentralized finance (DeFi).

👉 See how leading projects are using Sui's NFT model to build interactive and evolving digital experiences.


Frequently Asked Questions

Q: Is every object on Sui an NFT?
A: Technically, yes—all objects have unique IDs and can be individually owned or transferred. However, only objects designed with intentional scarcity, metadata, and utility are considered functional NFTs in practice.

Q: Do I need a special standard like ERC-721 to create NFTs on Sui?
A: No. Unlike Ethereum, Sui does not require external token standards. The object model and UID system provide native non-fungibility, simplifying NFT creation.

Q: Can I upgrade or modify an NFT after deployment?
A: Yes. Through dynamic fields and module upgrades (when configured), NFTs on Sui can evolve—enabling adaptive gameplay traits, updated profiles, or changing artwork.

Q: How does ownership work for NFTs on Sui?
A: Ownership is managed at the object level. An NFT can be owned by an address (wallet), another object (e.g., a game character), shared among users, or made immutable.

Q: Are gas fees high when minting NFTs on Sui?
A: Sui is optimized for low-latency and low-cost transactions. Minting an NFT typically incurs minimal gas fees due to parallel transaction processing and efficient storage handling.


Explore the Full Developer Series

The Encode Club Sui Series provides a structured pathway for developers ready to build on one of the most advanced Layer 1 blockchains:

  1. What's Sui?
  2. Smart Contracts
  3. Creating Objects and NFTs
  4. Dynamic Fields and Collections
  5. RPG Building Basics
  6. Deploy a Game to the Blockchain

Each module builds upon the last, guiding learners through real-world coding patterns and architectural best practices.

👉 Start building your own NFT project on Sui today and join the growing ecosystem of innovators.


Core Keywords

By mastering object creation in Sui, developers unlock the foundation for building scalable, secure, and composable decentralized applications. With native non-fungibility and flexible ownership models, Sui empowers creators to push the boundaries of what digital assets can do.