NFTs on Solana
How do NFTs work on Solana?
Solana NFTs use the Metaplex Standard to add metadata information to regular SPL Tokens.
SPL stands for Solana Program Library, which is a collection of on-chain programs that interact with the Solana blockchain.
You can think of SPL Tokens as equivalent to Ethereum's ERC-20 tokens. The Metaplex protocol is responsible for adjoining extra data onto these ERC-20-like tokens, effectively making them NFTs. If their max supply is set to 1, then it can be seen as an ERC-721 token. For higher or unlimited supplies the NFT can be compared to an ERC-1155 token. But in the end, they're the same thing!
What do I need in order to mint an NFT?
A Cryptum API key is the only requirement to create your brand new NFT for Solana. However, you probably want to add images, titles, symbols, attributes, etc. to your token. This information should be hosted in a service like Pinata or arweave, and not on the token itself.
For this example, we'll suppose you already managed to upload a JSON object to Pinata according to the Metaplex standard:
Field | Type | Description |
---|---|---|
name | string | Name of the asset. |
symbol | string | Symbol of the asset. |
uri | string | URI to the external JSON representing the asset |
creators | array | public key of each creator |
update_authority | string | public key of the metadata owner |
primary_sale_happened | boolean | flag describing whether the primary sale of the token happened |
seller_fee_basis_points | number | royalties percentage awarded to creators |
description | string | Description of the asset. |
image | string | URI pointing to asset image. |
animation_url | string | URI pointing to asset animation. |
external_url | string | URI pointing to an external url defining the asset, the game's main site, etc. |
attributes | array | Array of attributes defining the characteristics of the asset. |
Make sure to check the latest specifications in the official Metaplex documentation here.
Creating NFTs Programmatically with Cryptum SDK
Step 1
The first prerequisite you will need is the creation of an account and a Project (API Key) on Cryptum Dashboard.
PS: Our dashboard is almost ready! To generate an API Key, contact hello@blockforce.in
Step 2
With a valid Cryptum API Key, you can then instantiate the SDK as follows:
Step 3
Towned to create the NFTs:
Make sure the wallet has sufficient funds to pay for the transactions.
Step 4
Call sdk.nft.create
function passing your wallet, the desired supply, and the URI to create NFT with limited supply and a master edition.
name
is the token name;
symbol
is the token symbol;
uri
is the metadata URI;
maxSupply
is the maximum supply for this NFT (0 for unlimited; 1 for unique; 2 or more for multiple editions). Required if you want to create a master edition and copies with limited supply;
amount
is the NFT amount to be first minted. Required only if maxSupply
is 0 or undefined;
creators
is an optional parameter which consists of an array of creator information;
royaltiesFee
is an optional parameter which represents a fee in percentage;
collection
is an optional collection address;
To create NFT without limited supply and master edition do this:
There you go! The hash
variable now holds the token address, which you can inspect in an explorer such as this one or this other one.
Minting NFTs
To mint more NFTs on Solana you have to pass the wallet with the token's mint authority, the token address, destination address and the amount.
The amount
must be 1 or null
if this NFT has a master edition.
Transferring NFTs
To transfer NFTs in Solana, just pass the token address, token address, the destination address and the amount:
Burning NFTs
To burn NFTs on Solana you have to pass the wallet that owns the NFT, the token address and the amount:
If you want to check the full Solana NFTs doc, go to:
Last updated