How to Create NFT on Ethereum In Simple Steps

Building an NFT is an excellent opportunity to fund your project or take your business into a new stage. You can also be that artist looking for their big breakthrough and think NFT is your way out.

After all, It’s the chance to get into the public eye and generate interest from collectors that might think your work is valuable and useful.

But have you ever thought about the entire process behind NFTs?

This article gives you the two easiest ways to learn how to create NFT on Ethereum in simple steps. You’ll learn to do it using the biggest NFT marketplace – OpenSea – and use a web3 development tool called Alchemy.

Stay tuned because this will break the knowledge of your Ethereum foundation!

This article is a segment of a longer piece on creating an NFT token.

Prerequisites To Create an Ethereum NFT

The entire NFT creation process requires you to have all things already prepared. This way, you can mint your first NFT in minutes instead of hours or days.

Here are a few things you need to create an NFT on Ethereum:

Digital Art

Before you can even think about mint NFTs, you must create the art you will upload to the internet that will become a token.

Think about what you want to draft and share with the NFT community. To do that, you must consider certain aspects, such as:

  1. Value: NFT collections must be interesting for collectors. Whether participation, revaluation, or profit, they must know what they are getting into.
  2. Design: Creating NFTs doesn’t mean drafting a couple of lines in Paint and minting it. You must prepare a structure that resembles your brand, and you can later use it in an NFT collection. It must be significant and highly detailed.
  3. Unique: A valid NFT is one of a kind. You can’t replicate its attributes and properties. And that starts with the design. You must prepare something people can’t find anywhere else.

Set up Your MetaMask Wallet

The second factor you need to mint NFTs is a decentralized wallet that supports NFT storage. There are different crypto wallets in the market. Still, the best one so far is MetaMask.

This chrome-extension virtual wallet can store most cryptocurrencies and use different Mainnets – including the test network.

Here’s how you create a MetaMask account and unlock the wallet features:

  1. Enter MetaMask.io and download the Chrome extension.
  2. Wait until a new window opens and select “Get Started.”
  3. Click on “Create a New Wallet”
  4. Type a secure password to create your MetaMask private key. This is a unique private key you’ll use to sign transactions.
  5. Reveal and store your wallet’s seed phrase. Never share it without another person.
  6. Click on next to confirm your seed phrase by selecting the words you’re asked for.

After clicking continue, your decentralized MetaMask wallet will be available for use!

Find an NFT Marketplace

NFT marketplaces are where you sell NFTs. You must find reliable platforms to list your works at a good price if you want to make profits.

But how can you find a trustable non-fungible tokens marketplace to sell your NFT collections?

Here’s what to consider:

  1. Solid reputation: Find platforms that work with tons of transactions. It could also help you decide if you find groups and communities and ask for recommendations.
  2. Strong security: Consider using platforms that include two-factor authentications and encrypted storage.
  3. Intuitive interface: A clean and easy interface is key to finding, buying, and selling NFTs. That’s why platforms like OpenSea are so popular.
  4. Low transaction fees: Low fees are key to maximizing your profits. You should look for platforms that don’t have hidden fees.
  5. Diverse NFT selection: Only NFT marketplaces with multiple collections are good platforms. This means that other creators trust the website and are a source of numerous daily transactions.
  6. Large and active community: Finding other people with previous experience using the platform and who are engaged in social networks could give you an idea of how reliable a marketplace is.

After getting everything you need to start, all that’s left is choosing how to mint a new NFT. You can use an integrated feature from marketplaces such as the one OpenSea has or decide to craft it from scratch using Alchemy.

Let’s break this down.

How to Create NFTs on Ethereum Using OpenSea

Developing your own NFT using OpenSea is easier than you could expect. You only need to sync your MetaMask wallet into the platform and have enough coins to pay when you sign the NFT contract.

Here’s how it goes:

  1. Enter OpenSea and sync your wallet with the platform.
  2. Click the Profile Icon and select Create.
  3. You will now meet the Create Item section. Begin by adding the image, video, or 3D model you want to mint and an external link.
  4. Add the NFT’s metadata. Some of the attributes you add are properties, levels, and stats.
  5. Determine if it has unlockable content that only the owner can see.
  6. Mark if it’s explicit content.
  7. Establish the supply of NFTs you’ll mint.
  8. Select the blockchain network. MetaMask supports ETH, BNB, Polygon, and others.
  9. Click on Create.

This will take you to a new window to pay for the transaction. After that, you’ll successfully mint an NFT using OpenSea.

You can then list it or add another NFT minted to a collection.

How to Create NFTs On Ethereum With Alchemy

Minting NFTs using Alchemy and other standalone platforms isn’t as straightforward. It requires you to prepare nodes, smart contract functions, and their deployment until you unlock the function “mintnft.”

For this example, we’ll use the Goerli test network.

Let’s see how it goes:

Install Node & NPM

First, download the Node and NPM. Enter the local machine and check your node version using the command “node -v” in the NPM terminal.

Build an Alchemy App

Now that you have the main nodes and Javascript structure, enter the Alchemy platform, create an account – customize its use to NFT development – and find the dashboard. After that, follow these steps:

  1. Go to the Apps drop-down menu and select Create App
  2. Give it a name and description
  3. Select Ethereum Chain
  4. Choose Goerli Network, as this would be a testnet project
  5. Click Create App

You will get a green announcement to go to the Teams page.

Fund Your Wallet

The next step is to get money into your Metamask Wallet to pay for each platform. Here’s what you must do:

  1. Open the Metamask wallet, click where it says “Ethereum Mainnet,” and change it to the Goerli chain.
  2. Go to Alchemy’s Goerli Faucet, and sign in with the Alchemy account.
  3. Open Metamask and copy the Goerli address.
  4. Go to the input space that says “Enter Your Wallet Address…” and paste your address.
  5. Solve the captcha and click on “Send Me ETH.”

If everything goes well, you should receive 0.1 Goerli ETH to pay for transactions.

Create an Empty Node Project

A Node project will help you run, test, and deploy smart contracts. So, you need to create an empty node to prepare the environment for future work.

Access the command line with admin permits and paste this:

“mkdir my-nft && cd my-nftnpm init -y”

Install Hardhat, The Standard Ethereum Development Environment

After you have compiled the main frame for your smart contract, you can install the Hardhat development environment.

This will allow you to test new smart contracts locally before you launch them in the network.

Here’s what you need to do:

  1. Open the Node.js terminal and run the command:
“npm install –save-dev hardhatnpx hardhat”
  1. A welcome message will appear. After that, new options will show. Select Create a Javascript Project.
  2. Accept the default settings and install sample project dependencies.
  3. Run a hardtest using the command:
“npx hardhat test”
  1. Install the OpenZeppelin contracts package to gain access to ERC-721 materials and build your contract.
“npm install @openzeppelin/contracts”

Craft The Custom NFT Smart Contract

Creating smart contract instances consists of multiple factors.

  1. Open the project with an editor of your choice. It could be a language called Solidity, Brackets, or VSCode.
  2. Go to the Contracts folder and create a file called MyNFT.sol and include this code:
“// SPDX-License-Identifier: MITpragma solidity ^0.8.17;import “@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol”;import “@openzeppelin/contracts/utils/Counters.sol”;import “@openzeppelin/contracts/access/Ownable.sol”;contract MyNFT is ERC721URIStorage, Ownable {    using Counters for Counters.Counter;    Counters.Counter private _tokenIds;    constructor() ERC721(“MyNFT”, “NFT”) {}    function mintNFT(address recipient, string memory tokenURI)        public        onlyOwner        returns (uint256)    {        _tokenIds.increment();        uint256 newItemId = _tokenIds.current();        _mint(recipient, newItemId);        _setTokenURI(newItemId, tokenURI);        return newItemId;    }}”

What is this code telling you?

  • It gives you three smart contract classes, each with functions for different operations. This way, the contract transfers ownership or returns who is the current owner.
  • It provides two strings in the ERC721 constructor, “MyNFT” and “NFT.” The smart contract’s name is first, while the second represents its symbol. You can edit this whenever you want.
  • It has two strings required to mint the NFT. “Address Recipient” specifies the address that will receive the freshly minted NFT and “String Memory TokenURI,” a JSON document that includes all the NFT attributes.
  • The “mintNFT” function returns a unique ID representing the NFT. 

Sync Your Wallet & Alchemy

The wallet and the smart contract are mandatory for creating an NFT. So, you now have to connect the project with the two of them to pay for transactions.

That’s why you must create a dotenv package in the root directory, including the API Key and your wallet’s private key.

Here’s how you do it:

  1. Go to the terminal and install a dotenv package in the project directory with the following code:
“npm install dotenv –save”
  1. Open an env file and include the MetaMask password and the Alchemy API Key. You can find the last one in the platform’s dashboard. Click on Apps, select the project, and click “View Key.” It should look like this:
“API_URL = “https://eth-goerli.g.alchemy.com/v2/your-api-key”PRIVATE_KEY = “your-metamask-private-key”

Update hardhat.config.js

This configuration file has changed a lot. So, you must update it to make your contract creation work properly.

Hence, you must replace this environment file code with the following lines:

“require(“dotenv”).config();require(“@nomiclabs/hardhat-ethers”);const { API_URL, PRIVATE_KEY } = process.env;module.exports = {  solidity: “0.8.17”,  defaultNetwork: “goerli”,  networks: {    hardhat: {},    goerli: {      url: API_URL,      accounts: [`0x${PRIVATE_KEY}`],    },  },};”

Copy The Contract Deploy Script

It’s finally time to have your contract deployed. To do that, you must find Deploy.js in the Scripts section. Then, copy this code:

“async function main() {   // Grab the contract factory    const MyNFT = await ethers.getContractFactory(“MyNFT”);   // Start deployment, returning a promise that resolves to a contract object   const myNFT = await MyNFT.deploy(); // Instance of the contract    console.log(“Contract deployed to address:”, myNFT.address);}main()  .then(() => process.exit(0))  .catch(error => {    console.error(error);    process.exit(1);  });”

Deploying The Contract

After adding all the information, you can start the smart contract. Just go to the root directory, and in the command line, run:

“npx hardhat run scripts/deploy.js –network goerli”

If deployed successfully, you should receive the contract address in a text like:

“Contract deployed to address: Goerli Address” 

You now have the entire backend to mint NFTs. But how can you see it in the blockchain?

Add The Alchemy Provider And API Key

You will have to create a new file in the repository we’ve been using. Here’s what you must do:

  1. Go to the script folder and create a document called mint-nft.js.
  2. Include the following code:
“require(‘dotenv’).config();const ethers = require(‘ethers’);// Get Alchemy API Keyconst API_KEY = process.env.API_KEY;// Define an Alchemy Providerconst provider = new ethers.providers.AlchemyProvider(‘goerli’, API_KEY)”
  1. Go to the .env document and add the code line “API_KEY =.”

Add The Application Binary Interface (ABI)

Hardhat creates an ABI interface code line that interacts with the smart contract. You will have to fetch it using the code:

const contract = require(“../artifacts/contracts/MyNFT.sol/MyNFT.json”);”

If you want to check if the line is working, use the command “node scripts/mint-nft.js” in your terminal.

Create The NFT Attributes

The most important part of the NFT is giving it attributes. These are what makes them unique and non-fungible.

To do that, you could use the Pinata IPFS and toolkit technology. Here’s how it goes:

  1. Go to the Pinata website and create an account.
  2. Find the Upload button and prepare an image that represents your NFT. Name it how you wish.
  3. Wait until the hashcode appears and copy it.

You now have the NFT image created. But you still have to add more metadata.

  1. Go to the root directory and create a document called nft-metadata.json. Add this code:
“{    “attributes” : [ {      “trait_type”: “Breed”,      “value”: “Maltipoo”    }, {      “trait_type”: “Eye color”,      “value”: “Mocha”    } ], “description”: “The world’s most adorable and sensitive pup.”, “Image”: “https://gateway.pinata.cloud/ipfs/QmWmvTJmJU3pozR9ZHFmQC2DNDwi2XJtf3QGyYiiagFSWb”,    “name”: “Ramses”}”

You can change all the attributes to make your NFT unique. Just ensure you add the hashcode above in the “image” section. Otherwise, your asset won’t have a figure.

After you’ve finished, save the document and upload it to Pinata using the abovementioned method.

Create a Signer to Call the Contract Instances

We’re almost finished!

You must develop a signer with your Wallet’s key to activate the deployed contract. Just go to the mint-nft.js document and add this code:

“// Create a signerconst privateKey = process.env.PRIVATE_KEYconst signer = new ethers.Wallet(privateKey, provider)// Get contract ABI and addressconst abi = contract.abiconst contractAddress = ‘0xA4766Ceb9E84a71D282A4CED9fB8Fe93C49b2Ff7’// Create a contract instanceconst myNftContract = new ethers.Contract(contractAddress, abi, signer)”

Mint The NFT!

Once the previous steps are finally ready, you can create the stance that will call your NFT. Mintnft calls your asset by fetching all the information you’ve already provided.

  1. Go to Pinata and find the metadata.json hashcode.
  2. Copy the code in the section “Get the NFT Metadata IPFS URL.”

The final code must look like this:

“require(‘dotenv’).config();const ethers = require(‘ethers’);// Get Alchemy App URLconst API_KEY = process.env.API_KEY;// Define an Alchemy Providerconst provider = new ethers.providers.AlchemyProvider(‘goerli’, API_KEY)// Get contract ABI fileconst contract = require(“../artifacts/contracts/MyNFT.sol/MyNFT.json”);// Create a signerconst privateKey = process.env.PRIVATE_KEYconst signer = new ethers.Wallet(privateKey, provider)// Get contract ABI and addressconst abi = contract.abiconst contractAddress = ‘0xA4766Ceb9E84a71D282A4CED9fB8Fe93C49b2Ff7’// Create a contract instanceconst myNftContract = new ethers.Contract(contractAddress, abi, signer)// Get the NFT Metadata IPFS URLconst tokenUri = “Pinata Metadata hashcode”// Call mintNFT functionconst mintNFT = async () => {    let nftTxn = await myNftContract.mintNFT(signer.address, tokenUri)    await nftTxn.wait()    console.log(`NFT Minted! Check it out at: https://goerli.etherscan.io/tx/${nftTxn.hash}`)}mintNFT()    .then(() => process.exit(0))    .catch((error) => {        console.error(error);        process.exit(1);    });”

This JSON file is not reserved for one NFT. You can create as many using the same MetaMask account address. Just ensure to change the Metadata attributes to make different digital collectibles.

To check if your project works, type this command into the terminal: node scripts/mint-nft.js.

You should receive a notification showing the single token hash you can see using the OpenSea platform.

Now, consider that example is not made with a live chain. Hence, you won’t be able to sell NFTs. If you want to make a true NFT, you must use the Ethereum mainnet and pay the actual gas fee using ETH.

The Best Decentralized Way To Create NFTs

Minting an NFT using multiple Alchemy apps or going all in with OpenSea is entirely up to you. 

Both methods do an amazing job of safely storing your asset in the blockchain. It all depends on how deep you want to get into customizing smart contracts and learning how the backend process of creating NFTs works.

If you choose to continue with Alchemy, you must consider that this requires mid-high coding knowledge. OpenSea’s minter consists of just a few steps; you can even change the royalty percentage.

Head on and follow the tutorials above to create your NFTs on Ethereum! 

How to Create NFT On Ethereum – FAQ

Still don’t know what NFT means? Here are a few common questions that could guide you in understanding the basics:

What Is an NFT?

An NFT (Non-Fungible Token) is a unique digital asset representing item ownership, such as art, music, or virtual goods. 

It uses blockchain technology for authenticity, scarcity, and secure transfers. Each token has distinct values and characteristics.

What Is Ethereum Blockchain?

Ethereum is a decentralized, open-source blockchain platform enabling smart contracts and decentralized applications (dApps). 

It introduced programmability and usability to the blockchain. It’s the most used network that processes NFTs.

What Are Smart Contracts & ERC-721 Tokens?

Smart contracts are automated agreements with terms written into code that enhance secure transactions without intermediaries. 

ERC-721 is a token standard on the Ethereum blockchain designed to create non-fungible tokens (NFTs). It defines rules and functions that enable the creation, ownership, and transfer of unique digital assets.

By Daniel Santi

A seasoned content writer with over 7 years of experience. Combining his expertise in writing with a background in architecture and visual arts, Daniel brings a unique perspective to the world of NFTs, blockchain, and emerging technology. His artistic skills and technical expertise enable him to create stunning, one-of-a-kind NFTs that push the boundaries of what's possible in the digital space.

Leave a comment

Your email address will not be published. Required fields are marked *