Note: The zk-STARK article is still coming soon. I had received some requests to write an article about NFTs, so I decided to post this one first!
NFT stands for non-fungible token. Basically, it’s a way of proving digital ownership of something (typically art, but it could be many other things such as a song, video, domain name, event ticket, or in-game item) that is stored on a blockchain. Exactly how this works will be explained later.
NFTs have been blowing up in recent months. Long-time digital art creator Beeple is selling NFTs for millions, Tom Brady is starting his own NFT company, and Dapper Labs’ NBA Top Shot is raking in dough selling NFTs of NBA highlights without even giving up copyright ownership. If you’ve done some research on NFTs in the past, you may have some questions.
Well, I will try my best to answer most of these questions! Except the last one. As for that one, hopefully you have a better idea of your own answer after reading this article.
Creating an NFT, a process often called “minting”, can be done fairly easily by yourself on a blockchain or through popular NFT marketplaces like OpenSea. This can even be done for free by not transferring the NFT to a blockchain until it is first sold or transferred.
Regardless of when it happens, at some point the NFT must be placed on a blockchain in order to verify ownership. After it is placed on the blockchain, it is unmodifiable and receives a unique identifier. A minter can mint the same NFT multiple times if he or she chooses, but each will have its own unique identifier (hence the “non-fungible”). This stands in stark contrast to cryptocurrencies where each token does not have a unique identifier. Most of the time, Ethereum is the blockchain of choice, but high gas fees (fees paid for interacting with the Ethereum blockchain) have pushed some to look at other options like Binance Smart Chain or Flow (created by Dapper Labs who runs NBA Top Shot). Once on a blockchain, the NFT can be bought and sold using cryptocurrency.
Additionally, there is some concern over the carbon emissions resulting from the proof of work required by the current Ethereum blockchain. I’ll talk a bit more about this in the closing notes, as this is obviously an issue that is being worked on and will affect future blockchain usage and miners.
It is worth taking a quick detour to discuss smart contracts in the context of NFTs since they do play a big role. The creation, sale, and transfer of NFTs is governed by smart contracts, which are coded contracts that are used to specify the rules of the events and actions in the contract automatically. Ethereum-based NFTs typically use the ERC-721 standard, which is essentially a blueprint for creating NFTs that can interact with the Ethereum network by implementing a smart contract with some basic, required functionality. There is also the ERC-20 standard, which is similar to ERC-721 but is used for fungible (non-unique) tokens. The smart contract, in both cases, acts as an API by providing functions to track total token supply, create tokens, transfer tokens, etc. Remember though, NFTs use the ERC-721 standard.
Smart contracts can be nice for quickly brokering the sale of an NFT, establishing royalties on an NFT (for example, ensuring that the original creator gets a percentage of every subsequent sale), or even creating an NFT. A good example of this “NFT creation by smart contract” concept can be seen by examining Beeple’s “Everydays: The First 5000 Days” NFT that sold for nearly $70 million.
When creating this NFT, Beeple used an ERC-721 token (which, as we discussed, requires a smart contract with certain functions) called MakersTokenV2. To give you a better look at how it works, let’s take a look at a couple lines of the smart contract’s code. One example of an ERC-721 required function is tokenURI which, when given a unique token number for an NFT, returns a link for that NFT. The code for this function in MakersTokenV2 looks like this:
function tokenURI(uint256 _tokenId) public view returns (string) {
require(exists(_tokenId));
return tokenURIs[_tokenId];
}
This tokenURI function, when called with a specified tokenID parameter:
Pretty simple, right?
You can actually view this MakersTokenV2 smart contract at https://etherscan.io/token/0x2a46f2ffd99e19a89476e2f62270e0a35bbf0756#readContract. This contract implements all functions required by the ERC-721 standard as well as a few extras. Beeple used this contract to create his NFT on the Ethereum blockchain with a unique token identifier and creator (himself). In fact, if you go to that link and ask the contract for token 40913 (the unique token ID for this NFT) through the tokenURI function, it will give you a link just like the function is supposed to. But why are we getting links instead of images or videos, and why does the link start with “ipfs”? To understand why, we first need to look at what is actually on-chain.
This is the part that many people get wrong, but it’s important because it can play a big role in the future value of an NFT. Perhaps surprisingly, what you probably think of as the NFT (such as an image file) is not actually stored on the blockchain in the ERC-721 standard. Instead, what is stored on-chain is typically a link to JSON metadata.
If you examined the metadata for an NFT and saw a link to the NFT’s file beginning with “http”, you may open it and think that all is fine and well. We’ve found the “actual NFT”! However, as we know from earlier, this link can never be changed. This means that, if the server hosting the file ever goes down or the company hosting the server decides to stop hosting it, the link will point to nothing and the NFT may essentially be worthless unless someone can get the link back up. Hosting an NFT on a traditional URL may be fine if it is for short-term use like a sporting event ticket or if you are confident that the servers hosting the content will not go down during the time you wish to keep ownership of it, but for long-term storage it may not be the best option.
IPFS stands for InterPlanetary File System, and it is a distributed file system for storing and finding content. You find things by content rather than by location/address (like you do when using http). In the case of NFTs, IPFS allows for content to be given a unique identifier (a hash of the content called a CID) and be distributed to the IPFS network so that it can be accessed by others even if your computer is offline. This is done by “pinning” (distributing) the content to the network, which can be done through multiple services and costs a small, typically recurring fee. Content can also be unpinned by the original pinner, which removes it from the network.
Many legacy browsers cannot resolve IPFS links. For instance, typing in the IPFS link from the earlier Beeple example, ipfs://ipfs/QmPAg1mjxcEQPPtqsLoEcauVedaeMH81WXDPvPx3VC5zUz where the “Qm…Uz” part is the unique CID, into Chrome will not get you anywhere. For this reason, some NFT’s metadata link directly to an IPFS gateway. These gateways are hosted on servers, just as traditional URLs are, and allow users to access the IPFS network through browsers that do not support it. While the actual file may be hosted on IPFS, if the gateway host’s servers ever go down, the link in the NFT’s metadata, again, points to nothing.
Interestingly enough, the Beeple piece we looked at earlier has this problem. That IPFS link above actually takes us to, as expected, some metadata (which, on the positive side, is stored on IPFS) that contains the actual link to the image. Guess what the image’s link begins with?
https://ipfsgateway.makersplace.com/ipfs/QmZ15eQX8FPjfrtdX3QYbrhZxJpbLpvDpsgb2p3VEH8Bqq
That’s right, even this Beeple piece’s link is reliant on makersplace keeping their IPFS gateway up and running. Now, I’m being a little bit nitpicky here since the image itself is still stored on IPFS and could still be accessed without the gateway, but it’s still something worth thinking about because the original URL would no longer point to the right image. Beeple likely thought this through and went the gateway route so that people with legacy browsers could easily view the image; IPFS may not be the most practical option yet, but it’s likely the longer-lasting one.
So, we have determined that NFT content accessed through a link starting with “ipfs://” is a good thing to see. Having known that, there is still a problem: what if the original artist pinned their NFT’s content to IPFS and then later, deciding that he or she does not want to continue paying the small fee to keep the content pinned, unpins the content from IPFS? There are a few possible solutions to this, but one notable one is the concept of a “warranty” that Pinata, an IPFS pinning service, brought to my attention.
The whole warranty idea says that, after the original minter sells or transfers the NFT that he or she has created, there is a certain time period where the seller is still responsible for keeping the content hosted on IPFS. After that period expires, it should be up to the new owner to keep it pinned. Therefore, after buying an IPFS-hosted NFT, the buyer should pin it themself at soon as possible. This ensures that there is no downtime - the content is always retrievable on IPFS.
Now that we know how NFTs work and some best practices for hosting them, what actually makes certain NFTs valuable? Since digital images or other files can be relatively easily duplicated, what is the point of owning the token on some blockchain other than being able to say that you own it and have the ability to transfer it? It depends.
Some NFTs can come with actual copyright ownership baked into their smart contract that is executed upon sale. For instance, if you purchased an NFT of a video that came with copyright ownership, you could claim profits generated by that video on YouTube. However, many valuable NFTs such as Beeple’s and NBA Top Shot’s do not come with copyright ownership. In this case, it’s more so the market determining value. I cannot tell you why some people will pay millions for certain NFTs, but some will, and that’s what matters. You could, in a way, compare it to fine art or Pokémon card pricing: scarcity of ownership and artificial value (whether sentimental value or believed future monetary value) drive prices (if you have an argument against this, shoot me an email - I’d love to hear it).
I forgot to answer this one. If standard copyright law applies to whatever work was stolen to create the NFT, then you could likely request that whatever platform is listing the NFT for sale take it down. Or, if it is hosted on a traditional URL, you could try getting the hosting service to take it down. The tough part here is that there is no way to get the NFT off the blockchain, and maybe the person who minted your work is on the other side of the world or you cannot even determine who it is. NFTs are such a new phenomenon that it’s tough to fully answer this question.
To summarize, I can’t fully answer this one, but it’s an important issue to be figured out for the future.
Twitter thread on IPFS hosting affecting current NFTs
https://mobile.twitter.com/jonty/status/1372163423446917122
Pinata (IPFS pinning company)
https://pinata.cloud/
Blog post by Robert Graham about Beeple’s $69 million NFT
https://securityboulevard.com/2021/03/deconstructing-that-69million-nft/
Article about copyright law in relation to NFTs
https://www.coindesk.com/stop-tokenizing-art-you-dont-own