Cointime

Download App
iOS & Android

How to Create an ERC721 NFT the Best Way in 5 Minutes

So an NFT is simply a piece of information that lives on the blockchain, represented by a visual image. This is not a guide on how to design NFTs. For that you need to learn digital design with tools such as Illustrator and Photoshop.

Btw if you want to create your own NFT collection I wrote a massive guide to show you everything step by step from own experience launching collections here: https://merunas.gumroad.com/l/nft-guide

Remember, an NFT is a regular image + some data stored in the blockchain.

To keep it simple, go to Deep AI text to image generator and type whatever text you want, the AI system will create an image from it like so:

And this is the resulting image which we’ll turn into an NFT:

Now that you have the image that will be used as an NFT, you need a place to store the image so it’s accessible online. Here are the options:

Storing the image on-chain

You can compress and encrypt the image into a string that can be stored in the blockchain directly. Nouns is a very popular project and they do that.

This is the best approach because the data is fully decentralized and will stay in the blockchain permanently so others can access it anytime.

To do that, you’d create an ERC721 smart contract and store the image of the NFT in a string state variable.

However we won’t do that because it’s a bit of a difficult process since you can’t just compress the images you need a specific way to convert them to string so they aren’t massive.

Storing a base64 string would easily take many millions units of gas in Ethereum. It’s just not a simple process.

Storing the image in IPFS

This is the most common approach and the one we’ll take where the image is store in the decentralized service IPFS.

Files on IPFS stay in a network of nodes sharing and storing the image of your NFT. I wrote a lot about how to store your IPFS files online forever here. However today we’ll use a great tool.

That tool is called nft.storage and it’s great because they do all the setup and hard work for you. You just upload and the image stays online forever.

You’ll see a page like this once logged in:

Simply click on the Upload button. Then select the nft image you’ve created and click on upload.

You’ll see the uploaded file.

Click on actions and “Copy IPFS Url”. You’ll need it to create the metadata which is the key information NFT marketplaces need to work with.

Now you’ll need to deploy the NFT contract. Continue reading!

Btw if you want to create your own NFT collection I wrote a massive guide to show you everything step by step from own experience launching collections here: https://merunas.gumroad.com/l/nft-guide

Creating the NFT ERC721 smart contract

The ERC721 standard is the one you must use to deploy your NFT. Go to remix ethereum and click on this icon to create a new smart contract:

Simply call it NFT.sol and add the following code:

That’s the simplest NFT smart contract you’ll ever find. It imports the popular openzeppelin libraries which are the standard when it comes to smart contracts and it adds the minting functionality to create 1 NFT on deployment.

As you can see the parameters are _name_symbol and _metadataUrl where the name is your NFT name, the symbol for your NFT which is like a short name of 4 characters and the metadata url.

The contractURI() function returns the metadata and it’s required by opensea.

What is metadata? The metadata is the link between your smart contract and your image. It’s a .json file. It contains the name, image and any other attributes you want to add to the NFT so that marketplaces like opensea can show users that data.

Before deploying the NFT contract, you want to create the metadata and upload it to nft.storage. Let’s see how it’s done:

Creating the NFT metadata

Simply create a new file called metadata.json and add the following parameters:

You can change the name and description. The external_url is where you want users to go when they click on your NFT. In this case it’s the same for the image and url so people see the image.

To get the image url go to nft.storage and copy the IPFS url which will look like this:

ipfs://bafkreidhvbks723vbhipmxp4fv75yki7h2v3y3onbbnhisttg6iz3wnacq

However that’s not accessible by browsers. Simply change the ipfs:// part to https://ipfs.io/ipfs/ and it will look like this:

https://ipfs.io/ipfs/bafkreidhvbks723vbhipmxp4fv75yki7h2v3y3onbbnhisttg6iz3wnacq

You can try to open that in your browser and it will show the image.

Now simply upload the metadata.json file you just created to nft.storage like before. Once uploaded, go to Actions > View URL and copy the URL.

Then go back to your remix.ethereum.org NFT.sol smart contract and deploy the contract with the NFT url like so.

That should be it! Your NFT contract will be created, the token will be minted, the metadata deployed to nft.storage will be connected to the smart contract and the image will be received from the metadata to show it on opensea.

If you can’t see the video for any reason here’s a gif of it:

Your NFT is ready and you now know how to create NFTs. This is just for 1 single NFT but you can repeat the process with many NFTs.

NFT
Comments

All Comments

Recommended for you

  • BTC Surpasses $63,000

    Market data shows that BTC has surpassed $63,000, currently priced at $63,049.63, with a 24-hour increase of 0.89%. The market is highly volatile, so please ensure proper risk management.

  • Brent Oil Falls Below $75 for the First Time Since Iran Conflict Erupted

    On June 24, Brent crude oil dropped below $75 per barrel for the first time since the outbreak of the Iran conflict, declining by 2.16% during the day.

  • Unitree R1 Humanoid Robot Price Reduced to 29,900 Yuan

    On June 24, Unitree Technology announced that the official price of its bipedal humanoid robot, the Unitree R1, has been reduced from 39,900 yuan to a starting price of 29,900 yuan, with immediate availability for purchase. The robot weighs 25 kilograms, is equipped with 26 high-precision joints, supports multimodal interaction with voice and image large models, and has development and customization capabilities.

  • Bessent: Trump Confident in Walsh Regarding the Federal Reserve and Rate Cuts

    On June 24, U.S. Treasury Secretary Bessent stated that Federal Reserve Chairman Walsh has made strong remarks on inflation. President Trump has expressed confidence in Walsh both publicly and privately. (Regarding the Federal Reserve and rate cuts) President Trump is confident in Federal Reserve Chairman Walsh.

  • Bank of America Significantly Raises Semiconductor Industry Forecast: Market Size Could Reach $2.7 Trillion by 2030

    On June 24, Bank of America significantly raised its global semiconductor industry forecast in its latest research report, stating that AI demand is shifting from validating investment returns to addressing structural supply constraints in chips, storage, and power. The shortage of memory chips and rising prices are expected to become the core drivers of industry growth in the coming years. Bank of America predicts that the global semiconductor market size will grow from $787 billion in 2025 to $2.734 trillion by 2030, with a compound annual growth rate of 28% from 2025 to 2030, higher than the previous expectation of $2.3 trillion and 23%. Bank of America anticipates that the chip industry took about 50 years to achieve its first $1 trillion in sales, while AI is expected to generate an additional $1 trillion in the next five years.

  • President Trump: Iran Informs US of No Toll Collection in Strait of Hormuz

    President Trump: Iran has informed the United States that it will not collect tolls in the Strait of Hormuz.

  • Goldman Sachs: Chinese Residents' Stock Allocation Remains Low Relative to Long-Term Potential

    On June 24, Goldman Sachs' China macroeconomic team recently published a research report stating that the asset allocation of Chinese residents is in the early stages of structural transformation. As the role of real estate in wealth accumulation gradually diminishes and deposit interest rates remain low, savings may gradually shift towards a broader range of financial assets, with stocks and insurance expected to be the main beneficiaries in the medium term. "The stock allocation of Chinese residents remains low relative to its long-term potential," Goldman Sachs noted, indicating that the current proportion of stocks in residents' assets is less than 10%. This suggests that as residents gradually broaden their investment horizons, there is significant room for further asset reallocation. Considering that residents' risk appetite remains cautious and financial wealth distribution is uneven, this adjustment is unlikely to be linear or widespread. Nevertheless, if residents' confidence stabilizes and capital market returns are attractive, stocks may occupy a larger share of new resident savings in the future.

  • U.S. and Brent Crude Oil Prices Both Drop by 2%

    On June 24, WTI crude oil fell to $72 per barrel, down 2.27% for the day; Brent crude oil also declined by 2%, currently priced at $75.07 per barrel.

  • Wuhan Launches 1 Billion Yuan AI Innovation Fund

    On June 24, Wuhan's first municipal-level artificial intelligence innovation fund—the Wuhan Wuchuang Future Intelligent Venture Capital Fund—was officially launched, with a total scale of 1 billion yuan. The fund is jointly funded by Wuchuang Investment, Wuhan Fund, and the Hubei Province Humanoid Robot Mother Fund, focusing on cutting-edge fields such as artificial intelligence, humanoid robots, and embodied intelligence. It aims to support core technology research and development and industrialization projects, particularly in humanoid robot systems, high-precision sensors, and intelligent chips.

  • JPMorgan Raises S&P 500 Year-End Target to 7800 Points

    On June 24, JPMorgan raised its year-end target for the S&P 500 index to 7800 points, stating that the market outlook is approaching a 'clear skies' scenario.