Sui’s object model is fundamentally different from account-based blockchains. Instead of organizing state around accounts, Sui treats everything as an object - making it the fundamental unit of storage and the primary building block for on-chain assets and logic.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/mystenlabs/sui/llms.txt
Use this file to discover all available pages before exploring further.
What is a Sui Object?
In Sui, an object is a structured piece of data with the following characteristics:Globally Unique
Each object has a unique ID derived from its creation transaction
Versioned
Objects have a version number that increments with each mutation
Owned
Every object has an owner - an address, another object, or shared
Typed
Objects are instances of Move structs with the
key abilityObject Structure
Every Sui object must haveid: UID as its first field. Here’s what an object looks like in Move:
The
UID type is globally unique and can only be created through object::new(ctx), ensuring no two objects can ever have the same ID.Object Properties
ID and UID
- ID: A copyable, droppable identifier that can be freely duplicated
- UID: A unique identifier that cannot be copied or dropped, only deleted
UID type enforces uniqueness:
- No two
UIDvalues are ever equal - Can only be created from
TxContext - Must be explicitly deleted with
id.delete()
Version Numbers
From the Rust implementation:Why Lamport Timestamps?
Why Lamport Timestamps?
Sui uses Lamport timestamps instead of simple sequential numbers to support causally ordered execution. When an object is used as input to a transaction, its version is updated based on the maximum version of all inputs plus one.
Object Types
Sui supports different types of objects for different use cases:- Owned Objects
- Frozen Objects
- Wrapped Objects
Objects owned by a single address. These can be used in transactions without consensus.
Object Operations
Creating Objects
Objects are created by constructing a Move struct withkey ability and a UID:
Reading Objects
Updating Objects
Deleting Objects
Objects must be unpacked and theirUID explicitly deleted:
Special Object Types
Coin Objects
Coins are optimized objects with a known structure:System Objects
Sui has several singleton objects with hardcoded IDs:Object Size Limits
Objects have size constraints defined in the protocol:allow_unbounded_system_objects() is enabled.
Best Practices
Always delete UIDs
Always delete UIDs
When destructing an object, always call
.delete() on its UID to properly clean up:Use the right ownership model
Use the right ownership model
- Owned objects for user-specific assets (NFTs, tokens)
- Shared objects for multi-user protocols (DEX pools)
- Frozen objects for immutable data (metadata)
Minimize object size
Minimize object size
Smaller objects cost less in storage fees and are more efficient to process:
- Use efficient data structures
- Avoid storing redundant data
- Consider dynamic fields for optional data
Related Topics
Ownership
Learn about ownership types and rules
Dynamic Fields
Extend objects with dynamic fields
Object Storage
Understand how objects are stored