ERC721s or NFTs -Development & Deployment — Part 1

M-Zohaib Nasir
6 min readMar 12, 2022

One of the world’s largest music labels is exploring entertainment in the metaverse. Universal Music Group is already home to some of music’’ most famous artists. but now its label 10:22PM is launching the music group Kingship, which is made up of some famous NFTs, or nonfungible tokens.

Four virtual apes from the Bored Ape Yacht Club collection of NFTs form ‘a metalaverse group’, Universal said Thursday. The team behind Kingship will eventually perform and release original music.

Interesting? Innovative?

So what exactly is this buzzword “NFT”? Let’s dive in….

NFTs:

Non Fungible Tokens (also known as ERC-721s) are a token standard that was created on the Ethereum platform similar to ERC20s, Link, Aave, maker, all other goodies that are found on the Ethereum chain. NFTs, Non-Fungible Tokens, are tokens that are -uh- Non-fungible :) meaning they are totally unique from each other, and one token isn’t interchangeable with any token of its class. Think about it this way, a one-dollar currency note is interchangeable with any other one-dollar currency note. One dollar is going to have the same value as another dollar. These dollars are fungible tokens like ERC20s. One link is always going to be equivalent to another link. By contrast, is going to be NFTs. Pokemon would be a good example of an NFT. Your one pokemon is going to have different stats, different move sets, and isn’t interchangeable with any other pokemon. Or maybe a more relatable example is something like trading cards or a unique piece of art. So, that’s what these NFTs are. They are non-fungible, non-interchangeable tokens that for the moment are best represented or thought about as digital pieces of ART that are incorruptible and have a permanent history of who’s owned them, who’s deployed them, etc.

So, in simple words, NFTs provide value to creators, artists, game designers, and more by having a permanent history of deployment stored on-chain. You’ll always know who created the NFT, who owned the NFT, where it came from, and more, giving them a lot of value over traditional art. In traditional art, it can be tricky to understand what a “fake” is, whereas on-chain the history is easily traceable.

Can I make an NFT?

Now, as I said, NFTs are just a token standard. So, you can actually make them and show your creativity with them. NFTs can be more than just merely art. You can give them stats, you can make them battle, you can do really unique things with them. You can do pretty much whatever you want but right now the easiest way to think about them, or maybe the most popular way to think about them, is by calling them “art!art!it’s ART!” or some type of collectibles or anything that’s unique.

NFTs Marketplaces:

So, NFTs are just tokens that are deployed on a smart contract platform and you can view them on different NFTs platforms like OpenSea, Rarible. These are marketplaces that let people buy and sell NFTs. You obviously can do that without these marketplaces because it’s DECENTRALIZEDDD!!! but these marketplaces can help and give a good user interface. So that’s the basic gist of it.

Let’s talk more about standards:

The ERC-721 standard or NFT standard is the basis of it all. There is another standard that’s a semi-fungible token called ERC-1155.

The main difference between the ERC-721 and the ERC-20 is that ERC20s are “fungible” tokens, which means “replaceable” or “interchangeable.”

On ERC-20s, they have a really simple mapping between addresses and how much that address holds.

ERC-20

But ERC721s have unique token ids. Each token id has a unique owner and in addition, they have what’s called a token URI.

ERC-721

Storage, Metadata & Token URIs:

Each token is unique and each token ID represents a unique asset. So, since these assets are unique and we want to be able to visualize them and show what they look like, we need to define some attributes of the object. If it’s a piece of art, we need a way to define what it looks like. If it’s some sort of character in-game, we need a way to define that character’s stats.

In the NFTs, this is where metadata and token URIs come in. So, if you know anything about Ethereum, you know sometimes gas prices get pretty high, especially when it comes to storing a lot of space, it can get really, really expensive. So, one of your first questions might be “WELL! are they storing these images and art pieces on-chain?” And the answer is sometimes.

Back when they were coming with NFTs and artists were deploying stuff, the eth-devs and artists were like,” Yeah, art!!! let’s do that ART! I'm going to deploy this one MB image on the Ethereum chain.” and devs were like “O God! It's so much gas expensive!”

So, they realized putting all of this art on-chain is going to be really expensive, so to get around this, what they did is they put in the standard what’s called a token URI. It is a universally unique indicator of what that asset or token looks like, what the attributes of this token are. You can use something like a centralized API or IPFS to actually get that token URI.

Token URI

A token URI is just a simple API call. They follow a standard for showing metadata. A typical token URI has to return something in this format like this.

Metadata

*The image section points to another URI of what the NFT looks like.

Off-Chain VS On-Chain:

Y’all might be raising your eyebrows because IT ALL SEEMS PRETTY CENTRALIZED! and you might be thinking “wait… if the metadata isn’t on-chain, does that mean my NFT might go away at some point”? And you’d be correct. This is the current limitation of the NFT ecosystem. There is often this talk of on-chain metadata versus off-chain metadata. Because it is so much easier and cheaper to store all your metadata off-chain, a lot of people would use something like IPFS that is decentralized but does take a little bit of centrality to keep persisting, but they can also use their own centralized API. However, obviously, if that goes down then, you lose your image and everything associated with your NFT. (I’ll discuss IPFS in another blog post, so, for now, just think of it as online file storage.)

Because of this, most NFTs marketplaces can’t and won’t read off on-chain attributes or on-chain metadata because they are so used to looking for the token URI. Obviously, if you do off-chain metadata, you can’t do anything really cool or really interesting or have any games with your NFTs. For example, if you wanted to create an on-chain pokemon game, all your attributes would need to be on-chain in order for the pokemon to interact with each other, because if it was off-chain, then it becomes a lot harder to cryptographically prove.

I know, you are new to NFTs and you’re like “WAIT! TOO MUCH INFO”, I’ll make it easier for you. If you are looking to render an image of an NFT

  • Add image file to IPFS
  • Add that image file’s IPFS URL to metadata file
  • Add that metadata file to IPFS.
  • The link to that metadata file on IPFS will be your token URI.
  • Grab that token URI and put it on your NFT.

In the next part:

We’d be coding and deploying our own NFT on OpenSea testnet.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

M-Zohaib Nasir
M-Zohaib Nasir

No responses yet

Write a response