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 SPL Token
If you haven't already, deploy your SPL token to Solana.
-
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 using the
token-2022
program: -
Create a new account for the token:
-
Mint
1000
tokens to the created account:
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:
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
The NTT Solana program will then compile and deploy.
Configure NTT
As with other deployments, run the following commands to ensure that the on-chain configuration is correct and your local deployment.json
file is synced with the on-chain state:
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.