Native Token Transfers (NTT) Solana Deployment#
Install Dependencies#
Ensure you have the following dependencies installed:
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:
-
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:
-
Create a new account for the token:
-
Mint
1000
tokens to the created account:
Note
NTT versions >=v2.0.0+solana
support SPL tokens with transfer hooks.
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:
Set SPL Token Mint Authority#
In this step, you'll set 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.
If deploying to Solana in burning
mode, set the mint authority for your SPL token to the NTT program ID you generated in the previous step.
Deploy NTT#
Generate or export your payer key pair, then run:
ntt add-chain Solana --latest --mode burning --token INSERT_YOUR_SPL_TOKEN --payer INSERT_YOUR_KEYPAIR_JSON --program-key INSERT_YOUR_NTT_PROGRAM_KEYPAIR_JSON
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.
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 set 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#
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.