Skip to content

Get Started with NTT

Introduction

The Native Token Transfers (NTT) framework enables seamless cross-chain token movement without wrapping or liquidity pools. This guide shows you how to install the NTT CLI, which is used to configure and deploy native token contracts, and scaffold your first project for deployment on testnet or mainnet.

If you are looking for a no-code experience to deploy on mainnet, you can explore the NTT Launchpad.

Prerequisites

Before you begin, make sure you have:

Don’t Have a Token Yet?

To use NTT, you must have a token already deployed on the source and destination chains. If you don’t have one, follow the quick guides below to deploy a basic test token.

Deploy an ERC-20 Token on EVM

Use the example NTT token repository to deploy a basic ERC-20 token contract on testnet.

  1. Install Foundry - install the Forge CLI

  2. Clone the repository – fetch the example contract repository

    git clone https://github.com/wormhole-foundation/example-ntt-token.git
    cd example-ntt-token
    
  3. Deploy the token contract – deploy to testnet with your preferred name, symbol, minter, and owner addresses

    forge create --broadcast \
        --rpc-url INSERT_RPC_URL \
        --private-key INSERT_YOUR_PRIVATE_KEY \
        src/PeerToken.sol:PeerToken \
        --constructor-args "INSERT_TOKEN_NAME" "INSERT_TOKEN_SYMBOL" INSERT_MINTER_ADDRESS INSERT_OWNER_ADDRESS
    
  4. Mint tokens – send tokens to your address

    cast send INSERT_TOKEN_ADDRESS \
        "mint(address,uint256)" \
        INSERT_RECIPIENT_ADDRESS \
        INSERT_AMOUNT_IN_WEI \
        --private-key INSERT_YOUR_PRIVATE_KEY \
        --rpc-url INSERT_RPC_URL
    

Note

This token uses 18 decimals by default. All minting values must be specified in wei (1 token = 10^18).

Create and Mint SPL Tokens

This section walks you through generating a Solana wallet, deploying an SPL token, creating a token account, and minting tokens.

  1. Generate a Solana key pair - run the following command to create a new wallet:

    solana-keygen grind --starts-with w:1 --ignore-case
    
  2. Set Solana configuration - configure the Solana CLI to use the generated key pair using the following command:

    solana config set --keypair INSERT_PATH_TO_KEYPAIR_JSON
    
  3. Select an RPC URL - configure Solana to use the appropriate network using one of the following commands:

    solana config set -um
    
    solana config set -ut
    
    solana config set -ud
    
  4. Fund your wallet - ensure you have enough SOL to create a token. If deploying on devnet, request an airdrop with the following commands:

    solana airdrop 2
    solana balance
    
  5. Install SPL Token CLI - install or update the required CLI tool

    cargo install spl-token-cli
    
  6. Create a new SPL token - initialize the token on Solana

    spl-token create-token
    
  7. Create a token account - generate an account to hold the token

    spl-token create-account INSERT_TOKEN_ADDRESS
    
  8. Mint tokens - send 1000 tokens to the created account

    spl-token mint INSERT_TOKEN_ADDRESS 1000
    

Note

NTT versions >=v2.0.0+solana support SPL tokens with transfer hooks.

Install NTT CLI

The NTT CLI is recommended to deploy and manage your cross-chain token configuration.

  1. Run the installation command in your terminal:

    curl -fsSL https://raw.githubusercontent.com/wormhole-foundation/native-token-transfers/main/cli/install.sh | bash
    
  2. Verify the NTT CLI is installed:

    ntt --version
    
Command not found?

If the ntt command is not recognized after installation, ensure that Bun is installed and that its binary directory is included in your shell’s PATH.

Append this line to your shell config (e.g., ~/.zshrc or ~/.bashrc):

echo 'export PATH="$HOME/.bun/bin:$PATH"' >> ~/.zshrc

Then, restart your terminal or run source ~/.zshrc.

Initialize a New NTT Project

  1. Once the CLI is installed, scaffold a new project by running:

    ntt new my-ntt-project
    cd my-ntt-project
    
  2. Initialize a new deployment.json file specifying the network:

    ntt init Mainnet
    
    ntt init Testnet
    

    After initialization, the deployment.json file contains your NTT configuration and starts with the selected network.

    {
        "network": "Mainnet",
        "chains": {}
    }
    
    {
        "network": "Testnet",
        "chains": {}
    }
    

In the deployment steps, you will add your supported chains, their token addresses, deployment modes, and any custom settings.

Next Steps

You have scaffolded your NTT project and initialized the configuration file. Next, follow the appropriate guide below to configure your supported chains and deploy NTT contracts: