diff --git a/build/transfers/native-token-transfers/cli-commands.md b/build/transfers/native-token-transfers/cli-commands.md index b85cc5dc..339b23f7 100644 --- a/build/transfers/native-token-transfers/cli-commands.md +++ b/build/transfers/native-token-transfers/cli-commands.md @@ -9,12 +9,13 @@ description: A comprehensive guide to the Native Token Transfers (NTT) CLI, deta The NTT Command-Line Interface (CLI) is a powerful tool for managing native token transfers across multiple blockchain networks within the Wormhole ecosystem. This page provides a comprehensive list of available commands, their descriptions, and examples to help you interact with and configure the NTT system effectively. Whether initializing deployments, updating configurations, or working with specific chains, the NTT CLI simplifies these operations through its intuitive commands. +If you haven't installed the NTT CLI yet, follow the [NTT Installation Guide](/docs/build/transfers/native-token-transfers/deployment-process/installation/#installation){target=\_blank} to set it up before proceeding. + ## Table of Commands The following table lists the available NTT CLI commands, descriptions, and examples. -!!! note - To explore detailed information about any NTT CLI command, including its options and examples, you can append `--help` to the command. This will display a comprehensive guide for the specific command. +To explore detailed information about any NTT CLI command, including its options and examples, you can append `--help` to the command. This will display a comprehensive guide for the specific command. ### General Commands @@ -45,3 +46,26 @@ The following table lists the available NTT CLI commands, descriptions, and exam | `ntt solana key-base58 ` | print private key in base58 | `ntt solana key-base58 /path/to/keypair.json`| | `ntt solana token-authority ` | print the token authority address for a given program ID| `ntt solana token-authority Sol1234...`| | `ntt solana ata `| print the token authority address for a given program ID| `ntt solana ata Mint123... Owner123... token22`| + +## Where to Go Next + +
+ + +- :octicons-gear-16:{ .lg .middle } **Configure NTT** + + --- + + Find information on configuring NTT, including guidance on setting Owner and Pauser access control roles and management of rate-limiting. + + [:custom-arrow: Configure your NTT deployment](/docs/build/transfers/native-token-transfers/configuration/) + +- :octicons-question-16:{ .lg .middle } **NTT FAQs** + + --- + + Frequently asked questions about Wormhole Native Token Transfers, including cross-chain lending, SDK usage, custom RPCs, and integration challenges. + + [:custom-arrow: Check out the FAQs](/docs/build/transfers/native-token-transfers/faqs/) + +
diff --git a/build/transfers/native-token-transfers/deployment-process/deploy-to-solana.md b/build/transfers/native-token-transfers/deployment-process/deploy-to-solana.md index ee42dd2c..239c9fda 100644 --- a/build/transfers/native-token-transfers/deployment-process/deploy-to-solana.md +++ b/build/transfers/native-token-transfers/deployment-process/deploy-to-solana.md @@ -1,197 +1,258 @@ --- title: Native Token Transfers Solana Deployment -description: Deploy and configure Wormhole’s Native Token Transfers (NTT) for Solana, including setup, token compatibility, mint/burn modes, and CLI usage. +description: Deploy and configure Wormhole's Native Token Transfers (NTT) for Solana, including setup, token compatibility, mint/burn modes, and CLI usage. --- -# Native Token Transfers (NTT) Solana Deployment +# Deploy Native Token Transfers on Solana -## Install Dependencies +[Native Token Transfers (NTT)](/docs/learn/transfers/native-token-transfers/overview/){target=\_blank} enable seamless multichain transfers of SPL tokens on Solana using Wormhole's messaging protocol. Instead of creating wrapped tokens, NTT allows native assets to move across chains while maintaining their original properties. -Ensure you have the following dependencies installed: +This guide walks you through deploying NTT on Solana, including setting up dependencies, configuring token compatibility, and using the NTT CLI to deploy in hub-and-spoke or burn-and-mint mode. + +By the end, a fully deployed NTT will be set up, allowing your token to transfer between Solana and other supported chains. + +## Prerequisites + +Before deploying NTT on Solana, ensure you have the following: - [Rust](https://www.rust-lang.org/tools/install){target=\_blank} - [Solana](https://docs.solanalabs.com/cli/install){target=\_blank} **`{{ ntt.solana_cli_version }}`** - [Anchor](https://www.anchor-lang.com/docs/installation){target=\_blank} **`{{ ntt.anchor_version }}`** -!!!Warning - Ensure you are using the above versions of Solana and Anchor. Running the deployment with a different version may cause issues. +Use the Solana and Anchor versions listed above to avoid compatibility issues while following this guide. -## Deploy NTT +## Overview of the Deployment Process -Create a new NTT project (or use an existing NTT project): +Deploying NTT with the CLI on Solana follows a structured process: -```bash -ntt new my-ntt-deployment -cd my-ntt-deployment -``` +1. **Choose your token setup**: -Initialize a new `deployment.json` file specifying the network: + - **Use an existing SPL token** - if your token is already deployed on Solana, you can skip token creation and move directly to the [Set Up NTT](#set-up-ntt) section + - **Create a new SPL token** - if you don't already have an SPL token deployed, you'll need to deploy and configure it on Solana before integrating with Wormhole's NTT -=== "Testnet" +2. **Choose your [deployment model](/docs/learn/transfers/native-token-transfers/deployment/){target=\_blank}**: - ```bash - ntt init Testnet - ``` + - **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 SPL token's minting authority to the Program Derived Address (PDA) controlled by the NTT program -=== "Mainnet" +3. **Deploy and configure NTT** - use the NTT CLI to initialize and deploy the NTT program, specifying your SPL token and deployment mode - ```bash - ntt init Mainnet - ``` -## Deploy Your Solana Token +Following this process, your token will fully integrate with NTT, enabling seamless transfers between Solana and other chains. + +By default, NTT transfers to Solana require manual [relaying](/docs/learn/infrastructure/relayer/){target=\_blank}, meaning users must complete a transaction on Solana to finalize the transfer. For automatic relaying, where transactions are completed without user intervention, additional setup is required. [Contact Wormhole contributors](https://forms.clickup.com/45049775/f/1aytxf-10244/JKYWRUQ70AUI99F32Q){target=\_blank} to enable automatic relaying support for your deployment. + +## Create and Mint Tokens -???- interface "Deploy an SPL Token" +This section walks you through generating a Solana wallet, deploying an SPL token, creating a token account, and minting tokens. + +If you already have an SPL token, skip to [Set Up NTT](#set-up-ntt). + +1. **Generate a Solana key pair** - run the following command to create a new wallet: - 1. Generate a new Solana key pair to create a wallet: ```bash solana-keygen grind --starts-with w:1 --ignore-case ``` - 2. Set Solana configuration to use the new key pair created in step 1: +2. **Set Solana configuration** - configure the Solana CLI to use the generated key pair using the following command: + ```bash solana config set --keypair INSERT_PATH_TO_KEYPAIR_JSON ``` - 3. Set the Solana configuration to use the default RPC URL for Devnet: - ```bash - solana config set -ud - ``` +3. **Select an RPC URL** - configure Solana to use the appropriate network using one of the following commands: + + === "Mainnet" + ```bash + solana config set -um + ``` + + === "Testnet" + ```bash + solana config set -ut + ``` + + === "Devnet" + ```bash + 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: - 4. Request an airdrop of two SOL and check the balance: ```bash - solana airdrop 2 & solana balance + solana airdrop 2 + solana balance ``` - 5. Install or update the SPL Token CLI: +5. **Install SPL Token CLI** - install or update the required [CLI tool](https://spl.solana.com/token){target=\_blank} + ```bash cargo install spl-token-cli ``` - 6. Create a new token with the SPL Token CLI (make sure you have enough balance to pay for the transaction): +6. **Create a new SPL token** - initialize the token on Solana + ```bash spl-token create-token ``` - 7. Create a new account for the token created in step 6: +7. **Create a token account** - generate an account to hold the token + ```bash spl-token create-account INSERT_TOKEN_ADDRESS ``` - 8. Mint `1000` tokens to the created account: +8. **Mint tokens** - send 1000 tokens to the created account + ```bash spl-token mint INSERT_TOKEN_ADDRESS 1000 ``` -!!! note - NTT versions `>=v2.0.0+solana` support SPL tokens with transfer hooks. +NTT versions `>=v2.0.0+solana` support SPL tokens with [transfer hooks](https://spl.solana.com/transfer-hook-interface){target=\_blank}. -### Deployment Mode Requirements +## Set Up NTT -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](/docs/learn/transfers/native-token-transfers/deployment/){target=\_blank} page. +To integrate your token with NTT on Solana, you must initialize the deployment and configure its parameters. This process sets up the required contracts and may generate key pairs if they don't exist. These key pairs are used to sign transactions and authorize actions within the NTT deployment. -#### Hub-and-Spoke +The [NTT CLI](/docs/build/transfers/native-token-transfers/deployment-process/installation/){target=\_blank} manages deployments, configures settings, and interacts with the NTT system. Follow these steps to set up NTT using the CLI tool: -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](/docs/build/transfers/native-token-transfers/deployment-process/deploy-to-solana/#generate-ntt-program-key-pair) and [deploy the NTT program](/docs/build/transfers/native-token-transfers/deployment-process/deploy-to-solana/#__tabbed_2_2) directly. +1. **Create a new NTT project** - set up a deployment workspace -#### Burn-and-Mint + ```bash + ntt new INSERT_PROJECT_NAME + cd INSERT_PROJECT_NAME + ``` -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. +2. **Initialize the deployment** - generate a `deployment.json` file with your deployment settings -## Configuration and Deployment + === "Mainnet" -### Generate NTT Program Key Pair + ```bash + ntt init Mainnet + ``` -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. + === "Testnet" -Generate a new NTT program key pair using: + ```bash + ntt init Testnet + ``` + + === "Devnet" -```bash -solana-keygen grind --starts-with ntt:1 --ignore-case -``` + ```bash + ntt init Devnet + ``` -### Derive Token Authority +### Set Mint Authority -In this step, you'll derive the token authority Program Derived Address (PDA) of the newly generated NTT program ID: +If you use burn-and-mint mode, follow these steps to enable the NTT program to mint tokens on Solana. This involves deriving the PDA as the token authority and updating the SPL token's minting permissions. -```bash -ntt solana token-authority INSERT_YOUR_NTT_PROGRAM_KEY_PAIR -``` +If you want to use hub-and-spoke, skip this section and proceed to [Deploy and Configure NTT](#deploy-and-configure-ntt). -This script will output the derived PDA, which you will use in the next step. +Before updating the mint authority, you must create metadata for your SPL token. You can visit this repository to see an example of [how to create metadata for your SPL token](https://github.com/wormhole-foundation/demo-metaplex-metadata/blob/main/src/token-metadata.ts){target=\_blank}. -### Set SPL Token Mint Authority +Follow these steps to set the mint authority using the NTT CLI: -!!!Warning - You must create your token's metadata before delegating mint authority. [See an example on how to create metadata for your SPL token](https://github.com/wormhole-foundation/demo-metaplex-metadata){target=\_blank}. +1. **Generate an NTT program key pair** - create a unique key pair for the NTT program. The key pair must start with "ntt" to identify it as belonging to the NTT deployment -If deploying in `burning` mode, you'll set the SPL token mint authority to the newly generated token authority PDA: + ```bash + solana-keygen grind --starts-with ntt:1 --ignore-case + ``` + +2. **Derive the token authority** - generate the PDA, which will manage token minting + + ```bash + ntt solana token-authority INSERT_YOUR_NTT_PROGRAM_KEY_PAIR + ``` + +3. **Set SPL token mint authority** - delegate minting control to the derived PDA + + ```bash + spl-token authorize INSERT_TOKEN_ADDRESS mint INSERT_DERIVED_PDA + ``` + +## Deploy and Configure NTT + +After setting up your deployment, finalize the configuration and deploy the NTT program on Solana by following these steps: -```bash -spl-token authorize INSERT_TOKEN_ADDRESS mint INSERT_DERIVED_PDA -``` +1. **Deploy NTT to Solana** - run the appropriate command based on your deployment mode: -!!! note - Please ensure that you are using Anchor CLI version `0.29.0`. Running the deployment with a different version may cause compatibility issues. + === "Burn-and-Mint" + ```bash + ntt add-chain Solana --latest --mode burning --token INSERT_TOKEN_ADDRESS --payer INSERT_YOUR_KEYPAIR_JSON --program-key INSERT_YOUR_NTT_PROGRAM_KEYPAIR_JSON + ``` -### Deploy NTT + === "Hub-and-Spoke" -Generate or export your payer key pair, then run: + ```bash + ntt add-chain Solana --latest --mode locking --token INSERT_TOKEN_ADDRESS --payer INSERT_YOUR_KEYPAIR_JSON --program-key INSERT_YOUR_NTT_PROGRAM_KEYPAIR_JSON + ``` -=== "Burn-and-Mint" + !!! tip + The `add-chain` command accepts an optional `--solana-priority-fee` flag, which sets the priority fee in microlamports. The default is `50000`. + +2. **Verify deployment status** - after deployment, check if your `deployment.json` file matches the on-chain configuration using the following command: ```bash - ntt add-chain Solana --latest --mode burning --token INSERT_TOKEN_ADDRESS --payer INSERT_YOUR_KEYPAIR_JSON --program-key INSERT_YOUR_NTT_PROGRAM_KEYPAIR_JSON + ntt status ``` -=== "Hub-and-Spoke" + If needed, sync your local configuration with the on-chain state: ```bash - ntt add-chain Solana --latest --mode locking --token INSERT_TOKEN_ADDRESS --payer INSERT_YOUR_KEYPAIR_JSON --program-key INSERT_YOUR_NTT_PROGRAM_KEYPAIR_JSON + ntt pull + ``` + +3. **Configure inbound and outbound rate limits** - by default, the inbound and outbound limits are set to `0` and must be updated before deployment. For EVM chains, values must be set using 18 decimals, while Solana uses nine decimals. + + Open your `deployment.json` file and adjust the values based on your use case: + + ```json + "inbound": { + "Sepolia": "1000.000000000" // inbound limit from Sepolia to Solana + }, + "outbound": { + "Sepolia": "1000.000000000" // outbound limit from Solana to Sepolia + } ``` -!!! note - The `add-chain` command accepts an optional `--solana-priority-fee` flag, which sets the priority fee in microlamports. The default is `50000`. +4. **Push the final deployment** - once rate limits are set, push the deployment to Solana using the specified key pair to cover gas fees + + ```bash + ntt push --payer INSERT_YOUR_KEYPAIR_JSON + ``` + +### Troubleshoot Deployment Issues + +If your deployment fails, it may be due to leftover program buffer accounts taking up storage on Solana. These temporary accounts are created during deployment but may persist if interrupted. Refer to the [Solana program deployment guide](https://solana.com/docs/programs/deploying#program-buffer-accounts){target=\_blank} for instructions on finding and closing these buffer accounts to free up space and allow redeployment. + +## Where to Go Next + +
-The NTT Solana program will then compile and deploy, returning the program ID. +- :octicons-globe-16:{ .lg .middle } **Deploy NTT on EVM Chains** -!!! note - Refer to the [Solana docs](https://solana.com/docs/programs/deploying#program-buffer-accounts){target=\_blank} for failed deployments, which provide instructions on finding buffer accounts and closing them to reclaim allocated SOL. + --- -### Configure NTT + After deploying NTT on Solana, deploy and integrate it on EVM chains to enable seamless multichain transfers. -The NTT CLI takes inspiration from [git](https://git-scm.com/){target=\_blank}. You can run: + [:custom-arrow: Deploy NTT on EVM](/docs/build/transfers/native-token-transfers/deployment-process/deploy-to-evm/){target=\_blank} -- `ntt status` - checks whether your `deployment.json` file is consistent with what is on-chain -- `ntt pull` - syncs your `deployment.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: +- :octicons-tools-16:{ .lg .middle } **Test Your Deployment** - For Solana, the limits are set with 9 decimal places: - ```json - "inbound": { - "Sepolia": "1000.000000000" // inbound limit from Sepolia to Solana - } - ``` + --- - For Sepolia (Ethereum Testnet), the limits are set with 18 decimal places: - ```json - "inbound": { - "Solana": "1000.000000000000000000" // inbound limit from Solana to Sepolia - } - ``` + Follow the NTT Post Deployment Guide for integration examples and testing instructions. - This initial configuration ensures that the rate limits are correctly represented for each chain's token precision. + [:custom-arrow: Test Your NTT deployment](/docs/build/transfers/native-token-transfers/deployment-process/post-deployment/){target=\_blank} -### Deploy NTT to Solana +- :octicons-tools-16:{ .lg .middle } **Add NTT to Your dApp** -You can now push the deployment to the Solana network, specifying the key pair that will cover the gas fees: + --- -```bash -ntt push --payer INSERT_YOUR_KEYPAIR_JSON -``` + Configure Wormhole Connect, a plug-and-play bridging UI, to enable multichain transfers for your token. -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](https://forms.clickup.com/45049775/f/1aytxf-10244/JKYWRUQ70AUI99F32Q){target=\_blank} Wormhole contributors. + [:custom-arrow: Use Connect to Integrate NTT](/docs/build/transfers/connect/){target=\_blank} -!!!important - To proceed with testing and find integration examples, check out the [NTT Post Deployment](/docs/build/transfers/native-token-transfers/deployment-process/post-deployment/){target=\_blank} page. \ No newline at end of file +
diff --git a/build/transfers/native-token-transfers/deployment-process/installation.md b/build/transfers/native-token-transfers/deployment-process/installation.md index dce8946a..32953738 100644 --- a/build/transfers/native-token-transfers/deployment-process/installation.md +++ b/build/transfers/native-token-transfers/deployment-process/installation.md @@ -5,39 +5,41 @@ description: Learn how to Install Wormhole’s Native Token Transfers (NTT) fram # Install the Native Token Transfers CLI -## Installation - -In this video, the Wormhole team walks you through installing the Native Token Transfers (NTT) CLI. You’ll see a practical demonstration of running commands, verifying your installation, and addressing common issues that might arise. If you prefer to follow written instructions or want a quick reference for each step, scroll down for the detailed installation guide. +In this video, the Wormhole team walks you through installing the [Native Token Transfers (NTT) CLI](https://github.com/wormhole-foundation/native-token-transfers/tree/main/cli){target=\_blank}. You’ll see a practical demonstration of running commands, verifying your installation, and addressing common issues that might arise. If you prefer to follow written instructions or want a quick reference for each step, scroll down for the detailed installation guide.
+## Install NTT CLI + The fastest way to deploy Native Token Transfers (NTT) is using the NTT CLI. As prerequisites, ensure you have the following installed: -- Install [Foundry](https://book.getfoundry.sh/getting-started/installation){target=\_blank} - Install [Bun](https://bun.sh/){target=\_blank} -Install the NTT CLI: +Follow these steps to install the NTT CLI: -```bash -curl -fsSL https://raw.githubusercontent.com/wormhole-foundation/native-token-transfers/main/cli/install.sh | bash -``` +1. Run the installation command in your terminal: -Verify the NTT CLI is installed: + ```bash + curl -fsSL https://raw.githubusercontent.com/wormhole-foundation/native-token-transfers/main/cli/install.sh | bash + ``` -```bash -ntt --version -``` +2. Verify the NTT CLI is installed: + + ```bash + ntt --version + ``` + +3. Once installed, check out the available [NTT CLI Commands](/docs/build/transfers/native-token-transfers/cli-commands/){target=\_blank} to start using the CLI -### Updating +## Update NTT CLI -To update an existing NTT CLI installation, run: +To update an existing NTT CLI installation, run the following command in your terminal: ```bash ntt update ``` -!!! note - NTT CLI installations and updates will always pick up the latest tag with name vX.Y.Z+cli and verify that the underlying commit is included in main. +NTT CLI installations and updates will always pick up the latest tag with name vX.Y.Z+cli and verify that the underlying commit is included in main. For local development, you can update your CLI version from a specific branch or install from a local path. @@ -53,3 +55,26 @@ ntt update --path path/to/ntt/repo ``` Git branch and local installations enable a fast iteration loop as changes to the CLI code will immediately be reflected in the running binary without having to run any build steps. + +## Where to Go Next + +
+ + +- :octicons-tools-16:{ .lg .middle } **Deploy to EVM Chains** + + --- + + Deploy and configure Wormhole’s Native Token Transfers (NTT) for EVM chains, including setup, token compatibility, mint/burn modes, and CLI usage. + + [:custom-arrow: Deploy NTT to EVM chains](/docs/build/transfers/native-token-transfers/deployment-process/deploy-to-evm/) + +- :octicons-tools-16:{ .lg .middle } **Deploy to Solana** + + --- + + Deploy and configure Wormhole's Native Token Transfers (NTT) for Solana, including setup, token compatibility, mint/burn modes, and CLI usage. + + [:custom-arrow: Deploy NTT to Solana](/docs/build/transfers/native-token-transfers/deployment-process/deploy-to-solana/) + +
diff --git a/build/transfers/native-token-transfers/deployment-process/post-deployment.md b/build/transfers/native-token-transfers/deployment-process/post-deployment.md index 6fd1b847..678cdf8d 100644 --- a/build/transfers/native-token-transfers/deployment-process/post-deployment.md +++ b/build/transfers/native-token-transfers/deployment-process/post-deployment.md @@ -3,20 +3,26 @@ title: Native Token Transfers Post Deployment description: Learn post-deployment guidelines for optimizing Wormhole NTT, which include testing, security, frontend integration, ecosystem coordination, and monitoring. --- -# Native Token Transfers (NTT) Post Deployment +# Native Token Transfers Post Deployment -## Post Deployment Recommendations - -To offer the best user experience and ensure the most robust deployment, Wormhole contributors recommend the following after you have deployed NTT: +To offer the best user experience and ensure the most robust deployment, Wormhole contributors recommend the following after you have deployed Native Token Transfers (NTT): - Implement a robust testing plan for your multichain token before launching -- Ensure comprehensive, documented security measures are followed regarding custody of contract ownership, control of keys, and access control roles. Check the [NTT configuration](/docs/build/transfers/native-token-transfers/configuration/){target=\_blank} for more details on ownership and rate limits -- Consider a streamlined, customizable frontend such as [Wormhole Connect](https://connect-in-style.wormhole.com/){target=\_blank} for an optimized user experience -- Alternatively the [Wormhole SDK](/docs/build/toolkit/typescript-sdk/){target=\_blank} allows for a direct integration into your infrastructure -- Ensure ecosystem actors such as block explorers, automated security tools (such as BlockAid and Blowfish), wallets (such as MetaMask, Backpack, and Phantom) are aware of your multichain deployment and that it is labeled appropriately +- Ensure comprehensive, documented security measures are followed for custody of contract ownership, control of keys, and access control roles. Check the [NTT configuration](/docs/build/transfers/native-token-transfers/configuration/){target=\_blank} for more details on ownership and rate limits +- Consider a streamlined, customizable frontend such as [Wormhole Connect](/docs/build/transfers/connect/){target=\_blank} for an optimized user experience +- Alternatively, the [Wormhole TypeScript SDK](/docs/build/toolkit/typescript-sdk/){target=\_blank} allows for a direct integration into your infrastructure +- Ensure ecosystem actors such as block explorers, automated security tools (such as BlockAid and Blowfish), and wallets (such as MetaMask, Backpack, and Phantom) are aware of your multichain deployment and that it is labeled appropriately - Monitor and maintain your multichain deployment -## Post Deployment Integration Demos +## Manual Relaying for Solana Transfers + +By default, NTT transfers to Solana require manual relaying, meaning that after initiating a cross-chain transfer, the recipient must submit an on-chain transaction to claim the tokens. + +This step ensures that tokens are properly minted or unlocked on Solana and prevents unauthorized claims. + +[Wormhole Connect](/docs/build/applications/connect/){target=\_blank} support this process automatically. + +## Where to Go Next
diff --git a/llms.txt b/llms.txt index 47d64226..af498861 100644 --- a/llms.txt +++ b/llms.txt @@ -11926,12 +11926,13 @@ description: A comprehensive guide to the Native Token Transfers (NTT) CLI, deta The NTT Command-Line Interface (CLI) is a powerful tool for managing native token transfers across multiple blockchain networks within the Wormhole ecosystem. This page provides a comprehensive list of available commands, their descriptions, and examples to help you interact with and configure the NTT system effectively. Whether initializing deployments, updating configurations, or working with specific chains, the NTT CLI simplifies these operations through its intuitive commands. +If you haven't installed the NTT CLI yet, follow the [NTT Installation Guide](/docs/build/transfers/native-token-transfers/deployment-process/installation/#installation){target=\_blank} to set it up before proceeding. + ## Table of Commands The following table lists the available NTT CLI commands, descriptions, and examples. -!!! note - To explore detailed information about any NTT CLI command, including its options and examples, you can append `--help` to the command. This will display a comprehensive guide for the specific command. +To explore detailed information about any NTT CLI command, including its options and examples, you can append `--help` to the command. This will display a comprehensive guide for the specific command. ### General Commands @@ -11962,6 +11963,29 @@ The following table lists the available NTT CLI commands, descriptions, and exam | `ntt solana key-base58 ` | print private key in base58 | `ntt solana key-base58 /path/to/keypair.json`| | `ntt solana token-authority ` | print the token authority address for a given program ID| `ntt solana token-authority Sol1234...`| | `ntt solana ata `| print the token authority address for a given program ID| `ntt solana ata Mint123... Owner123... token22`| + +## Where to Go Next + +
+ + +- :octicons-gear-16:{ .lg .middle } **Configure NTT** + + --- + + Find information on configuring NTT, including guidance on setting Owner and Pauser access control roles and management of rate-limiting. + + [:custom-arrow: Configure your NTT deployment](/docs/build/transfers/native-token-transfers/configuration/) + +- :octicons-question-16:{ .lg .middle } **NTT FAQs** + + --- + + Frequently asked questions about Wormhole Native Token Transfers, including cross-chain lending, SDK usage, custom RPCs, and integration challenges. + + [:custom-arrow: Check out the FAQs](/docs/build/transfers/native-token-transfers/faqs/) + +
--- END CONTENT --- Doc-Content: https://wormhole.com/docs/build/transfers/native-token-transfers/configuration/access-control/ @@ -12332,201 +12356,262 @@ Doc-Content: https://wormhole.com/docs/build/transfers/native-token-transfers/de --- BEGIN CONTENT --- --- title: Native Token Transfers Solana Deployment -description: Deploy and configure Wormhole’s Native Token Transfers (NTT) for Solana, including setup, token compatibility, mint/burn modes, and CLI usage. +description: Deploy and configure Wormhole's Native Token Transfers (NTT) for Solana, including setup, token compatibility, mint/burn modes, and CLI usage. --- -# Native Token Transfers (NTT) Solana Deployment +# Deploy Native Token Transfers on Solana -## Install Dependencies +[Native Token Transfers (NTT)](/docs/learn/transfers/native-token-transfers/overview/){target=\_blank} enable seamless multichain transfers of SPL tokens on Solana using Wormhole's messaging protocol. Instead of creating wrapped tokens, NTT allows native assets to move across chains while maintaining their original properties. -Ensure you have the following dependencies installed: +This guide walks you through deploying NTT on Solana, including setting up dependencies, configuring token compatibility, and using the NTT CLI to deploy in hub-and-spoke or burn-and-mint mode. + +By the end, a fully deployed NTT will be set up, allowing your token to transfer between Solana and other supported chains. + +## Prerequisites + +Before deploying NTT on Solana, ensure you have the following: - [Rust](https://www.rust-lang.org/tools/install){target=\_blank} - [Solana](https://docs.solanalabs.com/cli/install){target=\_blank} **`{{ ntt.solana_cli_version }}`** - [Anchor](https://www.anchor-lang.com/docs/installation){target=\_blank} **`{{ ntt.anchor_version }}`** -!!!Warning - Ensure you are using the above versions of Solana and Anchor. Running the deployment with a different version may cause issues. +Use the Solana and Anchor versions listed above to avoid compatibility issues while following this guide. -## Deploy NTT +## Overview of the Deployment Process -Create a new NTT project (or use an existing NTT project): +Deploying NTT with the CLI on Solana follows a structured process: -```bash -ntt new my-ntt-deployment -cd my-ntt-deployment -``` +1. **Choose your token setup**: -Initialize a new `deployment.json` file specifying the network: + - **Use an existing SPL token** - if your token is already deployed on Solana, you can skip token creation and move directly to the [Set Up NTT](#set-up-ntt) section + - **Create a new SPL token** - if you don't already have an SPL token deployed, you'll need to deploy and configure it on Solana before integrating with Wormhole's NTT -=== "Testnet" +2. **Choose your [deployment model](/docs/learn/transfers/native-token-transfers/deployment/){target=\_blank}**: - ```bash - ntt init Testnet - ``` + - **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 SPL token's minting authority to the Program Derived Address (PDA) controlled by the NTT program -=== "Mainnet" +3. **Deploy and configure NTT** - use the NTT CLI to initialize and deploy the NTT program, specifying your SPL token and deployment mode - ```bash - ntt init Mainnet - ``` -## Deploy Your Solana Token +Following this process, your token will fully integrate with NTT, enabling seamless transfers between Solana and other chains. + +By default, NTT transfers to Solana require manual [relaying](/docs/learn/infrastructure/relayer/){target=\_blank}, meaning users must complete a transaction on Solana to finalize the transfer. For automatic relaying, where transactions are completed without user intervention, additional setup is required. [Contact Wormhole contributors](https://forms.clickup.com/45049775/f/1aytxf-10244/JKYWRUQ70AUI99F32Q){target=\_blank} to enable automatic relaying support for your deployment. + +## Create and Mint Tokens + +This section walks you through generating a Solana wallet, deploying an SPL token, creating a token account, and minting tokens. -???- interface "Deploy an SPL Token" +If you already have an SPL token, skip to [Set Up NTT](#set-up-ntt). + +1. **Generate a Solana key pair** - run the following command to create a new wallet: - 1. Generate a new Solana key pair to create a wallet: ```bash solana-keygen grind --starts-with w:1 --ignore-case ``` - 2. Set Solana configuration to use the new key pair created in step 1: +2. **Set Solana configuration** - configure the Solana CLI to use the generated key pair using the following command: + ```bash solana config set --keypair INSERT_PATH_TO_KEYPAIR_JSON ``` - 3. Set the Solana configuration to use the default RPC URL for Devnet: - ```bash - solana config set -ud - ``` +3. **Select an RPC URL** - configure Solana to use the appropriate network using one of the following commands: + + === "Mainnet" + ```bash + solana config set -um + ``` + + === "Testnet" + ```bash + solana config set -ut + ``` + + === "Devnet" + ```bash + 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: - 4. Request an airdrop of two SOL and check the balance: ```bash - solana airdrop 2 & solana balance + solana airdrop 2 + solana balance ``` - 5. Install or update the SPL Token CLI: +5. **Install SPL Token CLI** - install or update the required [CLI tool](https://spl.solana.com/token){target=\_blank} + ```bash cargo install spl-token-cli ``` - 6. Create a new token with the SPL Token CLI (make sure you have enough balance to pay for the transaction): +6. **Create a new SPL token** - initialize the token on Solana + ```bash spl-token create-token ``` - 7. Create a new account for the token created in step 6: +7. **Create a token account** - generate an account to hold the token + ```bash spl-token create-account INSERT_TOKEN_ADDRESS ``` - 8. Mint `1000` tokens to the created account: +8. **Mint tokens** - send 1000 tokens to the created account + ```bash spl-token mint INSERT_TOKEN_ADDRESS 1000 ``` -!!! note - NTT versions `>=v2.0.0+solana` support SPL tokens with transfer hooks. +NTT versions `>=v2.0.0+solana` support SPL tokens with [transfer hooks](https://spl.solana.com/transfer-hook-interface){target=\_blank}. + +## Set Up NTT -### Deployment Mode Requirements +To integrate your token with NTT on Solana, you must initialize the deployment and configure its parameters. This process sets up the required contracts and may generate key pairs if they don't exist. These key pairs are used to sign transactions and authorize actions within the NTT deployment. -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](/docs/learn/transfers/native-token-transfers/deployment/){target=\_blank} page. +The [NTT CLI](/docs/build/transfers/native-token-transfers/deployment-process/installation/){target=\_blank} manages deployments, configures settings, and interacts with the NTT system. Follow these steps to set up NTT using the CLI tool: -#### Hub-and-Spoke +1. **Create a new NTT project** - set up a deployment workspace + + ```bash + ntt new INSERT_PROJECT_NAME + cd INSERT_PROJECT_NAME + ``` -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](/docs/build/transfers/native-token-transfers/deployment-process/deploy-to-solana/#generate-ntt-program-key-pair) and [deploy the NTT program](/docs/build/transfers/native-token-transfers/deployment-process/deploy-to-solana/#__tabbed_2_2) directly. +2. **Initialize the deployment** - generate a `deployment.json` file with your deployment settings -#### Burn-and-Mint + === "Mainnet" -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. + ```bash + ntt init Mainnet + ``` -## Configuration and Deployment + === "Testnet" -### Generate NTT Program Key Pair + ```bash + ntt init Testnet + ``` + + === "Devnet" -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. + ```bash + ntt init Devnet + ``` -Generate a new NTT program key pair using: +### Set Mint Authority -```bash -solana-keygen grind --starts-with ntt:1 --ignore-case -``` +If you use burn-and-mint mode, follow these steps to enable the NTT program to mint tokens on Solana. This involves deriving the PDA as the token authority and updating the SPL token's minting permissions. -### Derive Token Authority +If you want to use hub-and-spoke, skip this section and proceed to [Deploy and Configure NTT](#deploy-and-configure-ntt). -In this step, you'll derive the token authority Program Derived Address (PDA) of the newly generated NTT program ID: +Before updating the mint authority, you must create metadata for your SPL token. You can visit this repository to see an example of [how to create metadata for your SPL token](https://github.com/wormhole-foundation/demo-metaplex-metadata/blob/main/src/token-metadata.ts){target=\_blank}. -```bash -ntt solana token-authority INSERT_YOUR_NTT_PROGRAM_KEY_PAIR -``` +Follow these steps to set the mint authority using the NTT CLI: -This script will output the derived PDA, which you will use in the next step. +1. **Generate an NTT program key pair** - create a unique key pair for the NTT program. The key pair must start with "ntt" to identify it as belonging to the NTT deployment -### Set SPL Token Mint Authority + ```bash + solana-keygen grind --starts-with ntt:1 --ignore-case + ``` -!!!Warning - You must create your token's metadata before delegating mint authority. [See an example on how to create metadata for your SPL token](https://github.com/wormhole-foundation/demo-metaplex-metadata){target=\_blank}. +2. **Derive the token authority** - generate the PDA, which will manage token minting -If deploying in `burning` mode, you'll set the SPL token mint authority to the newly generated token authority PDA: + ```bash + ntt solana token-authority INSERT_YOUR_NTT_PROGRAM_KEY_PAIR + ``` -```bash -spl-token authorize INSERT_TOKEN_ADDRESS mint INSERT_DERIVED_PDA -``` +3. **Set SPL token mint authority** - delegate minting control to the derived 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. + ```bash + spl-token authorize INSERT_TOKEN_ADDRESS mint INSERT_DERIVED_PDA + ``` +## Deploy and Configure NTT -### Deploy NTT +After setting up your deployment, finalize the configuration and deploy the NTT program on Solana by following these steps: -Generate or export your payer key pair, then run: +1. **Deploy NTT to Solana** - run the appropriate command based on your deployment mode: -=== "Burn-and-Mint" + === "Burn-and-Mint" + + ```bash + ntt add-chain Solana --latest --mode burning --token INSERT_TOKEN_ADDRESS --payer INSERT_YOUR_KEYPAIR_JSON --program-key INSERT_YOUR_NTT_PROGRAM_KEYPAIR_JSON + ``` + + === "Hub-and-Spoke" + + ```bash + ntt add-chain Solana --latest --mode locking --token INSERT_TOKEN_ADDRESS --payer INSERT_YOUR_KEYPAIR_JSON --program-key INSERT_YOUR_NTT_PROGRAM_KEYPAIR_JSON + ``` + + !!! tip + The `add-chain` command accepts an optional `--solana-priority-fee` flag, which sets the priority fee in microlamports. The default is `50000`. + +2. **Verify deployment status** - after deployment, check if your `deployment.json` file matches the on-chain configuration using the following command: ```bash - ntt add-chain Solana --latest --mode burning --token INSERT_TOKEN_ADDRESS --payer INSERT_YOUR_KEYPAIR_JSON --program-key INSERT_YOUR_NTT_PROGRAM_KEYPAIR_JSON + ntt status ``` -=== "Hub-and-Spoke" + If needed, sync your local configuration with the on-chain state: ```bash - ntt add-chain Solana --latest --mode locking --token INSERT_TOKEN_ADDRESS --payer INSERT_YOUR_KEYPAIR_JSON --program-key INSERT_YOUR_NTT_PROGRAM_KEYPAIR_JSON + ntt pull ``` -!!! note - The `add-chain` command accepts an optional `--solana-priority-fee` flag, which sets the priority fee in microlamports. The default is `50000`. +3. **Configure inbound and outbound rate limits** - by default, the inbound and outbound limits are set to `0` and must be updated before deployment. For EVM chains, values must be set using 18 decimals, while Solana uses nine decimals. -The NTT Solana program will then compile and deploy, returning the program ID. + Open your `deployment.json` file and adjust the values based on your use case: -!!! note - Refer to the [Solana docs](https://solana.com/docs/programs/deploying#program-buffer-accounts){target=\_blank} for failed deployments, which provide instructions on finding buffer accounts and closing them to reclaim allocated SOL. + ```json + "inbound": { + "Sepolia": "1000.000000000" // inbound limit from Sepolia to Solana + }, + "outbound": { + "Sepolia": "1000.000000000" // outbound limit from Solana to Sepolia + } + ``` -### Configure NTT +4. **Push the final deployment** - once rate limits are set, push the deployment to Solana using the specified key pair to cover gas fees -The NTT CLI takes inspiration from [git](https://git-scm.com/){target=\_blank}. You can run: + ```bash + ntt push --payer INSERT_YOUR_KEYPAIR_JSON + ``` -- `ntt status` - checks whether your `deployment.json` file is consistent with what is on-chain -- `ntt pull` - syncs your `deployment.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: +### Troubleshoot Deployment Issues + +If your deployment fails, it may be due to leftover program buffer accounts taking up storage on Solana. These temporary accounts are created during deployment but may persist if interrupted. Refer to the [Solana program deployment guide](https://solana.com/docs/programs/deploying#program-buffer-accounts){target=\_blank} for instructions on finding and closing these buffer accounts to free up space and allow redeployment. - For Solana, the limits are set with 9 decimal places: - ```json - "inbound": { - "Sepolia": "1000.000000000" // inbound limit from Sepolia to Solana - } - ``` +## Where to Go Next - For Sepolia (Ethereum Testnet), the limits are set with 18 decimal places: - ```json - "inbound": { - "Solana": "1000.000000000000000000" // inbound limit from Solana to Sepolia - } - ``` +
- This initial configuration ensures that the rate limits are correctly represented for each chain's token precision. +- :octicons-globe-16:{ .lg .middle } **Deploy NTT on EVM Chains** -### Deploy NTT to Solana + --- -You can now push the deployment to the Solana network, specifying the key pair that will cover the gas fees: + After deploying NTT on Solana, deploy and integrate it on EVM chains to enable seamless multichain transfers. -```bash -ntt push --payer INSERT_YOUR_KEYPAIR_JSON -``` + [:custom-arrow: Deploy NTT on EVM](/docs/build/transfers/native-token-transfers/deployment-process/deploy-to-evm/){target=\_blank} -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](https://forms.clickup.com/45049775/f/1aytxf-10244/JKYWRUQ70AUI99F32Q){target=\_blank} Wormhole contributors. +- :octicons-tools-16:{ .lg .middle } **Test Your Deployment** -!!!important - To proceed with testing and find integration examples, check out the [NTT Post Deployment](/docs/build/transfers/native-token-transfers/deployment-process/post-deployment/){target=\_blank} page. + --- + + Follow the NTT Post Deployment Guide for integration examples and testing instructions. + + [:custom-arrow: Test Your NTT deployment](/docs/build/transfers/native-token-transfers/deployment-process/post-deployment/){target=\_blank} + +- :octicons-tools-16:{ .lg .middle } **Add NTT to Your dApp** + + --- + + Configure Wormhole Connect, a plug-and-play bridging UI, to enable multichain transfers for your token. + + [:custom-arrow: Use Connect to Integrate NTT](/docs/build/transfers/connect/){target=\_blank} + +
--- END CONTENT --- Doc-Content: https://wormhole.com/docs/build/transfers/native-token-transfers/deployment-process/evm-launchpad/ @@ -12787,39 +12872,41 @@ description: Learn how to Install Wormhole’s Native Token Transfers (NTT) fram # Install the Native Token Transfers CLI -## Installation - -In this video, the Wormhole team walks you through installing the Native Token Transfers (NTT) CLI. You’ll see a practical demonstration of running commands, verifying your installation, and addressing common issues that might arise. If you prefer to follow written instructions or want a quick reference for each step, scroll down for the detailed installation guide. +In this video, the Wormhole team walks you through installing the [Native Token Transfers (NTT) CLI](https://github.com/wormhole-foundation/native-token-transfers/tree/main/cli){target=\_blank}. You’ll see a practical demonstration of running commands, verifying your installation, and addressing common issues that might arise. If you prefer to follow written instructions or want a quick reference for each step, scroll down for the detailed installation guide.
+## Install NTT CLI + The fastest way to deploy Native Token Transfers (NTT) is using the NTT CLI. As prerequisites, ensure you have the following installed: -- Install [Foundry](https://book.getfoundry.sh/getting-started/installation){target=\_blank} - Install [Bun](https://bun.sh/){target=\_blank} -Install the NTT CLI: +Follow these steps to install the NTT CLI: -```bash -curl -fsSL https://raw.githubusercontent.com/wormhole-foundation/native-token-transfers/main/cli/install.sh | bash -``` +1. Run the installation command in your terminal: -Verify the NTT CLI is installed: + ```bash + curl -fsSL https://raw.githubusercontent.com/wormhole-foundation/native-token-transfers/main/cli/install.sh | bash + ``` -```bash -ntt --version -``` +2. Verify the NTT CLI is installed: -### Updating + ```bash + ntt --version + ``` -To update an existing NTT CLI installation, run: +3. Once installed, check out the available [NTT CLI Commands](/docs/build/transfers/native-token-transfers/cli-commands/){target=\_blank} to start using the CLI + +## Update NTT CLI + +To update an existing NTT CLI installation, run the following command in your terminal: ```bash ntt update ``` -!!! note - NTT CLI installations and updates will always pick up the latest tag with name vX.Y.Z+cli and verify that the underlying commit is included in main. +NTT CLI installations and updates will always pick up the latest tag with name vX.Y.Z+cli and verify that the underlying commit is included in main. For local development, you can update your CLI version from a specific branch or install from a local path. @@ -12835,6 +12922,29 @@ ntt update --path path/to/ntt/repo ``` Git branch and local installations enable a fast iteration loop as changes to the CLI code will immediately be reflected in the running binary without having to run any build steps. + +## Where to Go Next + +
+ + +- :octicons-tools-16:{ .lg .middle } **Deploy to EVM Chains** + + --- + + Deploy and configure Wormhole’s Native Token Transfers (NTT) for EVM chains, including setup, token compatibility, mint/burn modes, and CLI usage. + + [:custom-arrow: Deploy NTT to EVM chains](/docs/build/transfers/native-token-transfers/deployment-process/deploy-to-evm/) + +- :octicons-tools-16:{ .lg .middle } **Deploy to Solana** + + --- + + Deploy and configure Wormhole's Native Token Transfers (NTT) for Solana, including setup, token compatibility, mint/burn modes, and CLI usage. + + [:custom-arrow: Deploy NTT to Solana](/docs/build/transfers/native-token-transfers/deployment-process/deploy-to-solana/) + +
--- END CONTENT --- Doc-Content: https://wormhole.com/docs/build/transfers/native-token-transfers/deployment-process/post-deployment/ @@ -12844,20 +12954,26 @@ title: Native Token Transfers Post Deployment description: Learn post-deployment guidelines for optimizing Wormhole NTT, which include testing, security, frontend integration, ecosystem coordination, and monitoring. --- -# Native Token Transfers (NTT) Post Deployment - -## Post Deployment Recommendations +# Native Token Transfers Post Deployment -To offer the best user experience and ensure the most robust deployment, Wormhole contributors recommend the following after you have deployed NTT: +To offer the best user experience and ensure the most robust deployment, Wormhole contributors recommend the following after you have deployed Native Token Transfers (NTT): - Implement a robust testing plan for your multichain token before launching -- Ensure comprehensive, documented security measures are followed regarding custody of contract ownership, control of keys, and access control roles. Check the [NTT configuration](/docs/build/transfers/native-token-transfers/configuration/){target=\_blank} for more details on ownership and rate limits -- Consider a streamlined, customizable frontend such as [Wormhole Connect](https://connect-in-style.wormhole.com/){target=\_blank} for an optimized user experience -- Alternatively the [Wormhole SDK](/docs/build/toolkit/typescript-sdk/){target=\_blank} allows for a direct integration into your infrastructure -- Ensure ecosystem actors such as block explorers, automated security tools (such as BlockAid and Blowfish), wallets (such as MetaMask, Backpack, and Phantom) are aware of your multichain deployment and that it is labeled appropriately +- Ensure comprehensive, documented security measures are followed for custody of contract ownership, control of keys, and access control roles. Check the [NTT configuration](/docs/build/transfers/native-token-transfers/configuration/){target=\_blank} for more details on ownership and rate limits +- Consider a streamlined, customizable frontend such as [Wormhole Connect](/docs/build/transfers/connect/){target=\_blank} for an optimized user experience +- Alternatively, the [Wormhole TypeScript SDK](/docs/build/toolkit/typescript-sdk/){target=\_blank} allows for a direct integration into your infrastructure +- Ensure ecosystem actors such as block explorers, automated security tools (such as BlockAid and Blowfish), and wallets (such as MetaMask, Backpack, and Phantom) are aware of your multichain deployment and that it is labeled appropriately - Monitor and maintain your multichain deployment -## Post Deployment Integration Demos +## Manual Relaying for Solana Transfers + +By default, NTT transfers to Solana require manual relaying, meaning that after initiating a cross-chain transfer, the recipient must submit an on-chain transaction to claim the tokens. + +This step ensures that tokens are properly minted or unlocked on Solana and prevents unauthorized claims. + +[Wormhole Connect](/docs/build/applications/connect/){target=\_blank} support this process automatically. + +## Where to Go Next