Skip to main content
Sui’s transaction model is unique in its support for Programmable Transaction Blocks (PTBs), which allow you to chain multiple operations together atomically. This enables complex operations to be executed efficiently in a single transaction.

Transaction Types

Sui supports several types of transactions:

Programmable Transactions

User-initiated transactions that can chain multiple commands

System Transactions

Special transactions for epoch changes and system state updates

Genesis Transaction

One-time transaction that initializes the network

Consensus Updates

Transactions that update consensus-related state

Programmable Transaction Blocks

Programmable transactions are the primary transaction type for users and applications.

Transaction Arguments

Transactions can take three types of arguments:
Pure values like numbers, strings, or addresses encoded as bytes:

Transaction Structure

Every transaction contains:
The address that signed and submitted the transaction
One or more coin objects used to pay for gas
Maximum amount of gas the transaction can consume
Price per unit of gas in MIST (1 SUI = 1B MIST)
The type and content of the transaction (programmable, system, etc.)
Optional epoch after which the transaction becomes invalid

Entry Functions

Entry functions are special Move functions that can be called directly from transactions:

Entry Function Rules

Entry functions have special restrictions:
  • Can only return types with drop ability
  • Parameters in PTBs must be transaction inputs, not results from previous commands
  • Must have entry visibility modifier

Public Functions vs Entry Functions

Can be called from other Move modules and chained in PTBs:
  • Can return any type
  • Results can be passed to subsequent commands
  • More flexible for composition

Transaction Commands

Programmable transactions support various native commands:

MoveCall

Call a Move function

TransferObjects

Transfer objects to addresses

SplitCoins

Split coin into multiple coins

MergeCoins

Merge multiple coins into one

Publish

Publish a new Move package

MakeMoveVec

Create a vector of Move values

Upgrade

Upgrade an existing package

Shared Object Example

Here’s a practical example using a shared counter:

Gas Configuration

From the source code:

Type Argument Validation

Sui validates type arguments to prevent abuse:

End-of-Epoch Transactions

Special transactions that run at epoch boundaries:

Best Practices

Combine multiple operations in a single transaction for atomicity:
Set gas budgets high enough to cover execution but not wastefully high:
  • Simple transfers: ~1M gas units
  • Complex operations: ~10M+ gas units
  • Package publishing: ~100M+ gas units
Use current reference gas price or higher:
Shared objects require consensus and are slower. Prefer owned objects when possible.

Transaction Lifecycle

Understand transaction execution flow

Gas Pricing

Learn about gas costs

Sponsored Transactions

Enable gasless transactions