Skip to main content

Overview

This guide walks you through creating and executing your first transaction on Sui, from setting up your wallet to transferring SUI tokens.
Make sure you’ve installed Sui and configured your client before proceeding.

Prerequisites

1

Verify Sui Installation

Expected output: sui 1.68.0 (or later)
2

Check Active Environment

Should show devnet (or your preferred network)
3

View Your Address

Output: 0x1234...abcd (your unique address)

Get Test Tokens

Before you can send transactions, you need SUI tokens to pay for gas.
Expected output:
Wait a moment, then check your balance:
Devnet and testnet faucets provide test tokens with no real value. For mainnet, you’ll need to acquire actual SUI.

Transaction Types

Sui supports several transaction types. Let’s start with the most common:

1. Transfer SUI Tokens

Transfer SUI from your address to another:
1

Create a Second Address (for testing)

Output:
Save this address - we’ll use it as the recipient.
2

Switch Back to Your Main Address

This shows all your addresses. Note the one with tokens (from the faucet).
3

Execute Transfer

Parameters:
  • --to: Recipient address
  • --sui-coin-object-id: Your SUI coin object (get from sui client gas)
  • --gas-budget: Maximum gas in MIST (10000000 = 0.01 SUI)
  • --amount: Amount to send in MIST (100000000 = 0.1 SUI)
Find your coin objects with: sui client gas
4

View Transaction Result

The CLI will display the transaction digest and effects:
5

Verify the Transfer

Check balances:

2. Transfer Objects

Transfer non-SUI objects (like NFTs):
This transfers ownership of any object (NFT, game item, etc.) to the recipient.

3. Merge Coins

Combine multiple coin objects into one:
Use case: Consolidate fragmented coins for easier management.

4. Split Coins

Split a coin into multiple coins:
This creates two new coins: one with 0.1 SUI and one with 0.2 SUI.

Understanding Transaction Structure

Every Sui transaction contains:
  • Sender: Address initiating the transaction
  • Gas Payment: Coin object used to pay gas
  • Gas Budget: Maximum gas willing to pay
  • Gas Price: Price per gas unit (typically reference gas price)
  • Commands: One or more programmable transaction commands
  • Expiration: Optional expiration epoch
Programmable Transaction Block (PTB) commands:
  • TransferObjects: Transfer objects to addresses
  • SplitCoins: Split coins into smaller denominations
  • MergeCoins: Merge coins together
  • MoveCall: Call a Move function
  • Publish: Publish a Move package
  • MakeMoveVec: Create a vector
Results after execution:
  • Status: Success or failure
  • Gas Used: Actual gas consumed
  • Created Objects: New objects created
  • Mutated Objects: Objects modified
  • Deleted Objects: Objects deleted
  • Events: Events emitted

Using Programmable Transaction Blocks

PTBs allow you to compose multiple operations atomically:
This single transaction:
  1. Splits the gas coin into two coins (0.1 SUI and 0.2 SUI)
  2. Transfers 0.1 SUI to recipient1
  3. Transfers 0.2 SUI to recipient2
All operations succeed or fail together - atomic execution guaranteed.

Inspecting Transactions

View Transaction Details

Output shows complete transaction data, effects, and events.

Query Recent Transactions

Lists all objects owned by your address, including transaction history.

Check Gas Usage

Shows all gas coins and their amounts.

Transaction Best Practices

Set Appropriate Gas Budget

  • Start with 10000000 MIST (0.01 SUI)
  • Increase for complex transactions
  • Unused gas is refunded

Check Object Versions

  • Objects have version numbers
  • Using old version fails
  • Always use latest version

Handle Errors Gracefully

  • Check transaction status
  • Retry with higher gas if needed
  • Validate addresses before sending

Use PTBs for Efficiency

  • Combine operations
  • Save on gas costs
  • Ensure atomicity

Transaction Lifecycle

Common Issues

Cause: Gas budget too low for transaction complexity.Solution: Increase --gas-budget:
Cause: Using outdated object version (concurrent update).Solution:
  1. Query latest object: sui client object 0xobj...
  2. Use the current version in your transaction
  3. Retry transaction
Cause: Not enough SUI for transfer + gas.Solution:
  • Check balance: sui client balance
  • Request more from faucet
  • Reduce transfer amount
Cause: Malformed recipient address.Solution:
  • Verify address starts with 0x
  • Check address is 64 hex characters (after 0x)
  • Use sui client addresses to list valid addresses

Using SDKs

TypeScript SDK

Rust SDK

Next Steps

Quickstart Guide

Build and deploy your first Move package

Programmable Transactions

Master complex transaction composition

TypeScript SDK

Build applications with TypeScript

Transaction Concepts

Deep dive into transaction mechanics

Summary

You’ve successfully:
  • ✅ Obtained test SUI tokens from the faucet
  • ✅ Created and executed your first transaction
  • ✅ Transferred SUI between addresses
  • ✅ Inspected transaction results
  • ✅ Learned about transaction structure and PTBs
You’re now ready to build more complex applications on Sui!