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 Arguments
- Object Arguments
- Funds Withdrawal
Pure values like numbers, strings, or addresses encoded as bytes:
Transaction Structure
Every transaction contains:Sender
Sender
The address that signed and submitted the transaction
Gas Payment
Gas Payment
One or more coin objects used to pay for gas
Gas Budget
Gas Budget
Maximum amount of gas the transaction can consume
Gas Price
Gas Price
Price per unit of gas in MIST (1 SUI = 1B MIST)
Transaction Kind
Transaction Kind
The type and content of the transaction (programmable, system, etc.)
Expiration
Expiration
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
dropability - Parameters in PTBs must be transaction inputs, not results from previous commands
- Must have
entryvisibility modifier
Public Functions vs Entry Functions
- Public Functions
- 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
Use programmable transactions
Use programmable transactions
Combine multiple operations in a single transaction for atomicity:
Set appropriate gas budgets
Set appropriate gas budgets
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
Handle gas price correctly
Handle gas price correctly
Use current reference gas price or higher:
Minimize shared object usage
Minimize shared object usage
Related Topics
Transaction Lifecycle
Understand transaction execution flow
Gas Pricing
Learn about gas costs
Sponsored Transactions
Enable gasless transactions