Original title: Diving Into Sui
Original source: Micah Casella,Messari
Original compilation:BlockTurbo
Should there be another Layer 1 blockchain? Ethereum, Solana, Avalanche, and many other platforms are vying to become the main base layer for smart contract development. Sui, a new smart contract platform that takes a different approach to the blockchain data model, joins the fray. Sui’s original contributor, Mysten Labs, believes that Sui’s data model will make it the first blockchain platform with internet-scale programmability.
background
background
In June 2019, Facebook (renamed Meta) announced plans to build a permissioned blockchain and a digital wallet to underpin a global payments network. Meta spearheaded the formation of a separate consortium called the Diem Association (originally known as the Libra Association) to build the blockchain. Meta’s subsidiary Novi Finance (originally known as Calibra) is responsible for developing the digital wallet.
Neither product was fully realized. Due to regulatory hurdles, Diem closed and sold all assets in January 2022. Later that year, Meta terminated the Novi project for no immediate reason. Before the shutdown, several project leaders believed that Metas vision of building a global payment network would fail. Eventually, two separate blockchains, Aptos and Sui, emerged from the original Diem and Novi research. While Aptos carried on Diems legacy, iterating on the technology developed by that project, Mysten Labs built a brand new Sui from Diems ashes.
Mysten Labs is an original contributor to Sui. It was founded in 2021 by former Novi project leaders Evan Cheng, Adeniyi Abiodun, Sam Blackshear, George Danezis, and Kostas Chalkias. The founder has extensive research and product experience in the fields of software language compilers, static analysis (programming security), distributed systems, cryptography, and cloud computing, and has worked in companies such as Apple, Oracle, Microsoft, R 3, and Facebook. Notably, co-founder Evan Cheng received an ACM Software Systems Award for his involvement in designing LLVM, a technology now widely used in Apple and Google devices.
The Sui blockchain has not yet officially launched and is scheduled to launch on May 3, 2023. In December 2021, Mysten raised $36 million in Series A funding, led by a16z, with participation from investors including Redpoint, Lightspeed, Coinbase Ventures, Electric Capital and others. In its Series B round in September 2022, Mysten raised $300 million at a valuation of over $2 billion, led by FTX Ventures, with participation from investors including a16z, Jump Crypto, Binance Labs and others. Mysten Labs confirmed to Messari that these financings were limited to the sale of equity and no SUI tokens were offered. (Regarding FTX, Mysten Labs completed the repurchase of FTX’s equity holdings and options to purchase SUI tokens for approximately $96 million.) In addition, an independent foundation, called the Sui Foundation, was established to establish Sui community, and funding/supporting the creation of products on Sui. The establishment of the Sui Foundation will help drive the development and expansion of the Sui ecosystem.
first level title
secondary title
Object-Centric Data Model
The key feature that differentiates it from other distributed ledgers is Suis object-centric data model. Most smart contract platforms, such as Ethereum, Solana, and Aptos, track the state of the blockchain using accounts, where accounts are data structures that hold user balances. Other platforms such as Bitcoin and Cardano use unspent transaction outputs (UTXO) to record the state of the blockchain, that is, UTXO represents the amount of assets remaining after the execution of the transaction.
Sui combines these two approaches into a hybrid model where its history is stored in an object with a globally unique ID. Objects also contain metadata that determine characteristics of different objects, such as ownership and transaction history (derived in part from object nonces, also known as version numbers). Suis object-centric data model means that the global state is simply the collection of all Sui objects. Structurally, this takes the form of a directed acyclic graph (DAG), where objects correspond to vertices, transactions correspond to edges, and objects called active objects correspond to vertices with no outgoing edges.
In Sui, all transactions take objects as input and generate new or modified objects as output. Each object contains the hash of the last transaction that produced it. Objects that can be used as input are called active objects. Therefore, by observing all live objects, the global state can be determined.
Suis object-centric data model allows it to process object interactions in parallel at large scale. Transactions on Sui are grouped according to the objects they interact with. When multiple transactions are submitted at the same time, validators can process these transactions in parallel on separate machines as long as there is no interdependence between the transactions. This system also provides a unique path to scalability whereby capacity increases as network validators add more machines to their nodes.
Objects on Sui can be owned objects (such as fungible tokens and NFTs) or shared objects (such as decentralized exchanges and auction contracts). Specifically, Sui objects can have four different types of ownership:
An object (NFT or fungible token) owned by an address
Objects owned by other objects (for example, in a game NFT, a sword NFT could be owned by an avatar NFT)
Shared objects (decentralized exchanges or auction contracts) that anyone can read/write
secondary title
Sui Move
Solidity, the language used to write the Ethereum Virtual Machine (EVM) and the most popular blockchain programming language, was first officially released in July 2015. It was not until November 2015 that the concept of ERC-20 tokens was proposed. Since the EVM lacks a built-in infrastructure for operating different digital assets as native resources, ERC-20 was proposed as a smart contract standard for creating fungible assets. ERC-20 tokens have played an integral role in subsequent crypto cycle peaks, such as the ICO boom in 2017 and the DeFi summer in 2020, emphasizing that the main purpose of blockchain activity is to facilitate the interaction of digital assets. Recognizing that blockchain development should focus on programming digital assets (called resources), the Novi/Diem team built Move around this core.
Mysten Labs modified Move (and dubbed it Sui Move) to integrate with its object-centric data model, since it was originally built for account-based systems. Sui Move supports two core objects: smart contracts (Move package, which is a set of Move modules) and digital assets (resources). Suis native support for resources is expressed through bytecode verification. After Sui Move source code is compiled to bytecode, a static analysis tool called the Move bytecode verifier ensures that the bytecode follows Suis type, memory, and resource safety rules. This validation ensures that an object cannot be created, copied, or accidentally destroyed by code outside its defining module. It also includes protection against certain vulnerabilities like double spending and reentrancy.
Requiring all code to pass through a bytecode verifier before being committed on-chain removes the need for smart contract developers to write certain security rules themselves. In other blockchains, especially those that use accounts to store ledger state, these security protections are not guaranteed by virtual machines. Instead, they must be manually coded by every smart contract developer that interacts with the digital asset. For example, one type of security protection guaranteed by the Move bytecode verifier includes account checks on Solana. Account checks can be difficult to get right, leading to some of the largest hacks in the Solana ecosystem.
Notable vulnerabilities due to incorrect implementations in Sui Move that require no extra code include:
Wormhole (Solana — Account Replacement Vulnerability): $326 million
Cashio (Solana — Account Replacement Vulnerability): $48M
secondary title
consensus
Sui validators do not package transactions into blocks like normal blockchains; instead, they validate transactions individually, eventually obtaining a certificate of finality at the end of the process. According to Sui, verifying transactions individually reduces network latency. Since transactions are grouped by object, validators can process transactions for different objects simultaneously, either relative to each other or on their own machines (called worker nodes). Such parallel transaction submission enables massive execution.
Sui reduces latency by reducing the need for communication between validators, while shifting much of the communication to users. These users typically operate in the form of client-side gateway services that interact with the application (wallets for transfers, DEX entities for transactions, etc.). While this appears to add a layer of trust, it doesnt actually increase the trust assumption. When using an application like MetaMask on Ethereum, users must trust that MetaMask correctly communicates what they want to do on the blockchain. The same level of trust in the application exists in client communication on Sui, and in addition, the client also plays a role in transaction processing.
Thanks to Suis object-centric data model, any wallet or application performing a transaction can present a transaction signing request to the user in a manner similar to Android-style permissions. That is, in addition to signing requests, the wallet or application will display a series of objects and how they will be modified, showing the downstream impact of signed transactions.
secondary title
Complex Transactions (Shared Objects)
Complex transactions involving shared objects are ordered and agreed upon through Suis Narwhal and Bullshark protocols. The Narwhal mempool keeps committed transaction data available and provides a structured path in the form of a DAG to traverse (in selection order) this data. Bullshark consensus selects a specific order for these structured data by agreeing on a specific DAG traversal (ordering based on the DAG structure).
Complex transactions go through five steps before reaching finality.
1. Transactions are broadcast to nodes from respective users/clients.
2. After receiving the message, the validator nodes vote on the validity of the message according to their stake.
3. After the user/client collects these votes for a Byzantine-resistant majority, it generates a certificate of record and broadcasts the certificate back to the validators.
4. Transaction certificates are sorted by Narwhal and Bullshark so that a Byzantine-resistant majority of validators can agree on the ordering of transaction data.
secondary title
Simple transactions (non-shared objects)
Simple transactions involving only non-shared objects do not require ordering through Narwhal and Bullshark. In other words, simple transactions can skip step 4 in the above transaction processing flow. Simple transactions are only subject to a lightweight algorithm called Byzantine consensus broadcasting, which is less strong and more scalable than Byzantine consensus. Broadcasting ensures that all nodes receive the same message from users/clients; it does not require nodes to agree on the state of the network, which is one of the complex parts of consensus algorithms.
Suis data model allows validators to execute transactions in parallel via a causal ordering approach instead of total ordering (ordering transactions sequentially). Sorting based on causality (how a transaction affects the state of a particular object) allows Sui to group transactions by object. Thus, multiple transactions can be processed in parallel in any order if they are not related (do not involve the same object). However, transactions that occur on the same object require total ordering in that particular objects transaction queue. All simple transactions bypass consensus.
secondary title
DPoS
Sui uses Delegated Proof-of-Stake to determine the set of validators for each epoch. The total stake allocated to a validator (including stakes delegated from itself and other SUI token holders) determines the validators voting power in processing transactions. All honest validators will receive gas fees collected during the cycle (see below) and a temporary unlock subsidy (Sui did not give an exact end date) in proportion to their SUI stake size.
Suis system of paying all honest validators is different from a system of paying validators only for the transactions they process. In these systems, larger validators grow at a faster rate with probability because they are more likely to be selected and receive rewards earlier, while validators with smaller stakes have lower probability. In Sui, all honest validators grow at the same rate. Delegators only get computing gas fees and inflation subsidies, but need to pay commissions to their validators.
secondary title
gas fee
Suis gas fee consists of two components: computation and storage.
Calculating Gas Fees
Computing gas fees is determined by a gas pricing mechanism where validators set a minimum gas price for each transaction in the current epoch. Then, a reference Gas price is calculated based on the 2/3 percentile price of the bet and announced to the user. Sui encourages validators to keep the price low, but ultimately lets the validator market determine the gas price. Users can pay a tip on top of the reference price to increase the priority of the transaction. Therefore, calculating the Gas price is the sum of the reference price and the tip.
Storage Gas Fee and Storage Fund
Validators (not delegators) receive storage fund rewards based on the size of the storage fund at the beginning of the epoch.
Suis Storage Fund is a way to fund data storage on the network. By adding the ability to store any amount of data, Sui solves a common data storage problem: the validators who store the original data may not be the same as the future validators who maintain the stored data. Suis storage fund earns storage gas fees and a portion of network staking rewards (computing gas fees plus inflation/unlocked SUI). The staking rewards accumulated by the storage fund are then immediately redistributed to validators. Users who store files on Sui get a refund of all gas storage fees they paid when those files are deleted from storage. Storage fees are never paid to validators.
text
Programmable Transaction Blocks (PTBs)
Sui supports a developer primitive called Programmable Transaction Blocks (PTBs). PTBs allow users to create a composable sequence of up to 1024 transactions that can fail or succeed atomically (one at a time). By packing transactions into PTBs, a single execution on Sui can execute 1024 operations. This approach increases transaction throughput and reduces the average cost per transaction.
PTBs can take many forms. It can be used for homogeneous batching, like minting NFTs in large numbers or sending out multiple payments to multiple parties at once. It can also be used heterogeneously, taking the output of earlier transactions as input further down the sequence. For example, Sui’s testnet has a PTB of 12 DeFi-related operations: 5 swaps across 3 different pools, mutating 20 existing objects and creating 7 new ones in the process.
Abstract Gas Fee
Sui also offers users the option to sponsor deals. A sponsorship transaction is when a user (usually an app) pays gas for consumers interacting with the sponsors platform. Co-founder Evan Cheng believes that the concept of paying for gas should be invisible. Chengs belief is becoming a reality at Sui by enabling anyone to set up a Sui Gas station as the back-end support for sponsorship deals.
horizontal scalability
Suis architecture, data model, and transaction processing approach eliminates Suis need for a global consensus on a total ordered list of transactions. Because the transaction pipeline is built for causal ordering, where transactions are grouped based on objects, it can distribute the workload among validators, especially among validator machines (called worker nodes). Therefore, scalability increases as more worker nodes are added to the validator set. Scalability can be expressed as an overall increase in the number of validators or as a single validator adding more worker nodes/increasing its hardware resources (CPU, memory, storage, etc.).
For measure, Sui tested its capacity using a validator hardware configuration of 24-core AMD, 256 GB RAM, and a 25 Gbps NIC, and achieved between 11,000 and 297,000 transactions per second on various workloads, with final times of half a second. Simple transactions include peer-to-peer transfers, oracle messages, social network posts, and more. Due to its scalability, Sui can support multiple applications such as social media, oracle networks, payments, etc., making it potentially more viable than protocols with fixed throughput caps.
first level title
overview
overview
secondary title
data model
Aptos and Solana use an account-based system to record state on a global ledger. They use head-of-line blocking, fully order transactions, and write blocks sequentially to shared data structures. Suis object-centric data model works differently: the global state is simply the collection of all Sui objects, and transactions are recorded separately.
secondary title
consensus and execution
Furthermore, Suis data model and its approach to transactions enable Sui to bypass consensus for simple transactions. Instead, Aptos and Solana perform consensus on every transaction. Consensus bypassing specific transactions is unique to Sui and is a core feature that enables throughput to scale. With regards to storage, Sui could potentially compete with on-chain storage protocols like Arweave and Filecoin, especially considering that its direct competitors Aptos and Solana have yet to create solutions to the problem of on-chain arbitrary data storage.
Each protocol is capable of parallel processing. Aptos takes an optimistic approach by parallelizing the execution engine with Block-STM (Software Transactional Memory). This approach requires validators to fit all transactions into the memory of a single machine, then execute batches of transactions in parallel, with optimistic execution (without pre-declaring dependencies), and verify after execution. A conflict was detected in memory on the same machine, but while capturing dependencies, the transaction could not execute. Although Block-STM enables parallel execution by a single machine, its potential scale is limited because it requires transactions to exist in only one machines memory to detect conflicts, inhibiting the ability to scale parallel execution pipelines to multiple machines.
first level title
Tokenomics
Suis native token, SUI, will be used for network security (validator and delegator staking), payment of gas fees, and as a requirement for future governance. The launch of the Sui mainnet is scheduled for May 3, 2023, and the maximum SUI supply is set at 10 billion. The Sui Foundation has announced the distribution of SUI tokens, but has not yet specified a liquidity/lockup plan. The Sui Foundation has yet to share further details about governance.
Community Reserve (50%): The Sui Foundation will control half of the maximum SUI supply with the goal of distributing it through community initiatives, including:
1. A delegation program that will bootstrap validators run by the community.
2. A grant program that will distribute tokens to developers, community ambassadors, and other participants who contribute to Sui.
3. Research and development funding.
4. Validator subsidy, which aims to provide early validators with additional staking reward subsidies for a limited time.
Early Contributors (20%): One-fifth of the maximum SUI supply will be allocated to Suis research and production team, its initial contributors Mysten Labs.
Investors (14%): The Sui Foundation has not publicly disclosed any information on the sale of SUI tokens to investors.
Mysten Labs Finances (10%): Mysten Labs did not disclose where this allocation will be used.
first level title
Before the mainnet launch
As the mainnet is about to launch, Suis Devnet and Testnet have already supported more than 200 projects covering various fields such as games, finance, law, and business. The validator set on Devnet consists of only four validators — all of which are run by Sui core contributors and protocol designers Mysten Labs — because it is prioritized as a secure execution environment that allows projects to Program development is stress tested.
Suis Testnet was built in stages, testing various aspects of the protocol. Testnet Wave 1 aims to provide a safe environment for validators to test the operation of Sui nodes/machines. Testnet Wave 2 expanded participation for application builders, end users, and delegators while testing storage funds, Suis DPoS consensus mechanism, and gas mechanism. At the end of March 2023, Sui announced its permanent Testnet for testing sponsored transactions, zero-knowledge proofs, and other future developments.
Here are the stats related to Suis permanent Testnet:
Total transaction volume: 286.23 million
Total package release volume: about 125,949
Sui Wallet: 1.09 million weekly active users and 794,000 daily active users all-time highs
Sui Browser: 117,000 daily active users
Current TPS: about 315
Total validators: 97 (2 run by Mysten Labs, 95 run by other entities)
first level title
route map
scalability
scalability
Lightweight clients/sparse nodes: Lightweight clients/sparse nodes will be able to do sparse replay.
Token Economics
Token Economics
Congestion Pricing: Allowing users to pay “tips” above a validator-specified reference price would cause transaction costs for Sui blockspace to become more expensive during times of congestion, which could hinder a surge in demand for Sui blockspace.
Storage Fund and Governance: The Storage Fund is a mechanism for funding data storage on Sui; users pay for storage gas to upload files to the network. Governance will cover protocol upgrades and setting storage gas fees.
MEV Improvement: MEV (Maximum Extractable Value) refers to the profit a miner or validator may earn by strategically ordering, including, or excluding user transaction requests during block production. This value comes from arbitrage opportunities, liquidations, and other on-chain activities that allow miners or validators to prioritize certain transactions for their benefit.
Sui Move DevX
Certifier: Helps Sui Move developers ensure the correctness and security of their applications. Move Provers check that a developers new functionality works correctly for all possible transactions and inputs.
Improved Language Server: The Language Server is a software development tool that integrates with the Move compiler to provide developers with many features, including code understanding and error reporting. It is a complement to Moves VSCode plugin move-analyzer.
Lint tool: A lint tool is a code analysis tool used to catch errors and enforce coding style to improve code organization and readability. Suis Lint tool mainly contains rules developed for front-end projects.
epilogue
epilogue
If layer-1 blockchains are to succeed, they must enable new use cases and frictionless experiences. Sui breaks the mold with its object-based data model, a novel approach that scales simple consensus-bypassing transactions and grants the ability to store arbitrary data values. Sui allows for Android-style transaction signing permissions and PTBs, features that facilitate large-scale batch processing of atomically composable transactions. It also includes user-friendly features like sponsored transactions, making users gas-agnostic.
In order to gain mainstream adoption, Suis mainnet and associated features need to function as intended and provide a solid foundation for users to get started with blockchain applications. If the digital asset industry goes mainstream sooner than expected, developers and users will seek a flexible and secure smart contract platform that can scale with global throughput, remain cost-effective, and provide a Web2-style front-end experience.