When it comes to NFT development, Solana offers some great tools. For example, with Metaplex’s Candy Machine, you can create NFTs on Solana in minutes! In turn, using that alternative presents one of the easiest ways to create non-fungible tokens on the Solana network. If you’d like to explore this process, read on! In addition to easily creating NFTs on Solana, we’ll look at how Moralis – the ultimate Web3 API provider – can advance your development endeavors further. After all, Moralis’ enterprise-grade NFT API makes utilizing NFTs for any project as straightforward as it gets!
Since many are unfamiliar with what NFTs are and how they work, we will begin this article by covering some basics. Accordingly, you’ll have a chance to learn what NFTs and Solana are moving forward. We’ll also explain why this chain offers the easiest way to create NFTs and why it is an excellent network for NFT projects. Then, we’ll focus on a step-by-step tutorial demonstrating the easiest way to create NFTs on Solana. Consequently, you’ll learn how to use Candy Machine v2 to mint non-fungible tokens on Solana. Of course, if you already have the basics under your belt, feel free to dive straight into today’s tutorial. Moreover, if you want to create dapps that utilize NFTs easily, make sure to create your free Moralis account.
What is an NFT?
An NFT, or non-fungible token, is a unique crypto asset. For one, as “non-fungible” suggests, every NFT is unique, and its on-chain “signature” is one of a kind. This property makes NFTs great for representing digital art, digital collectibles, certificates, proofs of ownership, online ticketing, etc. It’s important to point out that NFTs are way more than just images. Sure, currently, there are many “meaningless” NFT projects trying to exploit the popularity of this new crypto asset type. However, you should know that the images you see are just a tiny part of NFTs. The real value of NFTs hides on the backend in their cryptographic uniqueness.
Files that NFTs represent can come in all sorts of forms, such as JPEGs, PNGs, MP3s, MP4s, PDFs, etc. While the files assigned to NFTs tend to be the most tangible parts of NFTs, they are just files. Moreover, like any other digital files, you can copy them. Accordingly, the real value of NFTs lies in their cryptographic IDs, which no one can copy. Hence, even if two NFTs include the same file, their on-chain data is still unique.
It’s also worth pointing out that the above-listed file types are too large to be stored on blockchains. As such, ideally, these files are stored using decentralized storage solutions. Then, the links to these files are included in the NFT metadata, which is stored on-chain. Further, the process of storing the NFT metadata under unique cryptographic IDs is known as “NFT minting”. So, whenever you want to mint an NFT, you must execute an on-chain transaction. Moreover, the details that NFT metadata includes can vary depending on the NFT standard. Also, certain metadata details are mandatory, while others are optional.
What is Solana, and Why Use it to Create NFTs?
Solana is a wildly popular non-EVM blockchain that is programmable. Being non-compatible with EVM means that Solana doesn’t use the same tools as Ethereum. Of course, this applies to development tools; however, it’s also the case for essentials, such as crypto wallets. Consequently, you can’t use MetaMask with Solana. Furthermore, Solana also has its own variation of smart contracts known as “programs”. However, Solana programs serve the same purpose as Ethereum smart contracts. They ensure that things run according to predefined rules. After all, Solana programs execute predefined actions when predefined conditions are met.
Why are Solana programs important when it comes to NFTs? Well, they are one of the Solana NFT mint tools. Moreover, unlike EVM standards, where ERC-721 and ERC-1155 NFTs are the norms, Solana’s SPL token standard governs fungible and non-fungible tokens. Hence, Solana NFTs are non-fungible SPL tokens on the Solana chain. To learn more about Solana and SPL tokens, check out the “What is Solana?” and “SPL vs ERC-20 Tokens” articles.
The two main reasons why Solana is highly popular for NFT projects are the Solana network’s high speed and low transaction fees. However, Metaplex is also a contributing factor. After all, it’s this tool that offers the easiest way to create NFTs on Solana.
What is Metaplex?
In short, Metaplex is a popular NFT ecosystem for marketplaces, arts, collectibles, and games. The Metaplex protocol provides standards and tools to support NFT development. Moreover, one of Metaplex’s leading solutions is to enable developers to create NFTs on Solana in a decentralized manner. Hence, Metaplex is a sort of combo of smart contracts and tools to offer the easiest way to create NFTs. Additionally, the two leading tools are Metaplex Storefront and NFT Candy Machine, and it’s the latter that we’ll be using moving forward.
How to Easily Create NFTs on Solana
In this section, we’ll show you how to create NFTs on Solana using Metaplex’s NFT Candy Machine, as this tool presents the easiest way to create NFTs on the Solana chain. To start, we’ll show you how to complete the initial Candy Machine v2 setup.
Note: You can access our code on GitHub. Plus, you can find a video tutorial at the end of this article, which contains additional details.
Setting Up Candy Machine V2
The easiest way to create NFTs requires some tools. These include NodeJS, Git, “yarn” (a package manager), and TS-node. NodeJS will serve as a JavaScript runtime. With Git, you’ll be able to clone our repository, and you’ll use “yarn” to install the required dependencies. Nonetheless, the TypeScript node (TS-node) will serve as an execution environment.
Note: If you are working with an Apple M1 chip, you must install additional dependencies. As such, use the following command: “brew install pkg-config cairo pango libpng jpeg giflib librsvg”.
After setting the above-listed tools in place, you need to clone and install Metaplex. Hence, use the “GitHub” link above and clone our code now:
Create Your Solana Wallet
Executing on-chain transactions to mint NFTs are a must. As such, you need a Solana wallet with a sufficient amount of SOL coins. The latter is Solana’s native cryptocurrency, and you need it to cover transaction fees. Fortunately, you can use the Solana tool suite to create a local wallet without breaking a sweat.
Note: Local wallets are not always safe and should not be used for storing cryptocurrencies for purposes other than development.
You can interact with your local Solana wallet by using the following commands in their respective order:
solana –version
solana address
solana balance
Note: If you don’t have your Solana address yet, consider setting up your new devnet wallet. For detailed instructions on how to do that, refer to Metaplex’s documentation.
Continuing forward, we’ll focus on minting example NFTs on the Solana devnet. Hence, you won’t need real SOL tokens. Instead, you’ll work with “test” SOL, and you can get two test SOL for free using the “solana airdrop 2” command. However, once you decide to use your NFT Candy Machine on the Solana mainnet, you will need real SOL.
Configure Your Candy Machine
After successfully creating your Solana wallet and topping it with two test SOL tokens, it’s time to open the above-cloned project. Start by locating the “example-candy-machine-upload-config.json” file:
Moreover, you can follow our lead and use Arweave to store NFT files. However, you can choose from several other options; Arweave is just one of the specific configurations of the easiest way to create NFTs. For more details, check out the video below (4:39).
Prepare NFT Images and Metadata to Create NFTs on Solana
As indicated earlier, even when you use the easiest way to create NFTs, you still need NFT files and metadata. If you have the knowledge and the skills, feel free to prepare these files yourself. However, since creating image files and metadata is not the point of this tutorial, you can use our example assets:
The above screenshot displays ten pairs of files inside the “example-assets” folder. Furthermore, JSON files are each NFT’s metadata, while PNG files are the images that will represent our example NFTs. So, using our example files, you can mint ten Solana NFT tokens.
In addition, by looking at the right side of the above screenshot, you can see the details of one of the ten JSON files. If you want to learn more about the NFT files and metadata, use the video below (7:52). Moreover, that part of the video also demonstrates how to verify your assets (an optional step).
Upload Your NFT Files and Metadata
To upload your NFT files and metadata, you’ll use the “upload” command (video below at 12:27). This command ensures that your images and JSON files get uploaded to the above-selected decentralized storage solution. Essentially, you can just copy the command lines provided by the Metaplex documentation. Of course, you need to edit the paths to match your project:
The above command line will deploy your instance of Candy Machine on the Solana devnet and upload all the assets.
Create Your NFT Collection
At this point, you have everything ready to create your example NFT collection on Solana. Moreover, just like in the previous step, you get to copy a specific command line from the Metaplex docs (15:35). Do not forget to tweak it to match your project’s path:
The “Candy Machine Collection” command will prepare a collection for your NFTs. As such, you’ll have a chance to assign your NFTs to this collection in the minting step.
Verifying Assets Upload
Verifying assets upload is not mandatory. However, since this step helps you ensure all of your assets upload properly, we recommend completing it:
You can find more details regarding the “verify assets upload” step in the video below (17:23) or by visiting the Metaplex docs.
The Easiest Way to Create NFTs on Solana – Time to Mint
All of the above steps lead to this point, where you actually get to create NFTs on Solana. You can find all the details about the minting process in the video below (18:18). Thanks to Metaplex, this is, in our opinion, the easiest way to create NFTs. After all, you only need to copy the required command from the Metaplex documentation and tweak it to match your file paths.
Moreover, it’s worth pointing out that you have two options when it comes to minting NFTs with Metaplex. You can mint Solana NFTs individually or execute batch or bulk minting. If you choose the latter, you can mint multiple NFTs in a single transaction.
Nonetheless, once you successfully mint your NFTs, you can view them in the Solana explorer (devnet):
Last but not least, below is the video that we’ve been referencing in the sections above.
Last but not least, below is the video that we’ve been referencing in the sections above. After successfully minting NFT, our in-house Solana expert demonstrates how to use Moralis to build a Solana dashboard (24:35). However, he is using some Moralis features that were a part of Moralis 1.0 but are not available in Moralis 2.0. So, as an alternative, we encourage you to use our “NFT Gated Website” tutorial and try to tweak the code to match the Solana devnet.
The Easiest Way to Create NFTs on Solana – Summary
In today’s article, you had a chance to learn about the easiest way to create NFTs. We first explained the basics, where you learned what NFTs and their main components are. We also ensured you know what Solana is and why it is a popular network for creating NFTs. As such, you found out that its speed, low gas fees, and some excellent tools are the main reasons why NFT developers explore Solana. Furthermore, this is where you learned that Metaplex’s Candy Machine is the tool that makes creating NFTs on Solana relatively simple. Last but not least, you had an opportunity to follow our lead and create your own example NFTs on Solana devnet.
Whether you want to dive deeper into Solana development or explore NFT development on other chains, the Moralis YouTube channel, and the Moralis blog are the outlets to explore. These are the platforms that support your free and continued crypto education. For instance, some of our latest topics focus on cross-chain bridging, programming smart contracts on Solana, uploading files to IPFS, minting a coin on Solana, and much more.
On the other hand, you may also take a more professional approach to your blockchain development education. In that case, enrolling in Moralis Academy might be the right path for you. Moreover, if you want to become a Solana programmer, start with the “Solana Programming 101” course.
Read More: moralis.io