Solana - Mint and Transfer NFTs

Tatum mints Solana NFTs through the Metaplex protocol, so you deploy no contract; to transfer an NFT, use its nftAddress, not the nftAccountAddress.

NFTs over Solana work differently than other EVM (like Ethereum) chains. With most EVM chains, you need to deploy a smart contract from which you will mint NFTs.

However, Solana uses the Metaplex Protocol — a smart contract and metadata standard for creating and working with NFTs. Tatum’s API endpoints leverage the Metaplex protocol, and as a result, you do not need to deploy your own smart contract to mint NFTs.

When an NFT is minted on Solana, a new blockchain address is created to receive the NFT under the recipient's account address (the one in the to parameter of the request body). This token account is returned in the nftAccountAddress parameter in the response body. It is derived from the recipient's address and owned by it, has no private key of its own, and the recipient's private key controls it. The response body also returns the address of the minted NFT itself, which is held in the nftAddress parameter.

On Solana, the NFT's name, symbol, royalties and creators are stored on-chain in a Metaplex metadata account. The image, description and attributes live in an off-chain JSON file (the Metaplex token metadata standard), usually on IPFS or Arweave. Upload that JSON file first, then put its URL in the metadata.uri field of the Mint NFT API call.

How to Mint a Solana NFT

Available Request Body Schema:

  • MintNftExpressSolana
  • MintNftSolana
  • MintNftSolanaKMS

Request example:

curl --location --request POST 'https://api.tatum.io/v3/nft/mint/' \
--header 'x-api-key: {API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
   "from": "FykfMwA9WNShzPJbbb9DNXsfgDgS3XZzWiFgrVXfWoPJ",
   "chain": "SOL",
   "fromPrivateKey": "####",
   "to": "FykfMwA9WNShzPJbbb9DNXsfgDgS3XZzWiFgrVXfWoPJ",
   "metadata": {
       "name": "Tatum API",
       "symbol": "TAPI",
       "sellerFeeBasisPoints": 10,
       "uri": "ipfs://bafybeidi7xixphrxar6humruz4mn6ul7nzmres7j4triakpfabiezll4ti",
   }
}'
//Response:
{
    "txId": "5GAwhRcMR7h5Dx71KCQax4CAcCFA6FcrVE5fwNedq7wXDYS1qpZaGd4Bj2zh8dCUfAz7fqVSXhdZzXRigsNoTZsb",
    "nftAddress": "7dQWANaodDyttJNz3seaXoAe6VA8cLpPV1bM4cPGuNhG",
    "nftAccountAddress": "3z2bPwKzfTAFDKPNKTM4vvffBSDvcBvkuRJeME5iALs3"
}

How to Transfer a Solana NFT

The way the Solana blockchain works with minting and transferring NFTs uses nftAccountAddresses. For practical use of Tatum’s API, this makes very little difference, but it is important to know that for transferring NFTs, the nftAddress of the NFT is used, NOT the nftAccountAddress.

Request example:

curl --request POST \
  --url https://api.tatum.io/v3/nft/transaction \
  --header 'content-type: application/json' \
  --header 'x-api-key: {API_KEY}' \
  --data '{
      "chain": "SOL",
      "from": "FykfMwA9WNShzPJbbb9DNXsfgDgS3XZzWiFgrVXfWoPJ",
      "to": "FykfMwA9WNShzPJbbb9DNXsfgDgS3XZzWiFgrVXfWoPJ",
      "contractAddress": "7dQWANaodDyttJNz3seaXoAe6VA8cLpPV1bM4cPGuNhG",
      "fromPrivateKey": "####"
}'
//Response:
{
    "txId": "c83f8818db43d9ba4accfe454aa44fc33123d47a4f89d47b314d6748eb0e9bc9"
}

Did this page help you?