ERC721 ๐Ÿช™  ,   IPFS๐Ÿ“‚   &   OpenSea ๐ŸŒŠ.

ERC721 ๐Ÿช™ , IPFS๐Ÿ“‚ & OpenSea ๐ŸŒŠ.

How do they work together to give us projects of the most popular feature of web3 (Nfts)

ยท

4 min read

NFT minting and selling most times have to do with the communication of these three technologies. So how exactly does this work ? ๐Ÿค”.

Let's dive Into the Opensea ๐ŸŠโ€โ™€๏ธ ๐Ÿ˜„

Taking in order:

  1. ERC721: Non-Fungible-Tokens (NFTs) These are tokens that are uniquely identified. Unlike the other common type of token (ERC20) which is a fungible in the sense like 1 Bitcoin = 1 Bitcoin as well as any other token is equal to the same amount of the same token . But 1 ERC721 token doesn't equal another, that's why one Bored Ape art cannot be exchanged with a Crypto Kittens. (If you don't get this no worries they are just examples of how nfts are not equal and a little explanation on them as we go on).

Most Common Examples of the ERC721 Tokens are:

  • BoredApe

  • CryptoKittens

  • Crypto Punks.

    These are very common Nfts projects and each of them is uniquely different of the other project.

image.png

Bored Ape on the left Crypto Punks at the top right Crypto Kittens at the bottom right

How can someone own an Nft?

Well its by having the ownership of the Nft

e15de8af-a1f9-4c1b-8df4-2b9c1a524b78_text.gif

So in other to have the ownership of a specific Nft you need to Mint it.

Minting Process: ERC721 deals with ownership and a person usually gets the ownership of one token through(minting like buying in erc20)

And this process is possible through the function in the ERC721 SmartContract mostly using the Openzeppelin standard. Openzeppelin.

So how all the minting and Nft stuff work under the hood? Yeah I'm talking of the smart contract code

In the Smart Contract code of Nfts there are lots of functions and they can be implemented into ERC721 Tokens / project. Some can be seen in the ERC721 documentation like:

  • balanceOf
  • ownerOf
  • SafeMint
  • TokenUrI
  • BaseUrI
  • setApprovalForAll
  • transferFrom ...etc

ERC721 Smart Contract.

In Most Nft project after minting a particular token you can usually view it on a marketplace called OpenSea.

Well this has to do with some function within the erc721 smart contract that allows opensea to access the files and all about it.

  • name => this function returns the collection name of the project.

  • symbol => this function returns the collection symbol of the project.

  • baseUri => this function returns the base uri of all the tokens.

  • tokenUri => this function returns the uri of a specific token minted.

code.png

The tokenUri function combines the baseUri with the tokenId to get the specific uri for a token.

The Uri that is returned is usually a location to the metadata for the token.

Metadata meaning a json file that contains information about the token.

This is where IPFS comes in As most nft projects want to be fully decentralized their file storage also has to be and IPFS covers this perfectly.

2) IPFS (Inter-Planetary File System) :IPFS is a distributed system for storing and accessing files, websites, applications, and data.

IPFS uses content addressing, hashing etc more can be gotten in their docs.

IPFS Docs

IPFS is a peer to peer storage network, which allows ipfs nodes to be able to store files and connect to its network. An individual can run a node to communicate with the network.

But as [Alchemy] (alchemy.com) & [Infura] (infura.io) are node providers to Decentralised applications so are Pinata, Filebase and some others to Nft projects, because running a node directly (to IPFS) can be a hassle.

Files uploaded to ipfs has an hash which is referred to as CID (Content Id) which is unique to every file uploaded.

Each file uploaded has a unique CID which can be gotten through an ipfs node directly or Filebase/Pinata etc.

So Metadata for tokens are usually uploaded to ipfs and a CID is generated. this CID serves as the tokenURI and this is what OpenSea accesses to get info on the token. Information like the

  • name of the token,
  • description,
  • traits,
  • image file location (which is also a CID of the image that has also been uploaded into IPFS) The Json format is like:

image.png

And it looks like this on IPFS:

image.png

3) OpenSea: The world's first and largest digital marketplace for crypto collectibles and non-fungible tokens (NFTs) -google

ERC721 contract specify the tokenURI of each token in the collection which is directed to a metadata file uploaded to ipfs . The metadata following opensea requirements i.e containing information about the token. After being minted by an account can be viewed on OpenSea.

OpenSea takes some time before it shows the nft minted to an address sometimes about 24-26 hrs.

So this is how all these technologies work to give you your nft in your opensea account.

An in depth knowledge on this can be gotten from [LearnWeb3DAO] (learnweb3.io) or you can watch a video tutorial by [Vitto Stack] (twitter.com/VittoStack) that explain everything here in minutes on Youtube. Here.

This is the end of this content.. I hope you now understand how the three technologies work together to give us Nfts like BoredApe and Crypto Kittens and If not I hope you at least learned something.

Then you.....

gg.gif

ย