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

  • Changxin Technology Included in Shanghai Composite Index as Top Weighted Stock

    On October 28, according to the website of the China Securities Index Company, Changxin Technology has been included in the Shanghai Composite Index with a weight of 4.67%, making it the largest weighted stock in the index. Agricultural Bank of China and Industrial and Commercial Bank of China rank second and third, with weightings of 3.83% and 3.77%, respectively. Changxin Technology has also been included in the Shanghai STAR Market Composite Index, with a weight of 15.74%, making it the top weighted stock there as well. According to the compilation plan, the weight factor will be adjusted on the next trading day after the second Friday of each month or when the newly included sample weight exceeds 15%.

  • SK Hynix Plans 100 Trillion Won Shareholder Returns by 2026

    On October 28, regulatory filings revealed that SK Hynix plans to distribute at least 30 trillion won in cash dividends and to repurchase and retire at least 60 trillion won worth of shares by 2026. The share buyback includes a recently completed 40 trillion won stock repurchase.

  • SK Hynix Reports Q3 Sales of 104.62 Trillion Won

    On October 28, SK Hynix reported third-quarter sales of 104.62 trillion won, exceeding expectations of 98.96 trillion won. The operating profit for the third quarter was 83.33 trillion won, higher than the anticipated 77.5 trillion won. SK Hynix plans to repurchase 20 trillion won worth of shares.

  • WTI Crude Oil Drops 1.5% to $100.19 per Barrel

    International oil prices hit a daily low, with Brent crude futures (December contract) trading around $114. WTI crude oil experienced a daily decline of 1.5%, settling at $100.19 per barrel.

  • Meta Falls 1.4%, Plans to Raise $95 Billion for AI Investment

    On October 27, Meta (META.US) fell 1.4%, closing at $621.47. In news, Meta has initiated a public offering to raise approximately $35 billion and plans to raise up to $60 billion through a market offering of a new class of non-voting C shares. Meta stated that these plans will support its ongoing investments in AI infrastructure and personal superintelligence.

  • General Compute Completes $100 Million Series A Funding, Valued at $800 Million

    On October 27, AI computing cloud service provider General Compute announced the completion of a $100 million Series A funding round, led by Blackbird Ventures and Abstract Ventures, with a post-funding valuation of $800 million, up from a valuation of $60 million after its seed round in May. The company was co-founded by Finn Puklowski, who serves as CEO, and focuses on building cloud services using specialized inference chips that compete with Nvidia. Chip suppliers include SambaNova (which previously secured a $400 million procurement agreement), Positron, and Cerebras. The company has signed a major client with an annual recurring revenue of $100 million. Its strategy involves not building large data centers but instead utilizing smaller power sources, renting space in other companies' data centers, and repurposing former Bitcoin mining sites for AI model operations. Puklowski expects to deploy 75 megawatts of computing power by 2027 and to secure 200 megawatts of electricity.

  • US Bitcoin Spot ETF Sees $203 Million Net Outflow in October, Cumulative Net Inflow Reaches $57.4 Billion

    As of October 26, the US Bitcoin spot ETF experienced a net outflow of approximately $203 million, bringing the cumulative net inflow to $57.4 billion.

  • Morgan Stanley: Gold's Hedging Role Needs Reassessment, Still Prefers Metal Assets

    On October 27, the price of gold has fallen from $5,600 per ounce at the beginning of this year to recently dropping below $4,000 per ounce. Despite the weak short-term trend, Morgan Stanley stated that it will maintain gold as the preferred metal asset and set a target price of $5,000 per ounce for the second quarter of 2027.

  • U.S. Stock Market Opens Higher, SK Hynix Rises Over 2%

    On October 27, the U.S. stock market opened with all three major indices rising. The Nasdaq increased by 0.45%, the S&P 500 rose by 0.3%, and the Dow Jones gained 0.04%. SK Hynix saw a rise of over 2% following the release of its Q3 earnings report, which is expected to announce an additional shareholder return plan of 50 trillion to 60 trillion Korean won. Broadcom rose nearly 3% as Anthropic finalized a $63 billion financing deal to purchase Broadcom chips. HSBC Holdings fell over 6%, with Q3 pre-tax profit increasing by 32% year-on-year to $9.6 billion, which was below expectations.

  • Intel to Acquire Quantum Startup Classiq for Approximately $2.3 Billion

    According to market news: Intel (INTC.O) will acquire quantum startup Classiq for approximately $2.3 billion.