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

  • The Bitcoin-native stablecoin bitSmiley Alphanet V1 Surpasses $24M TVL in 24 Hours!

    In a remarkable achievement, bitSmiley's Alphanet V1 skyrocketed to over $24 million in TVL within just 24 hours of its launch with over 6 million bitUSD stablecoins minted through over-collateralization. bitSmiley stands as a pioneering initiative, introducing stablecoins by over-collateralizing Bitcoin.

  • Securitize raises $47M in funding led by BlackRock to enhance innovation and expansion in digital asset securities ecosystem

    Miami-based company Securitize, which specializes in tokenizing real-world assets, has raised $47 million in funding. The round was led by BlackRock, with participation from Hamilton Lane, ParaFi Capital, Tradeweb Markets, Aptos Labs, Circle, and Paxos. The funds will be used to enhance the company's innovation and expansion as it consolidates its position in the digital asset securities ecosystem. BlackRock's first tokenized fund, the BlackRock USD Institutional Digital Liquidity Fund, has also been launched on Ethereum and is available to investors by subscribing to the fund with Securitize.

  • Web3 game Shadow War completes $5 million financing, led by Momentum 6

    Game studio Patriots Division has raised $5 million in seed and Series A financing for its Web3 game Shadow War. The Series A funding was led by Momentum 6, with participation from iAngels, Cointelligence Fund, Xborg, Andromeda VC, Cogitent Ventures, and Cluster Capital.

  • BTC falls below $57,000

    According to market data, BTC has fallen below $57,000 and is currently trading at $56,999.99, with a daily decline of 5.48%. The market is volatile, so please be prepared for risk control.

  • CoreWeave, an AI cloud service provider, completes $1.1 billion Series C financing led by Coatue

    CoreWeave, a cloud service provider focusing on artificial intelligence, announced the completion of a $110 million Series C financing round. Coatue led this round of financing, with Magnetar (the main investor in the previous round), Altimeter Capital, Fidelity Management & Research Company, and Lykos Global Management participating.

  • Cointime MAY 1 News Express

    1.Celsius Network destroys 94% of total supply of CEL, worth over $89 million2.USDC Treasury destroyed more than 200 million USDC3.Pike was suspected of being hacked and lost 479 ETH4.Fantom launches $6.5 million development fund, betting on safer memecoins5.Yesterday, the U.S. spot Bitcoin ETF had a net outflow of $162 million6.The balance of Binance Bitcoin wallet increased by 6249.36 in the past 24 hours, and 15565.89 inflows in the past 7 days7.In April, NFT sales on the Bitcoin chain exceeded US$685 million, setting the third highest monthly record in history8.On-chain content distribution agreement Metale Protocol completes additional $2 million in seed round financing9.A whale deposited 1,140 MKR into Coinbase, losing about $1.1 million10.The Bitcoin stablecoin project, bitSmiley, goes live with its Alphanet V1, marking its debut deployment on the Bitcoin Layer 2 network, Bitlayer.

  • Barcelona-based Web3 Video Games Startup GFAL Raises $3.2M in Seed Funding to Expand Team and Accelerate Production Plans

    Barcelona-based startup GFAL has secured $3.2 million in seed funding from investors including Supercell Ltd and Mitch Lasky. The company plans to use the funds to expand its team and accelerate its game production plans, which leverage AI and Web3 technology for immersive gameplay. GFAL's Elemental Raiders mobile game soft-launched in March 2023, with plans to build on this for a 2024 launch. CEO Manel Sort expressed gratitude for the investment and excitement to work with former colleagues from Digital Chocolate.

  • BTC falls below $58,000

    Golden Finance reported that according to OKX market data, BTC briefly touched $57,700 and is now trading at $58,581.53, with a daily decline of 7.15%. The market is volatile, so please be prepared for risk management.

  • On-chain content distribution agreement Metale Protocol completes additional $2 million in seed round financing

    Metale Protocol, a content distribution protocol on the blockchain, announced the completion of an additional $2 million seed round of financing. Waterdrip Capital led the investment, with participation from Aipollo Investment and Ultiverse. As of now, the total size of its seed round financing has reached $4 million. Metale Protocol was formerly known as Read2N, a Web3 decentralized reading application. The new funds will be allocated to its content creation fund to stimulate more content creation activities and promote the construction of its protocol as a platform for issuing and distributing content assets on the blockchain.

  • DWF Ventures announces investment in blockchain game developer Overworld

    DWF Ventures announced an investment in Overworld, a chain game developer. Overworld recently announced plans to launch another NFT series, and in addition, Overworld will soon launch the main world arena.