Sui.

Home

Welcome to Sui Community Forum

Sui.X.Peera.

Earn Your Share of 1000 Sui

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

Bounty Posts

  • Bounty+15

    Xavier.eth.
    Jun 27, 2025
    Expert Q&A

    Sui Transaction Failing: Objects Reserved for Another Transaction

    I'm encountering a persistent JsonRpcError when trying to execute transactions on Sui. The error indicates that objects are reserved for another transaction, even though I've implemented sequential transaction processing with delays. JsonRpcError: Failed to sign transaction by a quorum of validators because one or more of its objects is reserved for another transaction. Other transactions locking these objects: AV7coSQHWg5vN3S47xada6UiZGW54xxUNhRv1QUPqWK (stake 33.83) 0x1c20f15cbe780ee7586a2df90c1ab70861ca77a15970bea8702a8cf97bd3eed9 0x1c20f15cbe780ee7586a2df90c1ab70861ca77a15970bea8702a8cf97bd3eed9 0x1c20f15cbe780ee7586a2df90c1ab70861ca77a15970bea8702a8cf97bd3eed9 I've tried: Sequential transaction execution (waiting for previous transaction to complete) Added 3-second delays between transactions And still getting the same error consistently. Using Sui RPC for transaction submission. The same object ID appears multiple times in the lock list. Error occurs even with careful transaction sequencing. What causes objects to be "reserved" for other transactions? How can I properly check if an object is available before using it in a transaction? Are there best practices for handling object locks in Sui? Could this be related to transaction finality timing? Has anyone encountered this issue before? Any insights on proper object management in Sui transactions would be greatly appreciated!

    • Sui
    • Transaction Processing
    • Move
    2
    4
  • Bounty+15

    Xavier.eth.
    Jun 17, 2025
    Expert Q&A

    How do ability constraints interact with dynamic fields in heterogeneous collections?

    I'm building a marketplace that needs to handle multiple asset types with different ability requirements, and I've hit some fundamental questions about Move's type system. I want to store different asset types in the same collection, but they have different abilities: Regular NFTs: key + store (transferable) Soulbound tokens: key only (non-transferable) Custom assets with transfer restrictions public struct Marketplace has key { id: UID, listings: Bag, // Want to store different asset types here } // This works for transferable assets public fun list_transferable( marketplace: &mut Marketplace, asset: T, price: u64 ) { /* ... */ } // But how to handle soulbound assets? public fun list_soulbound( // No store ability marketplace: &mut Marketplace, asset_ref: &T, // Can only take reference price: u64 ) { /* How do I store metadata about this? */ } Key Questions: Ability Requirements: When using dynamic_field::add(), does V always need store at compile time? Can wrapper types work around this? Heterogeneous Storage: Can a single Bag store objects with different ability sets (key + store + copy vs key + store), and handle them differently at runtime? Type Safety: Since dynamic fields perform type erasure, how do I maintain type safety when retrieving values? What's the pattern for storing type metadata? Witness Pattern: How do ability constraints work with phantom types? Can I store Asset and Asset in the same collection and extract type info later? Building a system where NFTs, soulbound tokens, and restricted assets all need marketplace functionality but with different transfer semantics. I’ve tried wrapper types, multiple collections per ability set, separate type metadata storage. Each has tradeoffs between type safety, gas costs, and complexity.

    • Sui
    • Architecture
    0
    4
    Best Answer
Reward CampaignJuly

New Articles

  • article banner.
    harry phan.
    Jul 08, 2025
    Article
    Sui CLI Cheat Sheet part 2

    Gas and Faucet with Sui CLI When you’re developing your apps, ideally, you’ll start out on devnet, then testnet before deploying to mainnet. Devnet and Testnet gas are free to acquire. But mainnet? nah. You can easily request gas on devnet with the client faucet command: sui client faucet For testnet, you’ll need to execute this cURL command to request gas: curl --location --request POST 'https://faucet.devnet.sui.io/v1/gas' \ --header 'Content-Type: application/json' \ --data-raw '{ "FixedAmountRequest": { "recipient": "" } }' You can also visit the official Sui faucet website to claim some Devnet and Testnet tokens. Use the client gas command to check the client’s available gas tokens on the current environment. sui client gas For mainnet transactions, you’ll need to acquire Sui from exchanges and fund your wallet. Publishing Packages You can publish packages on to the Sui network with the client publish command. sui client publish [OPTIONS] [package_path] Here’s an example command for publishing a package with 5000000 MIST gas budget. sui client publish --gas-budget 5000000 The gas budget isn’t fixed, you most likely want to check onchain for a suitable gas amount and pay it forward. Coin Management with Sui CLI When you’re working with SUI coins, You’ll probably need to merge and split them often—especially when youjuggling gas or sending different amounts to various contracts or users. If you’ve have two coins lying around, and you want to consolidate them, use the merge-coin command like this: sui client merge-coin --primary-coin --coin-to-merge The primary-coin is the one you’ll keep, and the coin-to-merge is the one that gets absorbed. Need to split a coin instead? Maybe you want to pay out to multiple recipients or just need different denominations. You can slice a coin up using split-coin like this: sui client split-coin --coin-id --amounts If you need to send out coins, you’ll use the client transfer-sui command like this: sui client transfer-sui --sui-coin-object-id --to It’s a simple handoff—you give it the coin ID and the recipient’s address, and it moves the funds. Sui has programmable transactions so you can send to multiple recipients at once with the pay-sui command: sui client pay-sui --input-coins --recipients --amounts You’ll pass a coin (or a list of coins), and then specify the recipients and how much each should get. It’s perfect for batch payments or distributing tokens in bulk. Object Management with Sui CLI Sui is all about objects. Contracts, tokens, and even your coins—they're all objects. To get detailed info on any object, just call: sui client object This will spit out all the metadata, owner info, and anything else the object is carrying. If your object has dynamic fields (like a registry or a growing data structure), you can dig into those too: sui client dynamic-field This is very handy feature you might use often during development. Programmable Transaction Blocks (PTBs) Sui is one of the few chains with native PTBs. Programmable Transaction Blocks let you bundle multiple operations into a single transaction—kinda like a mini-script that executes on-chain. Say you need to call a Move function directly from your CLI. You’ll do that like this: sui client ptb --move-call :::: "" Replace the package address, module name, and function you’re targeting. Then drop in the type and arguments as needed. And if you want to transfer multiple objects to another wallet in one go, you can use PTBs as well: sui client ptb --transfer-objects "[]" Wrap the object IDs in brackets if you’re sending more than one, and finish it off with the recipient’s address. Conclusion Hopefully, this article suffices for introducting you to the Sui CLI tool. It’s more than a client, there’s a lot you can do with this tool. If you ever need a quick refresher or you’re trying out a new command, make the Sui CLI Cheat Sheet your best friend. And when in doubt, the Sui Client CLI Docs have the full breakdown.

    0
  • article banner.
    harry phan.
    Jul 08, 2025
    Article
    Sui CLI Cheat Sheet part 1

    When developing smart contracts, it’s also essential to create a client that can interact with them. Beyond just pulling data from the blockchain, clients can also read from and execute functions defined by the contract’s available primitives. One of the most convenient tools for this job is the Sui CLI, as it allows you to make command-line calls from virtually any programming language you choose to use for your client. In this guide, I’ll walk you through the key commands you’ll commonly use while working with Sui. Getting Started with Sui CLI To begin, you’ll need to install the Sui CLI on your machine. The installation process depends on your operating system and preferred package manager. If you’re using a Unix-based system like macOS or Linux and have Homebrew installed, simply run the following command in your terminal to install the Sui CLI: brew install sui Execute this command on your terminal to install Sui CLI if you’re running Windows via Chocolatey: choco install sui Another route you can use is the Cargo (Rust package manager) route. First, you’ll need to have Rust installed (ships with cargo) and then execute this command to install Sui CLI. cargo install --locked --git https://github.com/MystenLabs/sui.git --branch testnet sui --features tracing You can always execute the --version flag to verify your installation and check the version of Sui CLI you have installed. sui --version One flag you’ll use frequently is the—- help flag for the description of every command: sui --help It works with almost every command. It should be your mantle whenever you’re stuck: Regardless of the command using -h or --help for help would always be handy. Environment Management with Sui CLI Every chain provides you with three fundamental networks: Mainnet, Testnet, and Devnet. You can also spawn a test chain locally to keep development in stealth mode. Here’s the command you’ll execute to spawn a local network. RUST_LOG="off,sui_node=info" sui start --with-faucet --force-regenesis The command calls the Sui CLI binary to start a faucet service and generate a new genesis block without persisting the local network state. Now, you can connect to the local network with the new-env command like this: sui client new-env --alias local --rpc sui client new-env --alias local --rpc http://127.0.0.1:9000 You can switch and activate any environment with this general command. sui client switch --env Now, you can use this command to set the active environment to the new local environment you’ve created. sui client switch --env local The command switches the currently active environment to the local network you’re running. Address and Key Management with Sui CLI You’ll be switching keys as you deploy smart contracts over the Sui CLI, so here’s how to do that. You can view the currently active address with the active-address command: sui client active-address You can list all the addresses in your client with the addresses command. sui client addresses You can switch addresses as you please with the --address flag before specifying the address. Key Management with Sui CLI When building your apps, for security or other reasons, you might want to run CLI commands to work with keys. The keytool command is You can list all the keys in a keystore with the list command like this: sui keytool list You can generate keys with the generate command followed with a specification of the scheme. sui keytool generate [OPTIONS] [DERIVATION_PATH] [WORD_LENGTH] You’re probably familiar with the ed25519 since that’s what most wallets use. Specify it like this. sui keytool generate ed25519 You should get the output with the Sui address, mnemonic and other details. sui keytool import "" ed25519 When you’ve imported it, you can switch to the keypair and start sending transactions with it.

    0
  • article banner.
    Sui Maxi.
    Jul 08, 2025
    Article
    What is a Dex Aggregator

    Let’s say you want to swap 1 SUI for USDC. The market rate says 1 SUI = 3 USDC, so you expect to receive 3 USDC in return. But when you actually make the trade, you end up with only 2.9 USDC. That 0.1 USDC loss is due to slippage—the price impact caused by shallow liquidity in the pool you're swapping through. This is where DEX aggregators come in. What Is a DEX Aggregator? A DEX aggregator is a powerful tool that helps you find the best price for your trade by scanning multiple decentralized exchanges (DEXs) in the ecosystem. Instead of routing your swap through just one pool, it looks across all available liquidity sources and chooses the most efficient route to reduce slippage and maximize returns. Two Types of Aggregators 1. Off-Chain Aggregators (Backend) These services run on a centralized backend that constantly queries DEX prices, simulates swap outcomes, and determines the best path. The final swap route is sent to your wallet or frontend for execution. ✅ Faster calculations ❌ Requires trust in the backend logic 2. On-Chain Aggregators (Smart Contract) Built entirely on smart contracts, these aggregators calculate and execute routes directly on-chain. Thanks to Sui's Programmable Transaction Blocks (PTBs), these smart contracts can perform atomic routing, meaning the entire multi-hop swap is executed as one transaction, ensuring: ✅ No risk of partial swaps ✅ Fully trustless ✅ Composable with other DeFi protocols on Sui Example 7K Aggregator Cetus So How Do Aggregators Calculate the Best Route? To determine the optimal path, a DEX aggregator evaluates multiple factors: Liquidity Depth**: Pools with more liquidity cause less price impact Swap Fees**: Lower fees lead to better net returns Slippage**: The price impact of large trades Gas Efficiency**: Routes with fewer hops or contracts are cheaper Real-Time Pool Data**: Aggregators simulate swap results across paths By combining all these inputs, the aggregator selects the route (or combination of routes) that gives the highest return for the user.

    0
  • article banner.
    Meaning.Sui.
    Jul 08, 2025
    Article
    📦 In-depth Analysis of the `sui::package` Module: Package Publishing & Upgrading in Move

    In the rapid evolution of blockchain technology, the Move programming language stands out for its security, flexibility, and auditability. One of its core strengths is the refined management of smart contract packages. This article dives deep into the sui::package module — the engine behind publishing, upgrading, and maintaining Move packages on the Sui blockchain. 🔍 Module Overview sui::package is a cornerstone in the Move ecosystem. It provides developers with robust tools and interfaces to manage packages securely and efficiently. 📦 Declaration & Imports module sui::package; use std::ascii::String; use std::type_name; use sui::types; This defines the module and brings in essential Move standard libraries and Sui-native modules for complex logic. 🧩 Core Structures & Public Interfaces 1. Publisher Handles the publisher identity of a package. Key functions: claim claim_and_keep burn_publisher 2. UpgradeCap Controls a package’s upgrade capability. Key fields: package_id version policy (upgrade policy) Key functions: upgrade_package restrict 3. UpgradeTicket Grants permission for a specific upgrade. Key functions: ticket_package ticket_policy ticket_digest 4. UpgradeReceipt Issued after a successful upgrade. Key functions: receipt_cap receipt_package 🚨 Error Constants Helps developers debug with clarity. ENotOneTimeWitness: The one-time witness is invalid ETooPermissive: Upgrade policy is too lenient EInvalidPackage: The package provided is invalid 🔒 Upgrade Strategy Constants Controls how packages may evolve: COMPATIBLE: Backward-compatible upgrades ADDITIVE: Add new features, but don't change/delete existing ones DEP_ONLY: Only dependency changes allowed These constants enforce safe and controlled upgrades. 🧱 Structure Definitions Publisher package address**: Uniquely identifies the publisher module name**: The publisher’s module namespace UpgradeCap package ID**: The target package version**: Current version policy**: Upgrade policy applied UpgradeTicket upgrade_cap_id**: Link to the controlling UpgradeCap package_id**: Target package policy**: Upgrade policy used digest**: Bytecode summary (vector of bytes) UpgradeReceipt upgrade_cap_id**: Controller identity package_id**: The upgraded package 🧠 Core Function Definitions claim fun claim(otw: &OneTimeWitness) -> Publisher; Claims a publisher identity using a one-time witness (OTW). Ensures uniqueness and trust. claim_and_keep fun claim_and_keep(otw: &OneTimeWitness) -> Publisher; Similar to claim, but sends the Publisher object to the caller’s account. burn_publisher fun burn_publisher(publisher: &mut Publisher); Destroys a publisher identity and all associated privileges. authorize_upgrade fun authorize_upgrade(cap: &UpgradeCap, package_id: &PackageID, policy: u8, digest: &vector) -> UpgradeTicket { assert!(cap.package_id == *package_id, EInvalidPackage); assert!(cap.policy ) -> UpgradeReceipt { // Upgrade logic } Verifies UpgradeTicket Replaces the current package code with the new bytecode (data) Returns a UpgradeReceipt as proof of successful upgrade restrict fun restrict(cap: &mut UpgradeCap, policy: u8) { assert!(cap.policy With modules like sui::package, the Move language continues to show its strength in modular design, security-first architecture, and developer ergonomics — paving the way for scalable, secure Web3 systems.

    0
  • article banner.
    Meaning.Sui.
    Jul 08, 2025
    Article
    In-depth analysis of Move VM technical details

    Sui: In-depth Analysis of Move VM Technical Details In today's blockchain technology field, Move VM, as a key technical component, plays an important role in Sui. This article provides an in-depth analysis of Move VM’s technical details, including: Initialization process Code caching mechanism Module & script publishing Function execution Binary format analysis 1. Move VM Initialization The initialization of Move VM is simple and efficient. It requires just a single Loader instance — essentially a few Mutex-protected empty tables like HashMap and Vec. This process is low-cost and sets the groundwork for all VM operations. Move VM uses on-demand code loading. Code isn’t preloaded; instead, it's fetched at runtime during function or script execution. Once loaded, modules/scripts are cached and reused, boosting performance significantly. 2. Code Caching Mechanism 2.1 First-Time Loading When the VM loads a module for the first time: Queries the data store to fetch binary data (Vec) Deserializes and verifies the data for accuracy and integrity Loads all dependencies with the same process Links the module with its dependencies Caches the module via Loader for reuse during the VM lifecycle 2.2 Cache Coherence System transactions** (like hard upgrades) may break code cache coherency. The client should suspend transaction processing and restart the VM when this happens. Clients must align their DataStore view with loaded code, and re-instantiate the VM if needed. 3. Module Publishing Process To publish a module, the client calls publish_module with: Serialized module bytes Sender’s address A reference to GasMeter Steps: Deserialization If it fails → return an error. Address Validation Module address must match sender address → else MODULE_ADDRESS_DOES_NOT_MATCH_SENDER. Duplication Check Re-publishing same-named module → DUPLICATE_MODULE_NAME error. Load Verification Ensures module is loadable later. Fails? Return error. Write to Storage Once verified, the serialized module is saved and considered valid. 4. Script Execution Mechanism A script in Move is essentially a one-off function, often used to execute transactions. Steps: Load Script & Main Function Calculate sha3_256 hash of the script. Use hash to check if it's in the cache. If not cached → load and verify. Verify main function type params. Build Parameter List Signer values based on sender accounts. Other args must match allowed types → else TYPE_MISMATCH. Execute Script VM calls interpreter. On error → transaction fails and error returned. Else → return success. 5. Script Function Execution Introduced in Move VM v2.0. Works like a regular script Source is a script-visible function inside an on-chain module Steps: Load the function using ModuleId and function name Check visibility (script) Not script-visible? → EXECUTE_SCRIPT_FUNCTION_CALLED_ON_NON_SCRIPT_VISIBLE Execute same as normal script 6. General Function Execution Move VM allows you to execute any function in a module by name. Function names are unique in a module → no signature needed. Execution Steps: Load Module If error → return failure Resolve Function If not found → FUNCTION_RESOLUTION_FAILURE Check type params match → else error Build Parameter List Match all params to allowed types → else TYPE_MISMATCH Execute Interpreter runs the function VM returns result 7. Binary Format Analysis 7.1 Overall Architecture All modules/scripts exist in binary form Modules = collections of functions & structs Scripts = simple entry points (no return value) Uses ULEB128 for integer compression and size-prefixing for vectors. 7.2 Binary Header 3 components: Magic**: Fixed 4 bytes → 0xA1, 0x1C, 0xEB, 0x0B Version**: 4-byte little-endian int Table count**: ULEB128 7.3 Table Headers Each header includes: TableKind (1 byte) TableOffset (ULEB128) TableLength (ULEB128) Tables must be contiguous, non-overlapping. 7.4 Table Details Tables describe: MODULE_HANDLES: module locations via index ADDRESS_IDENTIFIERS, IDENTIFIERS, STRUCT_HANDLES, FUNCTION_HANDLES: type and function metadata FUNCTION_INSTANTIATIONS, SIGNATURES, CONSTANT_POOL: instantiations and constants 7.5 Auxiliary Definitions Type Parameter Kind: 1 byte → ALL, COPYABLE, RESOURCE SignatureToken: 1 byte to represent types (U8, U64, STRUCT, etc.) Bytecodes: 1 byte opcode + optional payload → e.g., POP, RET, BR_TRUE 7.6 Script Specific Binary Data Scripts lack FUNCTION_DEFINITIONS Instead, they embed entry info directly: Type parameter count & types Param type indexes Bytecode length & body ✅ Conclusion Move VM offers a powerful, secure, and efficient environment for blockchain execution. By understanding: VM initialization Caching strategies Function/module execution Binary structure Developers can optimize their Move-based apps and debug issues effectively — contributing to the evolution of the Sui ecosystem.

    0
  • article banner.
    Arnold.
    Jul 07, 2025
    Article
    Is Sui’s Consensus Mechanism Truly Faster Than Others?

    Blockchain speed is a critical factor for mass adoption, and Sui Network claims to be one of the fastest Layer 1 (L1) platforms, boasting sub-second finality and 100,000+ TPS (transactions per second). But how does Sui’s consensus mechanism compare to giants like Solana, Ethereum, and Aptos? This article breaks down: How Sui’s Narwhal & Bullshark consensus works Benchmarks vs. Solana, Ethereum, Aptos, and others Real-world performance vs. theoretical claims Trade-offs: Does speed sacrifice decentralization? 1. How Sui’s Consensus Works: Narwhal & Bullshark Sui uses a two-part consensus model designed for maximum speed: Narwhal (Mempool Optimizer) Decouples transaction dissemination from ordering** Uses a Directed Acyclic Graph (DAG) to process transactions in parallel Ensures data availability before consensus begins Bullshark (Consensus Engine) HotStuff-based** (like Facebook’s Libra/Diem) Focuses only on ordering transactions (not execution) Achieves instant finality (no probabilistic confirmation) Result: Sui avoids bottlenecks seen in traditional blockchains. 2. Speed Comparison: Sui vs. Competitors | Blockchain | Consensus Model | Max TPS (Theoretical) | Finality Time | Key Limitation | |----------------|--------------------------|--------------------------|------------------|----------------------------------| | Sui | Narwhal-Bullshark (DAG) | 100,000+ | <1 second | Early-stage decentralization | | Solana | PoH + Tower BFT | 65,000 | 2-6 seconds | Frequent outages under load | | Aptos | DiemBFT v4 | 30,000 | 1-2 seconds | Similar to Sui but less optimized| | Ethereum | Gasper (PoS) | 15-30 (L1) | 12-15 min | Slow without L2 scaling | | Polygon | IBFT PoS | 7,000 | 2-6 seconds | Relies on Ethereum security | Key Takeaway: Sui’s parallel processing gives it a theoretical edge in scalability. Real-world TPS** depends on network demand (Sui’s current live TPS is ~1,000-5,000). 3. What Makes Sui Faster? Parallel Execution (No Block Bottlenecks) Most blockchains (e.g., Ethereum) process transactions sequentially. Sui processes independent transactions in parallel (like Solana, but more efficiently). No Global Consensus for Simple Transactions Single-owner transactions* (e.g., token transfers) skip full consensus, using *Byzantine Consistent Broadcast** instead. Only complex transactions (e.g., DeFi swaps) require full ordering. Optimized Data Structures (DAG vs. Linear Blocks) Sui’s DAG-based mempool prevents congestion. Solana’s linear blocks sometimes clog under spam. 4. Real-World Performance vs. Lab Benchmarks Theoretical TPS:* Sui claims *100K+**, but real-world usage is lower (similar to Solana’s 65K claim vs. ~3K average). Testnet Demo:* Sui processed *120,000 TPS** in a controlled environment. Mainnet Reality:* Current average is *1,000-5,000 TPS** (still faster than Ethereum’s 15 TPS). Why the Gap? Demand:** Few dApps push Sui to full capacity yet. Validator Scaling:** More validators = higher throughput (Sui is still growing). 5. Trade-Offs: Does Speed Sacrifice Decentralization? Fewer Validators = Centralization Risk Sui launched with 20-30 validators (vs. Ethereum’s 900,000). Plan:* Expand to *hundreds** over time. Move Language Lock-In Sui’s speed relies on Move, which limits developer flexibility vs. Ethereum’s Solidity. Early-Stage Optimizations Some shortcuts (like skipping consensus for simple txns) could introduce edge-case risks. 6. Verdict: Is Sui the Fastest Blockchain? Yes, for Certain Use Cases Simple transactions* (payments, NFT mints) are *blazing fast**. High-throughput dApps** (gaming, social) benefit most. Not Universally Faster (Yet) Complex DeFi** (e.g., AMM swaps) still needs full consensus. Decentralization lags** behind Ethereum. Final Answer: Sui is one of the fastest L1s today, especially for parallelizable tasks. But real-world adoption will determine if it outpaces Solana, Aptos, and Ethereum L2s long-term.

    0
  • article banner.
    Arnold.
    Jul 07, 2025
    Article
    Is Sui’s Consensus Mechanism Truly Faster Than Others?

    Blockchain speed is a critical factor for mass adoption, and Sui Network claims to be one of the fastest Layer 1 (L1) platforms, boasting sub-second finality and 100,000+ TPS (transactions per second). But how does Sui’s consensus mechanism compare to giants like Solana, Ethereum, and Aptos? This article breaks down: How Sui’s Narwhal & Bullshark consensus works Benchmarks vs. Solana, Ethereum, Aptos, and others Real-world performance vs. theoretical claims Trade-offs: Does speed sacrifice decentralization? 1. How Sui’s Consensus Works: Narwhal & Bullshark Sui uses a two-part consensus model designed for maximum speed: Narwhal (Mempool Optimizer) Decouples transaction dissemination from ordering** Uses a Directed Acyclic Graph (DAG) to process transactions in parallel Ensures data availability before consensus begins Bullshark (Consensus Engine) HotStuff-based** (like Facebook’s Libra/Diem) Focuses only on ordering transactions (not execution) Achieves instant finality (no probabilistic confirmation) Result: Sui avoids bottlenecks seen in traditional blockchains. 2. Speed Comparison: Sui vs. Competitors | Blockchain | Consensus Model | Max TPS (Theoretical) | Finality Time | Key Limitation | |----------------|--------------------------|--------------------------|------------------|----------------------------------| | Sui | Narwhal-Bullshark (DAG) | 100,000+ | <1 second | Early-stage decentralization | | Solana | PoH + Tower BFT | 65,000 | 2-6 seconds | Frequent outages under load | | Aptos | DiemBFT v4 | 30,000 | 1-2 seconds | Similar to Sui but less optimized| | Ethereum | Gasper (PoS) | 15-30 (L1) | 12-15 min | Slow without L2 scaling | | Polygon | IBFT PoS | 7,000 | 2-6 seconds | Relies on Ethereum security | Key Takeaway: Sui’s parallel processing gives it a theoretical edge in scalability. Real-world TPS** depends on network demand (Sui’s current live TPS is ~1,000-5,000). 3. What Makes Sui Faster? Parallel Execution (No Block Bottlenecks) Most blockchains (e.g., Ethereum) process transactions sequentially. Sui processes independent transactions in parallel (like Solana, but more efficiently). No Global Consensus for Simple Transactions Single-owner transactions* (e.g., token transfers) skip full consensus, using *Byzantine Consistent Broadcast** instead. Only complex transactions (e.g., DeFi swaps) require full ordering. Optimized Data Structures (DAG vs. Linear Blocks) Sui’s DAG-based mempool prevents congestion. Solana’s linear blocks sometimes clog under spam. 4. Real-World Performance vs. Lab Benchmarks Theoretical TPS:* Sui claims *100K+**, but real-world usage is lower (similar to Solana’s 65K claim vs. ~3K average). Testnet Demo:* Sui processed *120,000 TPS** in a controlled environment. Mainnet Reality:* Current average is *1,000-5,000 TPS** (still faster than Ethereum’s 15 TPS). Why the Gap? Demand:** Few dApps push Sui to full capacity yet. Validator Scaling:** More validators = higher throughput (Sui is still growing). 5. Trade-Offs: Does Speed Sacrifice Decentralization? Fewer Validators = Centralization Risk Sui launched with 20-30 validators (vs. Ethereum’s 900,000). Plan:* Expand to *hundreds** over time. Move Language Lock-In Sui’s speed relies on Move, which limits developer flexibility vs. Ethereum’s Solidity. Early-Stage Optimizations Some shortcuts (like skipping consensus for simple txns) could introduce edge-case risks. 6. Verdict: Is Sui the Fastest Blockchain? Yes, for Certain Use Cases Simple transactions* (payments, NFT mints) are *blazing fast**. High-throughput dApps** (gaming, social) benefit most. Not Universally Faster (Yet) Complex DeFi** (e.g., AMM swaps) still needs full consensus. Decentralization lags** behind Ethereum. Final Answer: Sui is one of the fastest L1s today, especially for parallelizable tasks. But real-world adoption will determine if it outpaces Solana, Aptos, and Ethereum L2s long-term.

    0
  • article banner.
    Evgeniy CRYPTOCOIN.
    Jul 07, 2025
    Article
    Can Machine Learning Improve Blockchain Security?

    Blockchain technology is designed to be secure, but it’s not immune to exploits—DeFi hacks, smart contract vulnerabilities, and Sybil attacks have led to billions in losses. Could machine learning (ML) be the solution? This article explores: How ML can detect and prevent blockchain attacks Current security weaknesses in crypto Real-world projects using AI for blockchain security The risks and limitations of relying on ML 1. How Machine Learning Can Enhance Blockchain Security Fraud Detection & Anomaly Monitoring ML models analyze transaction patterns to flag: Unusual wallet activity (e.g., sudden large withdrawals) Rug pulls & pump-and-dump schemes Phishing scams (malicious smart contracts) Example: Chainalysis uses ML to track illicit crypto flows. Smart Contract Vulnerability Detection AI-powered tools (Slither, MythX) scan for: Reentrancy bugs (like the $60M DAO hack) Integer overflows Logic flaws in DeFi protocols Example: Certora uses formal verification + ML to audit contracts. Sybil Attack & 51% Attack Prevention ML identifies fake nodes or malicious validators by analyzing: IP clustering Staking behavior anomalies Example: Aleo uses zero-knowledge proofs + ML for privacy-preserving validation. Predictive Threat Intelligence ML forecasts new attack vectors by learning from past exploits. Can predict flash loan attack targets before they happen. 2. Current Weaknesses in Blockchain Security | Vulnerability | Impact | Can ML Help? | |-------------------------|------------------------------------|--------------------------------| | Smart Contract Bugs | $3B+ lost in 2023 | ✅ (Automated auditing) | | Oracle Manipulation | Exploits like Mango Markets ($114M)| ✅ (Anomaly detection) | | MEV (Miner Extractable Value) | Unfair front-running | ⚠️ (Partial mitigation) | | Private Key Theft | $1B+ yearly losses | ❌ (ML can’t prevent phishing) | 3. Real-World Projects Using ML for Blockchain Security Forta Network Decentralized threat detection** using ML-powered bots. Alerts for malicious transactions in real time. Elliptic AI-driven blockchain analytics** to track stolen funds. Used by regulators and exchanges. Halborn ML + ethical hacking** to audit blockchains like Solana and Sui. 4. Risks & Limitations of ML in Blockchain Security Adversarial Machine Learning Hackers can trick ML models with poisoned data. Example: Fooling an AI auditor into approving a malicious contract. Over-Reliance on Black-Box AI If an ML model flags a transaction, can we trust it without explanation? Regulators may demand transparency** in automated decisions. Centralization Risks Many ML security tools rely on centralized data feeds. Conflicts with blockchain’s decentralization ethos. 5. The Future: AI-Augmented Blockchain Security Hybrid human-AI audits** (AI flags risks, humans verify). On-chain ML models** (e.g., AI validators in PoS networks). Predictive DeFi shields** (auto-pausing protocols if an attack is likely). Conclusion: ML is a Powerful Tool—But Not a Silver Bullet Machine learning can significantly improve blockchain security, but it won’t eliminate all risks. The best approach? Combine AI automation with human expertise for a safer Web3 future. What do you think? Would you trust an AI to secure a $1B DeFi protocol?** Can decentralized ML solutions replace traditional auditors?** Discuss below! 💬

    0
  • article banner.
    Evgeniy CRYPTOCOIN.
    Jul 07, 2025
    Article
    Can Machine Learning Improve Blockchain Security?

    Blockchain technology is designed to be secure, but it’s not immune to exploits—DeFi hacks, smart contract vulnerabilities, and Sybil attacks have led to billions in losses. Could machine learning (ML) be the solution? This article explores: How ML can detect and prevent blockchain attacks Current security weaknesses in crypto Real-world projects using AI for blockchain security The risks and limitations of relying on ML 1. How Machine Learning Can Enhance Blockchain Security Fraud Detection & Anomaly Monitoring ML models analyze transaction patterns to flag: Unusual wallet activity (e.g., sudden large withdrawals) Rug pulls & pump-and-dump schemes Phishing scams (malicious smart contracts) Example: Chainalysis uses ML to track illicit crypto flows. Smart Contract Vulnerability Detection AI-powered tools (Slither, MythX) scan for: Reentrancy bugs (like the $60M DAO hack) Integer overflows Logic flaws in DeFi protocols Example: Certora uses formal verification + ML to audit contracts. Sybil Attack & 51% Attack Prevention ML identifies fake nodes or malicious validators by analyzing: IP clustering Staking behavior anomalies Example: Aleo uses zero-knowledge proofs + ML for privacy-preserving validation. Predictive Threat Intelligence ML forecasts new attack vectors by learning from past exploits. Can predict flash loan attack targets before they happen. 2. Current Weaknesses in Blockchain Security | Vulnerability | Impact | Can ML Help? | |-------------------------|------------------------------------|--------------------------------| | Smart Contract Bugs | $3B+ lost in 2023 | ✅ (Automated auditing) | | Oracle Manipulation | Exploits like Mango Markets ($114M)| ✅ (Anomaly detection) | | MEV (Miner Extractable Value) | Unfair front-running | ⚠️ (Partial mitigation) | | Private Key Theft | $1B+ yearly losses | ❌ (ML can’t prevent phishing) | 3. Real-World Projects Using ML for Blockchain Security Forta Network Decentralized threat detection** using ML-powered bots. Alerts for malicious transactions in real time. Elliptic AI-driven blockchain analytics** to track stolen funds. Used by regulators and exchanges. Halborn ML + ethical hacking** to audit blockchains like Solana and Sui. 4. Risks & Limitations of ML in Blockchain Security Adversarial Machine Learning Hackers can trick ML models with poisoned data. Example: Fooling an AI auditor into approving a malicious contract. Over-Reliance on Black-Box AI If an ML model flags a transaction, can we trust it without explanation? Regulators may demand transparency** in automated decisions. Centralization Risks Many ML security tools rely on centralized data feeds. Conflicts with blockchain’s decentralization ethos. 5. The Future: AI-Augmented Blockchain Security Hybrid human-AI audits** (AI flags risks, humans verify). On-chain ML models** (e.g., AI validators in PoS networks). Predictive DeFi shields** (auto-pausing protocols if an attack is likely). Conclusion: ML is a Powerful Tool—But Not a Silver Bullet Machine learning can significantly improve blockchain security, but it won’t eliminate all risks. The best approach? Combine AI automation with human expertise for a safer Web3 future. What do you think? Would you trust an AI to secure a $1B DeFi protocol?** Can decentralized ML solutions replace traditional auditors?** Discuss below! 💬

    0
  • article banner.
    MiniBob.
    Jul 01, 2025
    Article
    Mastering Move Language Concepts – Course #2

    While Course #1 i've made before introduced you to the basics of writing smart contracts in Move and building simple dApps on the Sui blockchain, this course focuses on deepening your understanding of the Move language itself — from its powerful type system to advanced patterns like generics, events, modules, and access control mechanisms. By the end of this course, you’ll be able to: Write modular, reusable, and secure Move code Use generics, abilities, and resource types effectively Implement fine-grained access control using capabilities Emit and listen to events for off-chain integration Work with complex data structures like tables and vectors Understand how Move differs from other smart contract languages like Solidity Let’s dive into the heart of the Move language! Step 1: Understanding Move’s Core Language Features Move is designed with safety and clarity in mind. Let's explore some of the most important features that make Move unique as a smart contract language. 1.1 Resource-Oriented Programming (Revisited) At the core of Move is the concept of resources, which are special types that cannot be copied or deleted unless explicitly allowed. This enforces safe handling of digital assets like tokens or NFTs. module examples::token { use sui::object::{Self, UID}; struct MyToken has key, store { id: UID, value: u64, } public fun mint(ctx: &mut TxContext): MyToken { MyToken { id: object::new(ctx), value: 100, } } } In this example: MyToken is a resource because it has the key ability. It can be stored (store) and uniquely identified by its id. It cannot be duplicated or dropped unless specified. This guarantees that each MyToken instance is uniquely owned and managed, preventing accidental duplication or deletion. 1.2 Abilities System Every type in Move has a set of abilities that define what operations it supports: | Ability | Meaning | |--------|---------| | copy | Can be duplicated | | drop | Can be discarded without destruction | | store | Can be stored in global storage | | key | Can be used as a struct with an ID field (i.e., an object) | Example: struct Example has copy, drop { value: u64 } Understanding these abilities is essential for designing secure and predictable smart contracts. Why Abilities Matter Abilities enforce strict rules at compile time. For instance: A struct with only key and store cannot be copied or dropped. You cannot return a non-droppable struct from a function unless it's stored or transferred. This prevents bugs like double-spending or accidental token loss. 1.3 Generics and Type Parameters Move supports generic types, allowing developers to write flexible and reusable code. module examples::storage { use sui::object::{Self, UID}; struct Box has key { id: UID, content: T, } public fun new_box(ctx: &mut TxContext, content: T): Box { Box { id: object::new(ctx), content, } } } Here, ` is a type parameter, making Box` work with any type while still being safe and efficient. Note: The phantom keyword indicates that T doesn’t affect the runtime representation of the struct — useful for abstract modeling. Step 2: Modular Development and Package Management As your Move projects grow in complexity, organizing your code becomes critical. 2.1 Creating and Publishing Move Packages A Move package contains one or more modules and defines dependencies. It's the unit of deployment and versioning in Move. Directory structure: sources/ place.move user.move Move.toml Define dependencies in Move.toml: [dependencies] Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework" } MyLibrary = { local = "../my-library" } You can publish packages to the Sui network and reuse them across multiple dApps. 2.2 Reusing Existing Modules The Sui Framework provides battle-tested modules like coin, transfer, and tx_context. Always check what’s available before writing custom logic. For example, to transfer an object: use sui::transfer; public entry fun send_place(place: Place, recipient: address) { transfer::public_transfer(place, recipient); } Using standard libraries ensures safer, faster development and better interoperability. Step 3: Events and Off-Chain Communication To build real-world applications, your Move contracts need to communicate with off-chain systems like frontends or indexers. 3.1 Emitting Events Move allows emitting events that can be indexed by external services. use sui::event; struct PlaceCreated has drop { name: String, } public fun emit_place_created(name: String) { event::emit(PlaceCreated { name }); } This event will appear on the blockchain and can be picked up by explorers or indexing tools. 3.2 Listening to Events Use tools like Suiet Explorer, Subsquid, or the Sui JSON-RPC API to listen for emitted events and react accordingly in your application. In JavaScript/TypeScript: import { JsonRpcProvider } from '@mysten/sui.js'; const provider = new JsonRpcProvider('https://fullnode.devnet.sui.io'); const events = await provider.getEvents({ MoveEventType: '0x...::example::PlaceCreated' }); Step 4: Access Control and Security Patterns Security is paramount when dealing with smart contracts. Move provides several tools to implement robust access control. 4.1 Object Ownership Model Sui enforces ownership at the protocol level. Only the owner of an object can mutate or transfer it. public entry fun update_name(sweet_place: &mut SweetPlace, new_name: String) { sweet_place.name = new_name; } Only the current owner can call this function. 4.2 Capabilities Pattern For more granular permissions, use the capability pattern — create special objects that grant limited access to certain functions. struct AdminCap has key { id: UID } public entry fun grant_admin_cap(ctx: &mut TxContext) { let cap = AdminCap { id: object::new(ctx) }; transfer::public_transfer(cap, tx_context::sender(ctx)); } public entry fun restricted_action(_: &AdminCap) { // perform admin action } Now only users who hold the AdminCap can execute restricted_action. This pattern is widely used in DeFi and DAOs to delegate authority securely. Step 5: Working with Complex Data Structures Move supports structured data types that allow developers to model complex logic and relationships. 5.1 Vectors Vectors are used to store ordered collections of items of the same type. let names = vector[String::utf8(b"Alice"), String::utf8(b"Bob")]; They’re useful for storing lists of NFTs, user roles, or dynamic metadata. Example usage: vector::push_back(&mut names, String::utf8(b"Charlie")); 5.2 Tables (via Sui Standard Library) While Move doesn’t natively support maps or hash tables, Sui provides the Table type in its standard library. use sui::table::{Self, Table}; struct Registry has key { id: UID, entries: Table, } public fun add_entry(registry: &mut Registry, key: u64, value: String) { table::add(&mut registry.entries, key, value); } Use tables to manage large datasets efficiently. Step 6: Testing and Debugging Your Contracts Testing ensures your Move code behaves as expected under various conditions. 6.1 Unit Testing in Move Write unit tests directly in your Move modules using the testing framework. #[test] public fun test_create_sweet_place() { let ctx = tx_context::dummy(); create_sweet_place(&mut ctx, String::utf8(b"My House")); } Run tests with: sui move test 6.2 Using Sui Explorer After deploying your contract, use the Sui Explorer to inspect transactions, view object states, and debug issues. Step 7: Real-World Applications of Advanced Move Concepts Now that you understand the core language features, let’s explore how they apply to real-world scenarios. 7.1 NFT Minting Platform Create a platform that allows users to mint NFTs backed by Move resources, leveraging the ownership and resource models. 7.2 DAO Voting System Implement a decentralized autonomous organization (DAO) using Move for voting, proposals, and governance, using events and capabilities for secure actions. 7.3 Token Swaps and AMMs Build a decentralized exchange (DEX) using Move modules to represent liquidity pools and token swaps, using generics and tables for efficient state management.

    2

Posts

364
  • article banner.
    harry phan.
    Jul 08, 2025
    Article

    Sui CLI Cheat Sheet part 2

    Gas and Faucet with Sui CLI When you’re developing your apps, ideally, you’ll start out on devnet, then testnet before deploying to mainnet. Devnet and Testnet gas are free to acquire. But mainnet? nah. You can easily request gas on devnet with the client faucet command: sui client faucet For testnet, you’ll need to execute this cURL command to request gas: curl --location --request POST 'https://faucet.devnet.sui.io/v1/gas' \ --header 'Content-Type: application/json' \ --data-raw '{ "FixedAmountRequest": { "recipient": "" } }' You can also visit the official Sui faucet website to claim some Devnet and Testnet tokens. Use the client gas command to check the client’s available gas tokens on the current environment. sui client gas For mainnet transactions, you’ll need to acquire Sui from exchanges and fund your wallet. Publishing Packages You can publish packages on to the Sui network with the client publish command. sui client publish [OPTIONS] [package_path] Here’s an example command for publishing a package with 5000000 MIST gas budget. sui client publish --gas-budget 5000000 The gas budget isn’t fixed, you most likely want to check onchain for a suitable gas amount and pay it forward. Coin Management with Sui CLI When you’re working with SUI coins, You’ll probably need to merge and split them often—especially when youjuggling gas or sending different amounts to various contracts or users. If you’ve have two coins lying around, and you want to consolidate them, use the merge-coin command like this: sui client merge-coin --primary-coin --coin-to-merge The primary-coin is the one you’ll keep, and the coin-to-merge is the one that gets absorbed. Need to split a coin instead? Maybe you want to pay out to multiple recipients or just need different denominations. You can slice a coin up using split-coin like this: sui client split-coin --coin-id --amounts If you need to send out coins, you’ll use the client transfer-sui command like this: sui client transfer-sui --sui-coin-object-id --to It’s a simple handoff—you give it the coin ID and the recipient’s address, and it moves the funds. Sui has programmable transactions so you can send to multiple recipients at once with the pay-sui command: sui client pay-sui --input-coins --recipients --amounts You’ll pass a coin (or a list of coins), and then specify the recipients and how much each should get. It’s perfect for batch payments or distributing tokens in bulk. Object Management with Sui CLI Sui is all about objects. Contracts, tokens, and even your coins—they're all objects. To get detailed info on any object, just call: sui client object This will spit out all the metadata, owner info, and anything else the object is carrying. If your object has dynamic fields (like a registry or a growing data structure), you can dig into those too: sui client dynamic-field This is very handy feature you might use often during development. Programmable Transaction Blocks (PTBs) Sui is one of the few chains with native PTBs. Programmable Transaction Blocks let you bundle multiple operations into a single transaction—kinda like a mini-script that executes on-chain. Say you need to call a Move function directly from your CLI. You’ll do that like this: sui client ptb --move-call :::: "" Replace the package address, module name, and function you’re targeting. Then drop in the type and arguments as needed. And if you want to transfer multiple objects to another wallet in one go, you can use PTBs as well: sui client ptb --transfer-objects "[]" Wrap the object IDs in brackets if you’re sending more than one, and finish it off with the recipient’s address. Conclusion Hopefully, this article suffices for introducting you to the Sui CLI tool. It’s more than a client, there’s a lot you can do with this tool. If you ever need a quick refresher or you’re trying out a new command, make the Sui CLI Cheat Sheet your best friend. And when in doubt, the Sui Client CLI Docs have the full breakdown.

    • Sui
    0
  • article banner.
    harry phan.
    Jul 08, 2025
    Article

    Sui CLI Cheat Sheet part 1

    When developing smart contracts, it’s also essential to create a client that can interact with them. Beyond just pulling data from the blockchain, clients can also read from and execute functions defined by the contract’s available primitives. One of the most convenient tools for this job is the Sui CLI, as it allows you to make command-line calls from virtually any programming language you choose to use for your client. In this guide, I’ll walk you through the key commands you’ll commonly use while working with Sui. Getting Started with Sui CLI To begin, you’ll need to install the Sui CLI on your machine. The installation process depends on your operating system and preferred package manager. If you’re using a Unix-based system like macOS or Linux and have Homebrew installed, simply run the following command in your terminal to install the Sui CLI: brew install sui Execute this command on your terminal to install Sui CLI if you’re running Windows via Chocolatey: choco install sui Another route you can use is the Cargo (Rust package manager) route. First, you’ll need to have Rust installed (ships with cargo) and then execute this command to install Sui CLI. cargo install --locked --git https://github.com/MystenLabs/sui.git --branch testnet sui --features tracing You can always execute the --version flag to verify your installation and check the version of Sui CLI you have installed. sui --version One flag you’ll use frequently is the—- help flag for the description of every command: sui --help It works with almost every command. It should be your mantle whenever you’re stuck: Regardless of the command using -h or --help for help would always be handy. Environment Management with Sui CLI Every chain provides you with three fundamental networks: Mainnet, Testnet, and Devnet. You can also spawn a test chain locally to keep development in stealth mode. Here’s the command you’ll execute to spawn a local network. RUST_LOG="off,sui_node=info" sui start --with-faucet --force-regenesis The command calls the Sui CLI binary to start a faucet service and generate a new genesis block without persisting the local network state. Now, you can connect to the local network with the new-env command like this: sui client new-env --alias local --rpc sui client new-env --alias local --rpc http://127.0.0.1:9000 You can switch and activate any environment with this general command. sui client switch --env Now, you can use this command to set the active environment to the new local environment you’ve created. sui client switch --env local The command switches the currently active environment to the local network you’re running. Address and Key Management with Sui CLI You’ll be switching keys as you deploy smart contracts over the Sui CLI, so here’s how to do that. You can view the currently active address with the active-address command: sui client active-address You can list all the addresses in your client with the addresses command. sui client addresses You can switch addresses as you please with the --address flag before specifying the address. Key Management with Sui CLI When building your apps, for security or other reasons, you might want to run CLI commands to work with keys. The keytool command is You can list all the keys in a keystore with the list command like this: sui keytool list You can generate keys with the generate command followed with a specification of the scheme. sui keytool generate [OPTIONS] [DERIVATION_PATH] [WORD_LENGTH] You’re probably familiar with the ed25519 since that’s what most wallets use. Specify it like this. sui keytool generate ed25519 You should get the output with the Sui address, mnemonic and other details. sui keytool import "" ed25519 When you’ve imported it, you can switch to the keypair and start sending transactions with it.

    • Sui
    • SDKs and Developer Tools
    0
  • article banner.
    Sui Maxi.
    Jul 08, 2025
    Article

    What is a Dex Aggregator

    Let’s say you want to swap 1 SUI for USDC. The market rate says 1 SUI = 3 USDC, so you expect to receive 3 USDC in return. But when you actually make the trade, you end up with only 2.9 USDC. That 0.1 USDC loss is due to slippage—the price impact caused by shallow liquidity in the pool you're swapping through. This is where DEX aggregators come in. What Is a DEX Aggregator? A DEX aggregator is a powerful tool that helps you find the best price for your trade by scanning multiple decentralized exchanges (DEXs) in the ecosystem. Instead of routing your swap through just one pool, it looks across all available liquidity sources and chooses the most efficient route to reduce slippage and maximize returns. Two Types of Aggregators 1. Off-Chain Aggregators (Backend) These services run on a centralized backend that constantly queries DEX prices, simulates swap outcomes, and determines the best path. The final swap route is sent to your wallet or frontend for execution. ✅ Faster calculations ❌ Requires trust in the backend logic 2. On-Chain Aggregators (Smart Contract) Built entirely on smart contracts, these aggregators calculate and execute routes directly on-chain. Thanks to Sui's Programmable Transaction Blocks (PTBs), these smart contracts can perform atomic routing, meaning the entire multi-hop swap is executed as one transaction, ensuring: ✅ No risk of partial swaps ✅ Fully trustless ✅ Composable with other DeFi protocols on Sui Example 7K Aggregator Cetus So How Do Aggregators Calculate the Best Route? To determine the optimal path, a DEX aggregator evaluates multiple factors: Liquidity Depth**: Pools with more liquidity cause less price impact Swap Fees**: Lower fees lead to better net returns Slippage**: The price impact of large trades Gas Efficiency**: Routes with fewer hops or contracts are cheaper Real-Time Pool Data**: Aggregators simulate swap results across paths By combining all these inputs, the aggregator selects the route (or combination of routes) that gives the highest return for the user.

    • Sui
    • Architecture
    0
  • article banner.
    Meaning.Sui.
    Jul 08, 2025
    Article

    📦 In-depth Analysis of the `sui::package` Module: Package Publishing & Upgrading in Move

    In the rapid evolution of blockchain technology, the Move programming language stands out for its security, flexibility, and auditability. One of its core strengths is the refined management of smart contract packages. This article dives deep into the sui::package module — the engine behind publishing, upgrading, and maintaining Move packages on the Sui blockchain. 🔍 Module Overview sui::package is a cornerstone in the Move ecosystem. It provides developers with robust tools and interfaces to manage packages securely and efficiently. 📦 Declaration & Imports module sui::package; use std::ascii::String; use std::type_name; use sui::types; This defines the module and brings in essential Move standard libraries and Sui-native modules for complex logic. 🧩 Core Structures & Public Interfaces 1. Publisher Handles the publisher identity of a package. Key functions: claim claim_and_keep burn_publisher 2. UpgradeCap Controls a package’s upgrade capability. Key fields: package_id version policy (upgrade policy) Key functions: upgrade_package restrict 3. UpgradeTicket Grants permission for a specific upgrade. Key functions: ticket_package ticket_policy ticket_digest 4. UpgradeReceipt Issued after a successful upgrade. Key functions: receipt_cap receipt_package 🚨 Error Constants Helps developers debug with clarity. ENotOneTimeWitness: The one-time witness is invalid ETooPermissive: Upgrade policy is too lenient EInvalidPackage: The package provided is invalid 🔒 Upgrade Strategy Constants Controls how packages may evolve: COMPATIBLE: Backward-compatible upgrades ADDITIVE: Add new features, but don't change/delete existing ones DEP_ONLY: Only dependency changes allowed These constants enforce safe and controlled upgrades. 🧱 Structure Definitions Publisher package address**: Uniquely identifies the publisher module name**: The publisher’s module namespace UpgradeCap package ID**: The target package version**: Current version policy**: Upgrade policy applied UpgradeTicket upgrade_cap_id**: Link to the controlling UpgradeCap package_id**: Target package policy**: Upgrade policy used digest**: Bytecode summary (vector of bytes) UpgradeReceipt upgrade_cap_id**: Controller identity package_id**: The upgraded package 🧠 Core Function Definitions claim fun claim(otw: &OneTimeWitness) -> Publisher; Claims a publisher identity using a one-time witness (OTW). Ensures uniqueness and trust. claim_and_keep fun claim_and_keep(otw: &OneTimeWitness) -> Publisher; Similar to claim, but sends the Publisher object to the caller’s account. burn_publisher fun burn_publisher(publisher: &mut Publisher); Destroys a publisher identity and all associated privileges. authorize_upgrade fun authorize_upgrade(cap: &UpgradeCap, package_id: &PackageID, policy: u8, digest: &vector) -> UpgradeTicket { assert!(cap.package_id == *package_id, EInvalidPackage); assert!(cap.policy ) -> UpgradeReceipt { // Upgrade logic } Verifies UpgradeTicket Replaces the current package code with the new bytecode (data) Returns a UpgradeReceipt as proof of successful upgrade restrict fun restrict(cap: &mut UpgradeCap, policy: u8) { assert!(cap.policy With modules like sui::package, the Move language continues to show its strength in modular design, security-first architecture, and developer ergonomics — paving the way for scalable, secure Web3 systems.

    • Sui
    • Architecture
    0
  • article banner.
    Meaning.Sui.
    Jul 08, 2025
    Article

    In-depth analysis of Move VM technical details

    Sui: In-depth Analysis of Move VM Technical Details In today's blockchain technology field, Move VM, as a key technical component, plays an important role in Sui. This article provides an in-depth analysis of Move VM’s technical details, including: Initialization process Code caching mechanism Module & script publishing Function execution Binary format analysis 1. Move VM Initialization The initialization of Move VM is simple and efficient. It requires just a single Loader instance — essentially a few Mutex-protected empty tables like HashMap and Vec. This process is low-cost and sets the groundwork for all VM operations. Move VM uses on-demand code loading. Code isn’t preloaded; instead, it's fetched at runtime during function or script execution. Once loaded, modules/scripts are cached and reused, boosting performance significantly. 2. Code Caching Mechanism 2.1 First-Time Loading When the VM loads a module for the first time: Queries the data store to fetch binary data (Vec) Deserializes and verifies the data for accuracy and integrity Loads all dependencies with the same process Links the module with its dependencies Caches the module via Loader for reuse during the VM lifecycle 2.2 Cache Coherence System transactions** (like hard upgrades) may break code cache coherency. The client should suspend transaction processing and restart the VM when this happens. Clients must align their DataStore view with loaded code, and re-instantiate the VM if needed. 3. Module Publishing Process To publish a module, the client calls publish_module with: Serialized module bytes Sender’s address A reference to GasMeter Steps: Deserialization If it fails → return an error. Address Validation Module address must match sender address → else MODULE_ADDRESS_DOES_NOT_MATCH_SENDER. Duplication Check Re-publishing same-named module → DUPLICATE_MODULE_NAME error. Load Verification Ensures module is loadable later. Fails? Return error. Write to Storage Once verified, the serialized module is saved and considered valid. 4. Script Execution Mechanism A script in Move is essentially a one-off function, often used to execute transactions. Steps: Load Script & Main Function Calculate sha3_256 hash of the script. Use hash to check if it's in the cache. If not cached → load and verify. Verify main function type params. Build Parameter List Signer values based on sender accounts. Other args must match allowed types → else TYPE_MISMATCH. Execute Script VM calls interpreter. On error → transaction fails and error returned. Else → return success. 5. Script Function Execution Introduced in Move VM v2.0. Works like a regular script Source is a script-visible function inside an on-chain module Steps: Load the function using ModuleId and function name Check visibility (script) Not script-visible? → EXECUTE_SCRIPT_FUNCTION_CALLED_ON_NON_SCRIPT_VISIBLE Execute same as normal script 6. General Function Execution Move VM allows you to execute any function in a module by name. Function names are unique in a module → no signature needed. Execution Steps: Load Module If error → return failure Resolve Function If not found → FUNCTION_RESOLUTION_FAILURE Check type params match → else error Build Parameter List Match all params to allowed types → else TYPE_MISMATCH Execute Interpreter runs the function VM returns result 7. Binary Format Analysis 7.1 Overall Architecture All modules/scripts exist in binary form Modules = collections of functions & structs Scripts = simple entry points (no return value) Uses ULEB128 for integer compression and size-prefixing for vectors. 7.2 Binary Header 3 components: Magic**: Fixed 4 bytes → 0xA1, 0x1C, 0xEB, 0x0B Version**: 4-byte little-endian int Table count**: ULEB128 7.3 Table Headers Each header includes: TableKind (1 byte) TableOffset (ULEB128) TableLength (ULEB128) Tables must be contiguous, non-overlapping. 7.4 Table Details Tables describe: MODULE_HANDLES: module locations via index ADDRESS_IDENTIFIERS, IDENTIFIERS, STRUCT_HANDLES, FUNCTION_HANDLES: type and function metadata FUNCTION_INSTANTIATIONS, SIGNATURES, CONSTANT_POOL: instantiations and constants 7.5 Auxiliary Definitions Type Parameter Kind: 1 byte → ALL, COPYABLE, RESOURCE SignatureToken: 1 byte to represent types (U8, U64, STRUCT, etc.) Bytecodes: 1 byte opcode + optional payload → e.g., POP, RET, BR_TRUE 7.6 Script Specific Binary Data Scripts lack FUNCTION_DEFINITIONS Instead, they embed entry info directly: Type parameter count & types Param type indexes Bytecode length & body ✅ Conclusion Move VM offers a powerful, secure, and efficient environment for blockchain execution. By understanding: VM initialization Caching strategies Function/module execution Binary structure Developers can optimize their Move-based apps and debug issues effectively — contributing to the evolution of the Sui ecosystem.

    • Sui
    • Architecture
    0
  • 0xduckmove.
    Jul 08, 2025
    Discussion

    Is there a way to merge coins and split them in the same transaction using the sui sdk?

    We can use CoinWithBalance intent The CoinWithBalance intent handles all operations, including splitting and merging coins. This means you don’t always need to manually map the object ID, merge, and then split—CoinWithBalance takes care of everything automatically. import { coinWithBalance } from "@mysten/sui/transactions"; const coin = coinWithBalance({ balance: 1000000000, type: "0x9f992cc2430a1f442ca7a5ca7638169f5d5c00e0ebc3977a65e9ac6e497fe5ef::wal::WAL", }); `

    • Sui
    0
    0
  • article banner.
    Arnold.
    Jul 07, 2025
    Article

    Is Sui’s Consensus Mechanism Truly Faster Than Others?

    Blockchain speed is a critical factor for mass adoption, and Sui Network claims to be one of the fastest Layer 1 (L1) platforms, boasting sub-second finality and 100,000+ TPS (transactions per second). But how does Sui’s consensus mechanism compare to giants like Solana, Ethereum, and Aptos? This article breaks down: How Sui’s Narwhal & Bullshark consensus works Benchmarks vs. Solana, Ethereum, Aptos, and others Real-world performance vs. theoretical claims Trade-offs: Does speed sacrifice decentralization? 1. How Sui’s Consensus Works: Narwhal & Bullshark Sui uses a two-part consensus model designed for maximum speed: Narwhal (Mempool Optimizer) Decouples transaction dissemination from ordering** Uses a Directed Acyclic Graph (DAG) to process transactions in parallel Ensures data availability before consensus begins Bullshark (Consensus Engine) HotStuff-based** (like Facebook’s Libra/Diem) Focuses only on ordering transactions (not execution) Achieves instant finality (no probabilistic confirmation) Result: Sui avoids bottlenecks seen in traditional blockchains. 2. Speed Comparison: Sui vs. Competitors | Blockchain | Consensus Model | Max TPS (Theoretical) | Finality Time | Key Limitation | |----------------|--------------------------|--------------------------|------------------|----------------------------------| | Sui | Narwhal-Bullshark (DAG) | 100,000+ | <1 second | Early-stage decentralization | | Solana | PoH + Tower BFT | 65,000 | 2-6 seconds | Frequent outages under load | | Aptos | DiemBFT v4 | 30,000 | 1-2 seconds | Similar to Sui but less optimized| | Ethereum | Gasper (PoS) | 15-30 (L1) | 12-15 min | Slow without L2 scaling | | Polygon | IBFT PoS | 7,000 | 2-6 seconds | Relies on Ethereum security | Key Takeaway: Sui’s parallel processing gives it a theoretical edge in scalability. Real-world TPS** depends on network demand (Sui’s current live TPS is ~1,000-5,000). 3. What Makes Sui Faster? Parallel Execution (No Block Bottlenecks) Most blockchains (e.g., Ethereum) process transactions sequentially. Sui processes independent transactions in parallel (like Solana, but more efficiently). No Global Consensus for Simple Transactions Single-owner transactions* (e.g., token transfers) skip full consensus, using *Byzantine Consistent Broadcast** instead. Only complex transactions (e.g., DeFi swaps) require full ordering. Optimized Data Structures (DAG vs. Linear Blocks) Sui’s DAG-based mempool prevents congestion. Solana’s linear blocks sometimes clog under spam. 4. Real-World Performance vs. Lab Benchmarks Theoretical TPS:* Sui claims *100K+**, but real-world usage is lower (similar to Solana’s 65K claim vs. ~3K average). Testnet Demo:* Sui processed *120,000 TPS** in a controlled environment. Mainnet Reality:* Current average is *1,000-5,000 TPS** (still faster than Ethereum’s 15 TPS). Why the Gap? Demand:** Few dApps push Sui to full capacity yet. Validator Scaling:** More validators = higher throughput (Sui is still growing). 5. Trade-Offs: Does Speed Sacrifice Decentralization? Fewer Validators = Centralization Risk Sui launched with 20-30 validators (vs. Ethereum’s 900,000). Plan:* Expand to *hundreds** over time. Move Language Lock-In Sui’s speed relies on Move, which limits developer flexibility vs. Ethereum’s Solidity. Early-Stage Optimizations Some shortcuts (like skipping consensus for simple txns) could introduce edge-case risks. 6. Verdict: Is Sui the Fastest Blockchain? Yes, for Certain Use Cases Simple transactions* (payments, NFT mints) are *blazing fast**. High-throughput dApps** (gaming, social) benefit most. Not Universally Faster (Yet) Complex DeFi** (e.g., AMM swaps) still needs full consensus. Decentralization lags** behind Ethereum. Final Answer: Sui is one of the fastest L1s today, especially for parallelizable tasks. But real-world adoption will determine if it outpaces Solana, Aptos, and Ethereum L2s long-term.

    • Sui
    0
  • article banner.
    Arnold.
    Jul 07, 2025
    Article

    Is Sui’s Consensus Mechanism Truly Faster Than Others?

    Blockchain speed is a critical factor for mass adoption, and Sui Network claims to be one of the fastest Layer 1 (L1) platforms, boasting sub-second finality and 100,000+ TPS (transactions per second). But how does Sui’s consensus mechanism compare to giants like Solana, Ethereum, and Aptos? This article breaks down: How Sui’s Narwhal & Bullshark consensus works Benchmarks vs. Solana, Ethereum, Aptos, and others Real-world performance vs. theoretical claims Trade-offs: Does speed sacrifice decentralization? 1. How Sui’s Consensus Works: Narwhal & Bullshark Sui uses a two-part consensus model designed for maximum speed: Narwhal (Mempool Optimizer) Decouples transaction dissemination from ordering** Uses a Directed Acyclic Graph (DAG) to process transactions in parallel Ensures data availability before consensus begins Bullshark (Consensus Engine) HotStuff-based** (like Facebook’s Libra/Diem) Focuses only on ordering transactions (not execution) Achieves instant finality (no probabilistic confirmation) Result: Sui avoids bottlenecks seen in traditional blockchains. 2. Speed Comparison: Sui vs. Competitors | Blockchain | Consensus Model | Max TPS (Theoretical) | Finality Time | Key Limitation | |----------------|--------------------------|--------------------------|------------------|----------------------------------| | Sui | Narwhal-Bullshark (DAG) | 100,000+ | <1 second | Early-stage decentralization | | Solana | PoH + Tower BFT | 65,000 | 2-6 seconds | Frequent outages under load | | Aptos | DiemBFT v4 | 30,000 | 1-2 seconds | Similar to Sui but less optimized| | Ethereum | Gasper (PoS) | 15-30 (L1) | 12-15 min | Slow without L2 scaling | | Polygon | IBFT PoS | 7,000 | 2-6 seconds | Relies on Ethereum security | Key Takeaway: Sui’s parallel processing gives it a theoretical edge in scalability. Real-world TPS** depends on network demand (Sui’s current live TPS is ~1,000-5,000). 3. What Makes Sui Faster? Parallel Execution (No Block Bottlenecks) Most blockchains (e.g., Ethereum) process transactions sequentially. Sui processes independent transactions in parallel (like Solana, but more efficiently). No Global Consensus for Simple Transactions Single-owner transactions* (e.g., token transfers) skip full consensus, using *Byzantine Consistent Broadcast** instead. Only complex transactions (e.g., DeFi swaps) require full ordering. Optimized Data Structures (DAG vs. Linear Blocks) Sui’s DAG-based mempool prevents congestion. Solana’s linear blocks sometimes clog under spam. 4. Real-World Performance vs. Lab Benchmarks Theoretical TPS:* Sui claims *100K+**, but real-world usage is lower (similar to Solana’s 65K claim vs. ~3K average). Testnet Demo:* Sui processed *120,000 TPS** in a controlled environment. Mainnet Reality:* Current average is *1,000-5,000 TPS** (still faster than Ethereum’s 15 TPS). Why the Gap? Demand:** Few dApps push Sui to full capacity yet. Validator Scaling:** More validators = higher throughput (Sui is still growing). 5. Trade-Offs: Does Speed Sacrifice Decentralization? Fewer Validators = Centralization Risk Sui launched with 20-30 validators (vs. Ethereum’s 900,000). Plan:* Expand to *hundreds** over time. Move Language Lock-In Sui’s speed relies on Move, which limits developer flexibility vs. Ethereum’s Solidity. Early-Stage Optimizations Some shortcuts (like skipping consensus for simple txns) could introduce edge-case risks. 6. Verdict: Is Sui the Fastest Blockchain? Yes, for Certain Use Cases Simple transactions* (payments, NFT mints) are *blazing fast**. High-throughput dApps** (gaming, social) benefit most. Not Universally Faster (Yet) Complex DeFi** (e.g., AMM swaps) still needs full consensus. Decentralization lags** behind Ethereum. Final Answer: Sui is one of the fastest L1s today, especially for parallelizable tasks. But real-world adoption will determine if it outpaces Solana, Aptos, and Ethereum L2s long-term.

    • Sui
    0
  • article banner.
    Evgeniy CRYPTOCOIN.
    Jul 07, 2025
    Article

    Can Machine Learning Improve Blockchain Security?

    Blockchain technology is designed to be secure, but it’s not immune to exploits—DeFi hacks, smart contract vulnerabilities, and Sybil attacks have led to billions in losses. Could machine learning (ML) be the solution? This article explores: How ML can detect and prevent blockchain attacks Current security weaknesses in crypto Real-world projects using AI for blockchain security The risks and limitations of relying on ML 1. How Machine Learning Can Enhance Blockchain Security Fraud Detection & Anomaly Monitoring ML models analyze transaction patterns to flag: Unusual wallet activity (e.g., sudden large withdrawals) Rug pulls & pump-and-dump schemes Phishing scams (malicious smart contracts) Example: Chainalysis uses ML to track illicit crypto flows. Smart Contract Vulnerability Detection AI-powered tools (Slither, MythX) scan for: Reentrancy bugs (like the $60M DAO hack) Integer overflows Logic flaws in DeFi protocols Example: Certora uses formal verification + ML to audit contracts. Sybil Attack & 51% Attack Prevention ML identifies fake nodes or malicious validators by analyzing: IP clustering Staking behavior anomalies Example: Aleo uses zero-knowledge proofs + ML for privacy-preserving validation. Predictive Threat Intelligence ML forecasts new attack vectors by learning from past exploits. Can predict flash loan attack targets before they happen. 2. Current Weaknesses in Blockchain Security | Vulnerability | Impact | Can ML Help? | |-------------------------|------------------------------------|--------------------------------| | Smart Contract Bugs | $3B+ lost in 2023 | ✅ (Automated auditing) | | Oracle Manipulation | Exploits like Mango Markets ($114M)| ✅ (Anomaly detection) | | MEV (Miner Extractable Value) | Unfair front-running | ⚠️ (Partial mitigation) | | Private Key Theft | $1B+ yearly losses | ❌ (ML can’t prevent phishing) | 3. Real-World Projects Using ML for Blockchain Security Forta Network Decentralized threat detection** using ML-powered bots. Alerts for malicious transactions in real time. Elliptic AI-driven blockchain analytics** to track stolen funds. Used by regulators and exchanges. Halborn ML + ethical hacking** to audit blockchains like Solana and Sui. 4. Risks & Limitations of ML in Blockchain Security Adversarial Machine Learning Hackers can trick ML models with poisoned data. Example: Fooling an AI auditor into approving a malicious contract. Over-Reliance on Black-Box AI If an ML model flags a transaction, can we trust it without explanation? Regulators may demand transparency** in automated decisions. Centralization Risks Many ML security tools rely on centralized data feeds. Conflicts with blockchain’s decentralization ethos. 5. The Future: AI-Augmented Blockchain Security Hybrid human-AI audits** (AI flags risks, humans verify). On-chain ML models** (e.g., AI validators in PoS networks). Predictive DeFi shields** (auto-pausing protocols if an attack is likely). Conclusion: ML is a Powerful Tool—But Not a Silver Bullet Machine learning can significantly improve blockchain security, but it won’t eliminate all risks. The best approach? Combine AI automation with human expertise for a safer Web3 future. What do you think? Would you trust an AI to secure a $1B DeFi protocol?** Can decentralized ML solutions replace traditional auditors?** Discuss below! 💬

    • Sui
    • Security Protocols
    0
  • article banner.
    Evgeniy CRYPTOCOIN.
    Jul 07, 2025
    Article

    Can Machine Learning Improve Blockchain Security?

    Blockchain technology is designed to be secure, but it’s not immune to exploits—DeFi hacks, smart contract vulnerabilities, and Sybil attacks have led to billions in losses. Could machine learning (ML) be the solution? This article explores: How ML can detect and prevent blockchain attacks Current security weaknesses in crypto Real-world projects using AI for blockchain security The risks and limitations of relying on ML 1. How Machine Learning Can Enhance Blockchain Security Fraud Detection & Anomaly Monitoring ML models analyze transaction patterns to flag: Unusual wallet activity (e.g., sudden large withdrawals) Rug pulls & pump-and-dump schemes Phishing scams (malicious smart contracts) Example: Chainalysis uses ML to track illicit crypto flows. Smart Contract Vulnerability Detection AI-powered tools (Slither, MythX) scan for: Reentrancy bugs (like the $60M DAO hack) Integer overflows Logic flaws in DeFi protocols Example: Certora uses formal verification + ML to audit contracts. Sybil Attack & 51% Attack Prevention ML identifies fake nodes or malicious validators by analyzing: IP clustering Staking behavior anomalies Example: Aleo uses zero-knowledge proofs + ML for privacy-preserving validation. Predictive Threat Intelligence ML forecasts new attack vectors by learning from past exploits. Can predict flash loan attack targets before they happen. 2. Current Weaknesses in Blockchain Security | Vulnerability | Impact | Can ML Help? | |-------------------------|------------------------------------|--------------------------------| | Smart Contract Bugs | $3B+ lost in 2023 | ✅ (Automated auditing) | | Oracle Manipulation | Exploits like Mango Markets ($114M)| ✅ (Anomaly detection) | | MEV (Miner Extractable Value) | Unfair front-running | ⚠️ (Partial mitigation) | | Private Key Theft | $1B+ yearly losses | ❌ (ML can’t prevent phishing) | 3. Real-World Projects Using ML for Blockchain Security Forta Network Decentralized threat detection** using ML-powered bots. Alerts for malicious transactions in real time. Elliptic AI-driven blockchain analytics** to track stolen funds. Used by regulators and exchanges. Halborn ML + ethical hacking** to audit blockchains like Solana and Sui. 4. Risks & Limitations of ML in Blockchain Security Adversarial Machine Learning Hackers can trick ML models with poisoned data. Example: Fooling an AI auditor into approving a malicious contract. Over-Reliance on Black-Box AI If an ML model flags a transaction, can we trust it without explanation? Regulators may demand transparency** in automated decisions. Centralization Risks Many ML security tools rely on centralized data feeds. Conflicts with blockchain’s decentralization ethos. 5. The Future: AI-Augmented Blockchain Security Hybrid human-AI audits** (AI flags risks, humans verify). On-chain ML models** (e.g., AI validators in PoS networks). Predictive DeFi shields** (auto-pausing protocols if an attack is likely). Conclusion: ML is a Powerful Tool—But Not a Silver Bullet Machine learning can significantly improve blockchain security, but it won’t eliminate all risks. The best approach? Combine AI automation with human expertise for a safer Web3 future. What do you think? Would you trust an AI to secure a $1B DeFi protocol?** Can decentralized ML solutions replace traditional auditors?** Discuss below! 💬

    • Sui
    • Security Protocols
    0

Sui is a Layer 1 protocol blockchain designed as the first internet-scale programmable blockchain platform.

364Posts503Answers
Top tags
  • Sui
  • Architecture
  • SDKs and Developer Tools
  • Move
  • Security Protocols
  • NFT Ecosystem
  • Transaction Processing