Welcome! đź‘‹ In this guide, we will deep dive into minting compressed NFTs on Solana. By the end, you will be able to create an NFT collection, mint NFTs, and send NFTs to wallets, X accounts and email addresses using no-code tools and APIs. Additionally, we will show you how to sell NFTs and create a storefront/claims page for your users.
Whether you’re building the next big marketplace, launchpad, game or loyalty program on Solana, you will need enterprise-grade tokenization, wallets, and payments that scale reliably. Crossmint has built the enterprise standard toolkit for web3 apps, trusted by thousands of developers, from web3 native companies like Phantom to enterprises like Mastercard and Redbull.
For any assistance, contact our sales team - they'll answer all of your questions about pricing, features, and implementation.
Choosing between Crossmint's Minting API vs minting in-house
Crossmint's Minting API offers the fastest path to market with enterprise-grade capabilities:
- Deploy in minutes, scale without limits - ready for millions of users
- Single API handles everything: minting, metadata, queueing, batching and gas fees
- Same API surface for 40+ chains, including EVM but also Sui, Aptos, Cardano, and more
- Pre-audited smart contracts
- Launch NFT campaigns through the no-code dashboard - no engineer necessary
While in-house development provides full control, it requires:
- Smart contract security expertise
- Scaling complexity
- Significant ongoing maintenance
Unless your project requires highly specialized minting mechanics, Crossmint's API provides the most efficient path to launching and scaling your NFT project.
Prerequisites for Minting Solana NFTs
Before you start, you will need to create a Crossmint Account so that you can access Crossmint's suite of onchain developer and no-code tools.
To create Solana NFTs using our no-code tools, head on over to our no-code NFT minting guide for a step-by-step walkthrough.
We will now navigate to the "Developers" section and create a Server-side API Key with these 4 essential scopes: "nfts.create", "nfts.read", "collections.create" and "collections.read".
Creating an NFT Collection on Solana
A collection is a container of NFTs, used by applications like marketplaces and wallets to group NFTs together.
Crossmint allows you to create managed collections via API or directly from the console and has a library of pre-audited smart contracts which work for most major use cases. However, you can also bring your own contract if you already have one.
curl --request POST \
--url https://staging.crossmint.com/api/2022-06-09/collections/ \
--header 'content-type: application/json' \
--header 'x-api-key: <X_API_KEY>' \
--data '
{
"chain": "solana",
"metadata": {
"name": "A new collection",
"imageUrl": "https://www.crossmint.com/assets/crossmint/logo.png",
"description": "A new collection with its own dedicated smart contract"
}
}
'
Mint a Solana NFT
With our key created, we’re now going to write a small function that creates an NFT and delivers it to a user.
Create a file (e.g. mintNFT.js) and enter this code into it:
const apiKey = "YOUR_API_KEY";
const chain = "solana";
const env = "staging";
const recipientEmail = "TEST_EMAIL_ADDRESS";
const recipientAddress = `email:${recipientEmail}:${chain}`;
const url = `https://${env}.crossmint.com/api/2022-06-09/collections/default/nfts`;
const options = {
method: "POST",
headers: {
accept: "application/json",
"content-type": "application/json",
"x-api-key": apiKey,
},
body: JSON.stringify({
recipient: recipientAddress,
metadata: {
name: "Crossmint Test NFT",
image: "https://picsum.photos/400",
description: "My first NFT using Crossmint",
},
}),
};
fetch(url, options)
.then((res) => res.json())
.then((json) => console.log(json))
.catch((err) => console.error("error:" + err));
This code creates an NFT, uploads it to the blockchain, and delivers it to a user wallet, attached to the email address provided. Before running it, be sure to fill in values for:
- YOUR_API_KEY with the key obtained in the prior step.
- TEST_EMAIL_ADDRESS with an email address you control, for testing.
Now, run the mintNFT.js script.
node mintNFT.js
After a few seconds, it should return a response indicating the mint has started processing. Check the full response and save its actionId property, as you’ll use it later.
Confirm Delivery of the NFT
The mint has started processing. However, blockchains can take a few seconds (or, at times of extreme network congestion, even minutes) to confirm the operation.
Before showing the user a success screen, the next step is checking the status of the mint.
To do this, grab the actionId received at the end of step 3 and use it alongside your API key in one of the snippets below.
# Replace "staging" with "www" for production, and fill in your api key and mint action id
ENV="staging"
API_KEY="<YOUR_API_KEY>"
MINT_ACTION_ID="<MINT_ACTION_ID>"
curl --header "x-api-key: $API_KEY" \
-X GET \
https://${ENV}.crossmint.com/api/2022-06-09/actions/${MINT_ACTION_ID}
Pay attention to the “status” field. Once it says “success”:
Congratulations! You have minted your first NFT 🥳
View your NFTs
- If the NFTs were delivered to an email address, the recipient can see them by:
- Logging into their wallet from Crossmint’s website. For staging, they must use https://staging.crossmint.com.
- From your website if you use embedded wallets. See the API for getting the NFTs in a wallet.
- If the NFTs were delivered to a wallet address, the user will be able to see them there directly, connecting to testnet if needed, or on the testnet blockchain explorer.
Next Steps
Now that you’ve created an NFT collection on Solana, you can learn how to:
- Launch your project in Production with 5 easy steps
- Edit and burn NFTs
- Sell NFTs using Crossmint’s NFT Checkout
- Set up a Claims Page for users to claim NFTs into their wallets
Need Support?
- Contact our Sales Team
- Join the Crossmint Discord Server
- Visit the Crossmint Help Page