Skip to main content
Objects are the fundamental units of storage on Sui. This guide covers how to create custom objects with different properties and behaviors.

Object Basics

All objects on Sui must have a unique identifier (UID) and the key ability.

Minimal Object

Object Abilities

Abilities define what operations can be performed on a struct.

The Four Abilities

  • key: Can be used as a top-level object (required for all Sui objects)
  • store: Can be stored inside other objects
  • copy: Can be copied
  • drop: Can be discarded/destroyed implicitly

Common Ability Combinations

Object Types

Owned Objects

Objects owned by an address. This is the most common type. From examples/move/nft:

Nested Objects

Objects can contain other objects with the store ability:

Objects with Options

Real-World Example: Game Characters

From examples/move/hero:

Object Transfer Patterns

Direct Transfer

Transfer with Custom Logic

Freeze Object

Make an object immutable:

Object Deletion

Objects without drop must be explicitly deleted:

Dynamic Fields

Attach data to objects dynamically:

Object Display

Define how objects appear in wallets and explorers:

Best Practices

1. Use descriptive struct names

2. Choose abilities carefully

4. Clean up resources

5. Document object lifecycle

Next Steps