Post
Share your knowledge.
+10
Sui Move vs Aptos Move - What is the difference?
Sui Move and Aptos Move - two prominent implementations of the Move programming language. While both are rooted in the same foundational principles, they have diverged significantly in design, execution, and ecosystem development. To better understand their differences, we need to uncover some of their key aspects:
How do their runtimes differ?
Both Sui and Aptos implement their own custom Move virtual machines (VMs). How does this impact performance, scalability, and developer experience? For instance:
- Does Sui's runtime optimize for parallel execution differently than Aptos'?
- Are there notable differences in transaction lifecycle management or gas models?
What are the differences between their standard libraries?
The Move standard library is a critical component for building smart contracts. However, Sui and Aptos have forked their implementations, leading to divergence:
- Are there modules or functions unique to one implementation but absent in the other?
- How do these differences affect common use cases like token creation, NFTs, or decentralized finance (DeFi)?
How does data storage differ between them?
One of the most significant distinctions lies in how Sui and Aptos handle data storage:
- Sui uses an object-centric model, where each object has its own ownership and permissions.
- Aptos, on the other hand, retains a more traditional account-based model similar to Ethereum.
- How does this impact state management, composability, and gas efficiency?
Is it fair to say that Aptos is closer to EVM while Sui is closer to SVM?
Some developers argue that Aptos' account-based architecture resembles Ethereum's EVM, while Sui's object-centric approach aligns more closely with Solana's SVM.
- Do you agree with this analogy? Why or why not?
- How does this architectural choice influence developer ergonomics and application design?
Are there universal packages working for both Sui Move and Aptos Move?
Given their shared origins, it would be ideal if some libraries or tools were interoperable across both ecosystems.
- Are there any existing universal packages or frameworks that work seamlessly on both platforms?
- If not, what are the main barriers to achieving compatibility?
Can one of them be transpiled into another?
If a project is built on Sui Move, could it theoretically be transpiled to run on Aptos Move, or vice versa?
- What are the technical challenges involved in such a process?
- Are there tools or compilers currently available to facilitate this kind of migration?
- Move
Answers
1Let’s compare about Sui Move vs. Aptos Move.These two are like siblings from the Move language fam, but they’ve definitely got their own personalities:
How they roll? The Runtime Differences: Performance, Scalability, and Developer Experience
Both Sui and Aptos implement custom Move virtual machines (VMs), which serve as their runtimes, influencing performance, scalability, and developer experience.
Research indicates that Sui Move’s like that friend who’s always rushing around, getting stuff done quick. Its virtual machine is built for speed—think 0.5 seconds to lock in a transaction, thanks to some fancy parallel execution tricks with a DAG setup (e.g., 0.5 seconds, as noted in Aptos vs. Sui vs. Movement: Move Blockchains Compared)
In contrast, Aptos employs a linear architecture with parallel execution capabilities, but its consensus on every transaction may introduce bottlenecks at scale, with finality around 0.9 seconds.
Sui’s causal ordering means many transactions don’t require full consensus, reducing latency, while Aptos uses AptosBFT, a derivative of HotStuff, ensuring quick finalization but potentially higher computational overhead.
Sui’s model includes a reference gas price set at the start of each epoch, based on validator inputs, ensuring predictability and low fees (e.g., average transaction fee of $0.0001, as per Sui vs. Aptos: Which Blockchain is Right for You?).
Standard Libraries: Modules, Functions, and Use Cases
Because Sui and Aptos have distinct architectural designs—Sui is object-centric, treating assets as transferable objects, while Aptos is account-based, associating assets with accounts—their standard libraries differ significantly in structure and usage.
Creating a Custom Token
In Aptos, the managed_coin module from the aptos_framework standard library provides a straightforward way to create and manage fungible tokens. Here's an example:
module example::MyToken {
use aptos_framework::managed_coin;
use std::signer;
/// Struct representing the custom token
struct MyToken has key { }
/// Initialize the token with name, symbol, decimals, and monitoring option
public entry fun initialize(account: &signer) {
managed_coin::initialize<MyToken>(
account,
b"MyToken", // Name
b"MTK", // Symbol
6, // Decimals
true, // Enable monitoring
);
}
/// Mint tokens to the caller's account
public entry fun mint(account: &signer, amount: u64) {
managed_coin::mint<MyToken>(account, amount);
}
}
This usecase creating a fungible token tied to an account, typical in account-based systems like Aptos.
In Sui, the coin
module from the sui standard library manages tokens as objects. You create a currency and use a TreasuryCap
object to mint coins. Here's an example:
module example::MyToken {
use sui::coin::{Self, Coin, TreasuryCap};
use sui::transfer;
use sui::tx_context::{Self, TxContext};
/// Struct defining the custom token type (with `drop` for currency creation)
struct MY_TOKEN has drop { }
/// Create a new currency and transfer its TreasuryCap and metadata
public entry fun create_currency(ctx: &mut TxContext) {
let (treasury_cap, metadata) = coin::create_currency(
MY_TOKEN {}, // Token type witness
6, // Decimals
b"MTK", // Symbol
b"MyToken", // Name
b"A custom token", // Description
option::none(), // Optional icon URL
ctx,
);
transfer::public_transfer(treasury_cap, tx_context::sender(ctx));
transfer::public_transfer(metadata, tx_context::sender(ctx));
}
/// Mint new coins using the TreasuryCap
public fun mint(
treasury_cap: &mut TreasuryCap<MY_TOKEN>,
amount: u64,
ctx: &mut TxContext
): Coin<MY_TOKEN> {
coin::mint(treasury_cap, amount, ctx)
}
}
Minting an NFT
Aptos uses the token module to manage non-fungible tokens (NFTs) within collections. Here's how to create a collection and mint an NFT:
module example::MyNFT {
use aptos_framework::token;
use std::string;
use std::signer;
/// Create a new NFT collection
public entry fun create_collection(creator: &signer) {
token::create_collection(
creator,
string::utf8(b"MyCollection"), // Collection name
string::utf8(b"A collection of NFTs"), // Description
string::utf8(b"https://example.com"), // URI
true, true, true, true, true, true, true, true, true, // Mutability flags
);
}
/// Mint an NFT within the collection
public entry fun mint_nft(
creator: &signer,
collection: &string::String,
name: &string::String,
uri: &string::String
) {
token::create_token(
creator,
*collection,
*name,
string::utf8(b"Description"), // Token description
1, // Maximum supply (1 for NFT)
*uri, // Token URI
0, 0, 0, // Royalty settings
vector::empty(), // Property keys
vector::empty(), // Property values
vector::empty(), // Property types
);
}
}```
Managing unique digital assets (e.g., artwork) within a structured collection, common in account-based NFT systems.
In Sui, NFTs are standalone `objects` with unique IDs, managed using the `object` and `transfer` modules. Here's an example:
```rust
module example::MyNFT {
use sui::object::{Self, UID};
use sui::transfer;
use sui::tx_context::{Self, TxContext};
use std::string;
/// Struct representing an NFT
struct MyNFT has key {
id: UID,
name: string::String,
uri: string::String,
}
/// Mint an NFT and transfer it to the sender
public entry fun mint(
ctx: &mut TxContext,
name: string::String,
uri: string::String
) {
let nft = MyNFT {
id: object::new(ctx), // Generate a unique ID
name,
uri,
};
transfer::transfer(nft, tx_context::sender(ctx));
}
}
Creating and transferring unique assets (e.g., collectibles) as independent objects, leveraging Sui's object-centric flexibility. These differences mean developers must adapt code, impacting development time and ecosystem interoperability.
Data Storage: Object-Centric vs. Account-Based Models
One of the most significant distinctions is in data storage. Sui employs an object-centric model, where each asset (e.g., tokens, NFTs) is an object with metadata, ownership, and permissions, stored on-chain with unique IDs (Object Model | Sui Documentation).This model allows for parallel state updates, enhancing composability and gas efficiency, as transactions often require only one ledger update (e.g., transferring an object updates its state, not multiple accounts).
Aptos, conversely, uses an account-based model, similar to Ethereum, where accounts own resources in global storage, necessitating updates to both sender and recipient accounts per transaction (Aptos vs. Sui - The Tie).
Closer to EVM or SVM?
The question of whether Aptos is closer to EVM (Ethereum Virtual Machine) and Sui to SVM (likely Solana Virtual Machine) requires clarification. Aptos’ account-based model aligns with EVM, updating account states per transaction, making it familiar for Ethereum developers (Aptos vs. Sui: Comparing Two Growing Layer-1 Blockchains).
Sui’s object-centric model, however, is unique, not directly comparable to SVM, which is account-based like Solana. Some developers argue Sui resembles Solana in scalability, but this is more about performance than data models. Thus, it’s fair to say Aptos is closer to EVM, while Sui’s model is distinct, not aligning with SVM, challenging the analogy.
Universal Packages: Compatibility and Barriers
Given their shared origins, ideal interoperability would involve universal packages. However, research suggests no such packages exist, as differences in standard libraries and data models create barriers.
For example, a package using Aptos’ aptos_coin wouldn’t work on Sui without rewriting for sui::coin (GitHub - pentagonxyz/movemate: Library of module building blocks for Move). Barriers include platform-specific APIs, object vs. account models, and divergent VM implementations, making seamless compatibility unlikely without significant adaptation.
Do you know the answer?
Please log in and share it.
Move is an executable bytecode language used to implement custom transactions and smart contracts.