Native Token Transfers (NTT) Solana Deployment#
Install Dependencies#
Ensure you have the following dependencies installed:
Warning
Ensure you are using the above versions of Solana and Anchor. Running the deployment with a different version may cause issues.
Deploy NTT#
Create a new NTT project (or use an existing NTT project):
Initialize a new deployment.json
file specifying the network:
Deploy Your Solana Token#
Deploy an SPL Token
-
Generate a new Solana key pair to create a wallet:
-
Set Solana configuration to use the new key pair created in step 1:
-
Set the Solana configuration to use the default RPC URL for Devnet:
-
Request an airdrop of two SOL and check the balance:
-
Install or update the SPL Token CLI:
-
Create a new token with the SPL Token CLI (make sure you have enough balance to pay for the transaction):
-
Create a new account for the token created in step 6:
-
Mint
1000
tokens to the created account:
Note
NTT versions >=v2.0.0+solana
support SPL tokens with transfer hooks.
Deployment Mode Requirements#
The NTT CLI supports two deployment models: Hub-and-Spoke and Burn-and-Mint.
For a detailed explanation of these models, see the Deployment Models page.
Hub-and-Spoke#
No additional configuration is required for hub-and-spoke deployments. Tokens retain their original mint authority, so the steps below are not necessary. You can generate a new NTT program key pair and deploy the NTT program directly.
Burn-and-Mint#
For burn-and-mint deployments, you must configure the token's mint authority to enable cross-chain transfers. To complete the required setup, follow the steps in the following sections.
Configuration and Deployment#
Generate NTT Program Key Pair#
When you deploy a Solana program, you need to hardcode the program ID (a Pubkey) into the program code. The NTT CLI allows you to do this seamlessly.
Generate a new NTT program key pair using:
Derive Token Authority#
In this step, you'll derive the token authority Program Derived Address (PDA) of the newly generated NTT program ID:
This script will output the derived PDA, which you will use in the next step.
Set SPL Token Mint Authority#
Warning
You must create your token's metadata before delegating mint authority. See an example on how to create metadata for your SPL token.
If deploying in burning
mode, you'll set the SPL token mint authority to the newly generated token authority PDA:
Note
Please ensure that you are using Anchor CLI version 0.29.0
. Running the deployment with a different version may cause compatibility issues.
Deploy NTT#
Generate or export your payer key pair, then run:
Note
The add-chain
command accepts an optional --solana-priority-fee
flag, which sets the priority fee in microlamports. The default is 50000
.
The NTT Solana program will then compile and deploy, returning the program ID.
Configure NTT#
The NTT CLI takes inspiration from git. You can run:
ntt status
- checks whether yourdeployment.json
file is consistent with what is on-chain-
ntt pull
- syncs yourdeployment.json
file with the on-chain configuration and sets up rate limits with the appropriate number of decimals, depending on the specific chain. For example:For Solana, the limits are set with 9 decimal places:
For Sepolia (Ethereum Testnet), the limits are set with 18 decimal places:
This initial configuration ensures that the rate limits are correctly represented for each chain's token precision.
Deploy NTT to Solana#
You can now push the deployment to the Solana network, specifying the key pair that will cover the gas fees:
By default, NTT transfers to Solana support manual relaying, which requires the user to perform a transaction on Solana to complete the transfer. UI components such as Wormhole Connect support this out of the box. For automatic Wormhole relaying support on Solana, contact Wormhole contributors.
Important
To proceed with testing and find integration examples, check out the NTT Post Deployment page.