Move.

Expert Q&A

Ask Move community experts

Sui.X.Peera.

Earn Your Share of 1000 Sui

Gain Reputation Points & Get Rewards for Helping the Sui Community Grow.

Posts

125
  • FUNLOP431.
    Aug 13, 2025
    Expert Q&A

    Mastering Move on Sui Network: The Complete Guide for Beginners and Builders

    If you’ve been around blockchain development, you’ve probably noticed a growing buzz about Sui Network and its unique programming language — Move. This isn’t just another “smart contract language” competing for developer attention. Move brings a completely different way of thinking about blockchain programming — one that’s fast, safe, and perfect for asset-based applications. In this post, you’ll get a comprehensive deep dive into Move on Sui — how it works, why it’s different, and how you can start building on it. We’ll also explore common mistakes, best practices, and real-world tips for success. 1. What is Move and Why Does Sui Use It? Move is a bytecode-based programming language originally developed by Meta (formerly Facebook) for the Libra/Diem blockchain. Sui adopted Move but extended and optimized it to fit its object-centric data model. At its core, Move is designed to securely manage digital assets. Traditional smart contract languages like Solidity treat assets as numbers in account balances — but in Move, assets are first-class citizens. This means: Assets cannot be accidentally duplicated. Assets cannot be lost without explicitly destroying them. Assets must have clear ownership. This philosophy makes it easier to reason about asset safety and prevents common bugs and hacks. Why Sui chose Move: Safety:** Asset ownership is enforced at the language level. Speed:** Move programs run fast and avoid unnecessary computation. Flexibility:** You can create custom asset types beyond simple tokens. Parallel Execution:** Sui’s architecture allows Move code to process transactions in parallel, increasing throughput. 2. How Move Works on Sui While other blockchains execute transactions sequentially, Sui organizes data into objects. Each object: Has an owner (could be a user, another object, or the system). Can only be modified by its owner or by specific Move functions. Has a unique ID. Move on Sui has three major concepts: Objects Everything stored on-chain is an object. Objects are stored and modified by Move modules. Example: a coin, an NFT, a game character. Modules Containers for Move code. Define types, functions, and rules for how objects behave. Transactions Actions users take. Call Move functions, passing in objects they own. 3. Comparing Move to Solidity | Feature | Move (Sui) | Solidity (Ethereum) | | ----------------- | ------------------------------------------------- | ------------------------------------------- | | Primary Focus | Asset safety, ownership | General smart contract logic | | Data Model | Object-based | Account-based | | Execution | Parallelized (when no object conflicts) | Sequential | | Type Safety | Strongly typed, resources can’t be copied/dropped | Looser type system | | Security | Prevents double spends & unintended asset loss | Common issues: reentrancy, integer overflow | If you’re coming from Solidity, you’ll notice that Move forces you to be explicit about asset handling. This is sometimes frustrating at first, but it’s also why Move programs are harder to exploit. 4. Writing Your First Move Module on Sui Let’s walk through a basic Move example: a module that creates and transfers a custom token. Creating a Token module my_project::my_coin { use sui::coin; use sui::transfer; use sui::tx_context::{self, TxContext}; /// Create a new coin type struct MyCoin has drop, store {} /// Initialize a new coin and send it to the transaction sender public entry fun mint(ctx: &mut TxContext) { let coin = coin::mint(1000, ctx); transfer::transfer(coin, tx_context::sender(ctx)); } } Explanation: struct MyCoin defines a new coin type. mint function creates 1,000 units of MyCoin and transfers them to the sender. TxContext gives access to transaction details (like who sent it). 5. Move’s Resource Types — The Secret Sauce Move introduces resource types, which are non-copyable, non-duplicable data structures. In everyday terms: if you have a \$10 bill, you can’t just “copy” it — you either hold it or give it away. Resources work the same way. In Move: struct MyCoin has key, store { value: u64 } key** — Can be stored as a top-level object. store** — Can be stored inside another object. If you try to copy a resource, the compiler will refuse to compile your code. This prevents bugs where assets are accidentally cloned. 6. The Sui-Specific Move Extensions Sui made several changes to vanilla Move to optimize it for object-based execution: Dynamic Object Fields:** You can add fields to objects after they’re created. Shared Objects:** Multiple users can interact with the same object. Mutable References:** Allow changing object data in a controlled way. Event Emission:** Move modules can emit events for off-chain listeners. For example, creating a shared game leaderboard: struct Leaderboard has key { scores: vector } This could be updated by multiple players without causing blockchain-wide bottlenecks. 7. Development Workflow Here’s the basic workflow for developing with Move on Sui: Install Sui CLI curl -fsSL https://sui.io/install.sh | bash Create a new Move package sui move new my_project Write your modules in the sources folder. Build your package sui move build Publish to Sui sui client publish --gas-budget 100000000 Call functions using: sui client call --package --module my_module --function my_function 8. Testing Your Move Code Sui Move supports unit testing right in the language. Example: #[test] fun test_mint() { let ctx = test::new_tx_context(@0x1); my_project::my_coin::mint(&mut ctx); // Add assertions here } Run tests: sui move test 9. Common Mistakes Beginners Make Forgetting to Pass TxContext** — Many functions need &mut TxContext to create or transfer objects. Misunderstanding Object Ownership** — If you don’t own it, you can’t mutate it. Not Handling Asset Destruction** — You must explicitly “destroy” resources you no longer need. Publishing Without Versioning** — Updating a module means publishing a new version. 10. Best Practices for Move on Sui Use clear naming conventions** — Makes code readable. Limit shared object usage** — They’re slower than owned objects. Emit events for state changes** — Helps with off-chain indexing. Write thorough tests** — The compiler catches a lot, but logic bugs still happen. Document your modules** — Future you will thank you. 11. Real-World Use Cases Gaming Assets** — Each sword, skin, or pet can be a unique object. NFT Marketplaces** — Safe transfers and auctions with built-in ownership checks. DeFi Protocols** — Lending, staking, and swaps using secure asset handling. Supply Chain Tracking** — Represent goods as objects moving through the system. 12. The Future of Move on Sui Sui’s Move language is still evolving. Current work includes: Better developer tooling. Standard libraries** for common patterns. Interoperability** with other blockchains. As adoption grows, we can expect richer documentation, larger open-source projects, and deeper integrations with Web3 infrastructure. Final Thoughts If you’re serious about building secure, high-performance blockchain apps, Move on Sui is worth your attention. Its strict but logical design helps you avoid entire categories of bugs while enabling innovative use cases that aren’t possible on traditional account-based chains. Whether you’re creating a DeFi protocol, a game, or a complex NFT ecosystem, Move gives you the building blocks for a safer, faster blockchain future.

    • Move CLI
    • Move
    • Smart Contract
    0
    1
  • Forever_A-gator.
    Apr 11, 2025
    Expert Q&A

    How to generate readable bytecode for Move with Miden Assembly?

    I'm trying to experiment with writing a Move compiler by using Miden Assembly as the compiler target. I want to generate readable bytecode for the compiled Move program. Is there a straightforward way to achieve this?

    • Move CLI
    0
    3
  • elfDani.
    Apr 11, 2025
    Expert Q&A

    Can modules generate multiple coins onchain seamlessly?

    I’m working on a module for prediction markets and need it to generate coins onchain through a factory class in a permissionless and verifiable way. Currently, modules have limitations like only one coin per module due to One Time Witness, which means I had to create an equivalent coin standard that users' wallets don't recognize as a coin. Can we resolve this in the next update?

    • Move CLI
    • Move Module
    0
    3
  • skywinder.
    Apr 10, 2025
    Expert Q&A

    What's a native function and can we call them directly?

    I've come across the term 'native function' in Move but can't find detailed information about it. I heard that they're declared in Move but defined externally, often in Rust. Does that mean they are internal functions that can't be called directly by wallets or other modules?

    • Move CLI
    • Move
    0
    3
  • kryptoschain.
    Apr 10, 2025
    Expert Q&A

    How to transfer an object owned by another object?

    I'm facing an issue with transferring an object A, which is owned by object B, and object B is owned by me. I'm getting an error saying the transaction was not signed by the correct sender. Does anyone know how to resolve this and properly receive object A?

    • Move CLI
    • Move
    0
    3
  • Pluto Dev👽.
    Apr 10, 2025
    Expert Q&A

    Converting a Public Key to Sui Address in Sui Move

    I'm trying to convert a public key into a Sui address using Sui Move but can't find any built-in function. I understand it's quite important for my work. Could someone explain how exactly to do this conversion?

    • Move CLI
    0
    2
  • yhant3.
    Apr 07, 2025
    Expert Q&A

    How to ensure only NFT owner can transfer it in a contract?

    Hey everyone! I'm working on implementing an NFT contract and want to make sure that only the rightful owner of the NFT can transfer it. I have this function for transferring: public fun transfer( nft: DevNetNFT, recipient: address, _: &mut TxContext ) { transfer::public_transfer(nft, recipient) } Is this checking done within the public_transfer method, or do I need to add additional logic?

    • Move CLI
    0
    3
  • Britain.
    Apr 07, 2025
    Expert Q&A

    How to fetch values from ObjectTable using Dynamic Fields?

    I'm trying to fetch values from an ObjectTable using Dynamic Fields from the frontend, but I'm encountering an error with dynamicFieldObject. The error says Unexpected arg String("gms") for the expected type Struct(MoveStructLayout...). How can I get the correct type for the value and avoid this error?

    • Move CLI
    • Move
    0
    3
  • Raju.
    Raju158
    Apr 06, 2025
    Expert Q&A

    How to test a function with a Receiving parameter in Sui?

    I'm trying to test the receive_object function with a Receiving parameter in Sui based on the docs at this link. Initially, I created a test using the example, but I'm struggling with how to get the sent argument to be a Receiving type. I've also tried denoting the receiving type, but encountered errors. Could someone guide me on properly testing this function?

    • Move CLI
    • Move
    0
    4
  • Santorini.
    Apr 06, 2025
    Expert Q&A

    How can I copy a vector<u64> to use multiple times?

    I'm trying to copy a vector into a local variable because I need two instances of the same vector for my project. I've seen some methods, but I'm not entirely sure how to implement them correctly. Can anyone guide me on the best practices or methods to achieve this in the Move programming language?

    • Move CLI
    • Move
    0
    4
Reward CampaignAugust
Top tags
  • Move CLI
  • Move
  • Move Module
  • Move Bug
  • Smart Contract
  • Move Script
  • Move Prover
  • Feature Request