What is an NFT? A technical explanation for non technical people
An NFT (Non Fungible Token) is an asset on a blockchain whose ownership by an individual can be proven cryptographically. Each of these tokens cannot be copied, cannot be equally substituted for another in the collection and cannot be subdivided — thus rendering it non fungible.
With the rise of the Ethereum blockchain NFTs have exploded in popularity. Most people will immediately think of image collections when those three letters are uttered: but NFTs are far more extendable than just expensive profile pictures on social media.
To explain an NFT, we must dip into a little code. Don’t worry too much about understanding this, we will talk about this in a bit. In its most basic form an NFT smart contract (a piece of code that runs on the Ethereum blockchain) must implement the following interface, known as an ERC721:
For the purposes of this article, we will deep dive a little into supportsInterface
, transferFrom
, approve
and ownerOf
functions to better understand the component parts of a basic NFT.
supportsInterface
This is common throughout a range of Ethereum smart contracts and tells any program interacting with the smart contract what set of functions this particular contract implements. In the case of an NFT, this tells any consumer of this contract that it implements the ERC721 interface and can be treated as such.
transferFrom
This enables a token to be sent by an owner to another individual. The transaction must be signed by the original owner of the token.
approve
This function allows a third party to move a token that you own on your behalf. It is the foundation that third party marketplaces such as OpenSea and LooksRare are built upon. They sell an NFT on your behalf and transfer the ownership to the buyer. It is important to note that only the owner of a particular token has the authority to grant this third party access.
ownerOf
Remember we mentioned earlier that an individual can cryptographically prove that they own a particular NFT? This function on an ERC721 contract allows them to do that by returning the public address that owns a particular token. A user can prove they have access to a particular public address by signing a message with the corresponding private key that only they have access to — therefore proving their ownership of the assets held by that public address.
Off chain data
While these are the basics of an NFT contract, we are still missing a piece of the puzzle. The above basic contract only allows us to provably own and transfer around particular token numbers on the Ethereum blockchain; nothing more. The profile picture NFTs that you are likely already aware of add an additional few lines of code that allow this token on the blockchain to point to some information ‘off chain’:
When a baseURI
for a particular contract is set, the above tokenURI
function returns the full URI to access the information for a particular asset, e.g: ipfs://QmV8cx4TAMX4ghZJTXKFYG37Fq4uLmqXrKNB1jUTXqke3R/images/4365
This allows wallets, third party NFT marketplaces and any consumer of any particular NFT contract to display the visual representation of those blockchain tokens that we can prove that we own. Most commonly this information is stored on decentralised storage infrastructure such as IPFS or Arweave. This means that we can safely trust the information describing our token on the blockchain will safely live far beyond the lifespan of the team that actually created the NFT.
The information returned by the above uri looks like this:
{
"name": "Kanpai Panda",
"description": "Kanpai Pandas is a collection of 10,000 randomly generated and stylistically curated hand-drawn NFTs that exist on the Ethereum, Binance, Polygon, Avalanche, Fantom, Arbitrum, and Optimism chains",
"file_url": "https://ipfs.io/ipfs/bafybeidxwzzb7kxdnmuird5hqlcqcfatvybp7kdxot6zyz3b4gxxjjaaby",
"attributes": [
{
"trait_type": "Birth-Chain",
"value": "Binance"
},
{
"trait_type": "Accessories",
"value": "Bamboo Sword"
},
{
"trait_type": "Body",
"value": "Normal"
},
{
"trait_type": "Tattoo",
"value": "Red Sun"
},
{
"trait_type": "Clothes",
"value": "Green Bandana"
},
{
"trait_type": "Jewelry",
"value": "Frog"
},
{
"trait_type": "Mouth",
"value": "Powerstache"
},
{
"trait_type": "Mood",
"value": "Laughing"
},
{
"trait_type": "Head",
"value": "Blue Bucket Hat"
}
],
"custom_fields": {
"dna": "ad3b53c59d06d536ded37f382863bd2c47a54957",
"edition": 5162,
"date": 1650747628451,
"compiler": "HashLips Art Engine"
},
"image": "ipfs://bafybeidxwzzb7kxdnmuird5hqlcqcfatvybp7kdxot6zyz3b4gxxjjaaby"
}
This information follows the OpenSea metadata standards and provides a short description of the NFT contract in question, information about the specific token and, most importantly, another IPFS uri to the image for our token. Here is that image in question:
Most commonly this metadata returned describes an image, the most famous examples being CryptoPunks and Bored Ape Yacht Club. However that is just the tip of the iceberg about what off chain asset an on chain token can point to. Just going by the OpenSea metadata standards we can also provide a video, an animation or even a webpage to provide a full interactive experience. There have even been instances of physical property being sold in the form of an NFT — drastically cutting down the bureaucratic red tape necessary for a house sale.
Currently you may only be aware of NFTs as expensive digital art, but the possibilities for decentralised provable ownership are far greater.
If you have any immediate or future software consultancy needs and want to learn how Logicful can help you, get in contact.