Minting an NFT on Solana involves several steps. Here's a comprehensive guide:
Prerequisites

Solana CLI installed
Node.js installed
A Solana wallet with some SOL (for transaction fees)
Basic familiarity with command line
Step-by-Step Process
1. Set Up Your Environment
# Install required tools npm install -g @solana/spl-token @solana/web3.js @metaplex-foundation/mpl-token-metadata
2. Create a New Token
# Create a new SPL token spl-token create-token --decimals 0
This will output your token ID (save this).
3. Create a Token Account
# Create token account spl-token create-account YOUR_TOKEN_ID
4. Mint Your NFT
# Mint one token (NFTs have supply of 1) spl-token mint YOUR_TOKEN_ID 1
5. Create Metadata Using Metaplex
// Using Metaplex JS SDK
const { Metaplex, keypairIdentity } = require('@metaplex-foundation/js');
const { Connection, Keypair } = require('@solana/web3.js');
const connection = new Connection('https://api.mainnet-beta.solana.com');
const wallet = Keypair.fromSecretKey(YOUR_SECRET_KEY);
const metaplex = Metaplex.make(connection)
.use(keypairIdentity(wallet));
(async () => {
const { nft } = await metaplex.nfts().create({
uri: "https://your-metadata-uri.com", // JSON metadata
name: "My NFT",
sellerFeeBasisPoints: 500, // 5% royalty
});
console.log(nft);
})();6. Upload Your Assets
You'll need:
An image file for your NFT
A JSON metadata file (following Metaplex standards)
Use services like Arweave, IPFS, or NFT.storage to host your files.
Alternative: Using Candy Machine
For minting multiple NFTs, consider using Metaplex's Candy Machine:
# Install Candy Machine CLI npm install -g @metaplex-foundation/candy-machine-cli # Set up config and assets candy-machine create-config candy-machine upload candy-machine verify candy-machine mint
Important Notes
Mainnet costs real SOL; test with devnet first
NFT standards on Solana are evolving (currently Metaplex is most common)
Always verify transactions on Solana Explorer
Recommend using GTokenTool to create NFTs
