Skip to content

Deploy NTT to Sui

Native Token Transfers (NTT) enable seamless multichain transfers of Sui tokens using Wormhole's messaging protocol. Instead of creating wrapped tokens, NTT allows native assets to move across chains while maintaining their original properties.

This guide walks you through deploying NTT on Sui, including setting up dependencies, configuring token compatibility, and using the NTT CLI to deploy in hub-and-spoke or burn-and-mint mode.

Prerequisites

Before deploying NTT on Sui, ensure you have the following prerequisites:

Overview of the Deployment Process

Deploying NTT on the Sui network follows a structured process:

  1. Choose your token setup:

    • Use an existing Sui token: If your token is already deployed on the Sui network, you can skip token creation and move directly to the Set Up NTT section.
    • Create a new Sui token: If you don't already have a Sui token deployed, you'll need to deploy and configure it on the Sui network before integrating with Wormhole's NTT.

      Create and Deploy Sui Tokens

      This section walks you through setting up a wallet, deploying a Sui Coin contract, and minting tokens on testnet.

      1. Clone the repository: Use the example NTT token repository to deploy a Sui Coin contract on testnet.

        git clone https://github.com/wormhole-foundation/example-ntt-token-sui.git
        cd example-ntt-token-sui
        
      2. Set up a new wallet on testnet: Before building and deploying your token, you'll need to create a new wallet on the Sui testnet and fund it with test tokens.

        1. Create a new testnet environment: Configure your Sui client for testnet.
        sui client new-env --alias testnet --rpc https://fullnode.testnet.sui.io:443
        
        1. Generate a new address: Create a new Ed25519 address for your wallet.
        sui client new-address ed25519
        
        1. Switch to the new address: The above command will output a new address. Copy this address and switch to it.
        sui client switch --address YOUR_ADDRESS_STEP2
        
        1. Fund your wallet: Use the faucet to get test tokens.
        sui client faucet
        
        1. Verify funding: Check that your wallet has been funded.
        sui client balance
        
      3. Build the project: Compile the Move contract.

        sui move build
        
      4. Deploy the token contract: Deploy to testnet.

        sui client publish --gas-budget 10000000
        
      5. Mint tokens: Send tokens to your address.

        sui client call \
        --package YOUR_DEPLOYED_PACKAGE_ID_STEP4 \
        --module MODULE_NAME_STEP1 \
        --function mint \
        --args TREASURYCAP_ID_STEP4 AMOUNT_WITH_DECIMALS RECIPIENT_ADDRESS \
        --gas-budget 10000000
        

      Note

      This token uses 9 decimals by default. All minting values must be specified with that in mind (1 token = 10^9).

  2. Choose your deployment model:

    • Hub-and-spoke: Tokens are locked on a hub chain and minted on destination spoke chains. Since the token supply remains controlled by the hub chain, no changes to the minting authority are required.
    • Burn-and-mint: Tokens are burned on the source chain and minted on the destination chain. This requires transferring the Sui Treasury cap object to the NTT manager.
  3. Deploy and configure NTT: Use the NTT CLI to initialize and deploy the NTT program, specifying your Sui token and deployment mode.

Set Up NTT

Before deploying NTT contracts on Sui, you need to scaffold a project and initialize your deployment configuration.

Note

If you already have an NTT deployment to another chain (like Solana), you can skip the ntt new and ntt init commands. Simply navigate to your existing NTT project directory and proceed directly to the Deploy and Configure NTT section.

The NTT CLI manages deployments, configures settings, and interacts with the NTT system. Follow these steps to set up NTT using the CLI tool:

Install the NTT CLI and Scaffold a New Project
  1. Install the NTT CLI:

    curl -fsSL https://raw.githubusercontent.com/wormhole-foundation/native-token-transfers/main/cli/install.sh | bash
    

    Verify installation:

    ntt --version
    
  2. Initialize a new NTT project:

    ntt new my-ntt-project
    cd my-ntt-project
    
  3. Create the deployment config using the following command. This will generate a deployment.json file where your settings are stored:

    ntt init Mainnet
    
    ntt init Testnet
    

Deploy and Configure NTT

Once you've set up NTT, proceed with deploying the contracts.

  1. Environment Setup: Ensure you have set up your environment correctly, open your terminal, and run the export commands:

    sui keytool export --key-identity goofy
    
    Note: Replace goofy with your actual key alias. This command exports the private key in the format required by the NTT add-chain command.

    export SUI_PRIVATE_KEY=INSERT_PRIVATE_KEY
    

    After setting up your deployment, finalize the configuration and deploy the NTT program onto the Sui network by following the steps below.

  2. Deploy NTT to Sui: Run the appropriate command based on your deployment mode.

    Note

    The --token parameter requires the full Sui coin type in the format 0xADDRESS::module::struct. For example, 0x2::sui::SUI for the native SUI token, or 0x1234567890abcdef::my_module::MyToken for a custom token.

    Warning

    In burning mode, the NTT CLI moves the treasury-cap object during the add-chain command to the NTT manager, enabling the NTT manager to mint tokens. Important: Once the treasury-cap object is moved to the NTT manager, you will no longer be able to modify the token's metadata (such as name, symbol, or icon).

    ntt add-chain Sui --latest --mode burning --token INSERT_FULL_COIN_TYPE --sui-treasury-cap YOUR_TREASURY_CAP_ID 
    
    ntt add-chain Sui --latest --mode locking --token INSERT_FULL_COIN_TYPE
    
  3. Verify deployment status: After deployment, check if your deployment.json file matches the on-chain configuration using the following command.

    ntt status
    

    If needed, sync your local configuration with the on-chain state:

    ntt pull
    
  4. Configure inbound and outbound rate limits: By default, the inbound and outbound limits are set to 0 and must be updated before deployment.

    Open your deployment.json file and adjust the values based on your use case:

    "inbound": {
        "Sepolia": "1000.000000000" // inbound limit from Sepolia to Sui
    },
    "outbound": {
        "Sepolia": "1000.000000000" // outbound limit from Sui to Sepolia
    }
    
  5. Push the final deployment: Once rate limits are set, sync the on-chain configuration with local changes made to your deployment.json file.

    ntt push
    

After you deploy the NTT contracts, ensure that the deployment is properly configured and your local representation is consistent with the actual on-chain state by running ntt status and following the instructions shown on the screen.

Where to Go Next

  • Test Your Deployment


    Follow the NTT Post Deployment Guide for integration examples and testing instructions.

    Test Your NTT deployment

  • Deploy NTT to SVM Chains


    Follow the guide to deploy and configure Wormhole's Native Token Transfers (NTT) for SVM chains.

    Deploy NTT to SVM Chains

  • View FAQs


    Find answers to common questions about NTT.

    View FAQs

  • Deploy NTT to EVM Chains


    Follow the guide to deploy and configure Wormhole's Native Token Transfers (NTT) for EVM chains.

    Deploy NTT to EVM Chains