NFTs and their use beyond crypto art

Matheus Leal
Nerd For Tech
Published in
7 min readApr 1, 2021

--

In the last few weeks, you may have imagined the reason behind these high values for digital images. Non-fungible tokens(NFTs) are unique entities that can’t be replaced with something else. These tokens are a unit of data on a Blockchain, where each NFT represents a unique digital item. It has been gaining space among artists, game developers, and other professionals who deal with authorial works. This concept can be useful for several others problems. We present to you some possibilities for this technology and also how to implement your own NFT.

single NFT non-fungible token example — Retrive from Yahoo

Stimulus

After reading about Grimes getting millions of dollars or Nyan Cat being sold, you may have imagined the reason behind these values for digital images. We’ve seen several news explaining what a non-fungible token(NFT) is. What few discussed was that this technology goes beyond digital images being sold for a large amount of ether.

NFTs can represent digital files such as art, audio, videos, items in video games, and other forms of creative work. They are a unit of data on a Blockchain, where each NFT represents a unique digital item. This concept can be useful for several real problems.

The main advantage of the technology is the guarantee of authenticity, without this implying extra costs or the need for a regulatory authority. NFTs can be useful for resolving existing intellectual property rights. More than that, they can bring income to segments that today have difficulty controlling ownership. In this text, we present to you the possibilities of this technology and how to implement your own NFT.

NFTs

In September 2020, artist Matt Kane sold a work of art for $100,422. That would hardly be news, but Right Place & Right Time drew attention for being the first crypto art creation to cross the $ 100,000 barrier. Every NFT is a unique token on the Blockchain. Most NFTs are part of the Ethereum Blockchain, but this is not necessary.

Ethereum is a decentralized platform capable of executing smart contracts and decentralized applications using Blockchain technology. They are applications that work exactly as programmed without any possibility of censorship, fraud, or interference from third parties because the contract is immutable.

Generally, these NTFs use the same token structure. The ERC-721 standard is a type of token created for an Ethereum network under the standards of its smart contracts. This pattern was designed to create interchangeable tokens, but with the particularity of being unique and not expendable.

Non-fungible tokens are unique entities that can’t be replaced with something else. For example, a one-of-a-kind trading card is non-fungible. If you traded it for a different card, you’d have something completely different. NFTs can be anything digital, but a lot of the current excitement is around using the tech to sell digital art.

NFTs Comparison

Crypto Art

Crypto art is the term used to classify all art sold on Blockchain. NFTs are making a loud splash in the art world. An artist named Beeple recently sold a single NFT for $6.6 million and in the sports world, the NBA’s authorized digital highlight reels have already generated $230 million in gross sales.

You can copy a digital file as many times as you want, including the art that’s included with an NFT. But NFTs are designed to give you something that can’t be copied: ownership of the work. It is important to say that the artist can still retain the copyright and reproduction rights, just like with physical artwork. To put it in terms of physical art collecting. Anyone can buy a Monet print. But only one person can own the original. Beyond what is defined in the contract, you take, of course, the pleasure of having the work in your crypto asset portfolio for anyone to see. It’s like you have an art gallery in your pocket. This can be of great value for a collector.

For digital artists, the attraction of using Blockchain is the simplicity of ownership. Crypto art is no more secure from copycats than anything else posted on the internet. A person could easily record a video or screenshot an image and proudly display the replica on their desktop. But with an NFT, the owner buys a verified token providing digital evidence that the art is theirs. Something a bit like an artist’s signature. The idea is to offer some semblance of the authenticity that is naturally bestowed on physical art.

Outside the art world

Any NFT is simply a piece of digital memorabilia, nothing more, nothing less. And in this case, the NFT is a piece of digital memorabilia stuck on valuables platforms. It can work like any other speculative asset, where you buy it and hope that the value of it goes up one day, so you can sell it for a profit. technically anything digital could be sold as an NFT. The international DJ deadmau5 has sold digitally animated stickers. There have been some attempts at connecting NFTs to real-world objects, often as a sort of verification method. Nike has patented a method to verify sneakers’ authenticity using an NFT system, which it calls CryptoKicks.

One of the most interesting aspects of NFTs is how they can be used in games. There are already games that let you have NFTs as items. One even sells virtual plots of land as NFTs. There could be opportunities for players to buy a unique in-game gun or helmet or whatever as an NFT, which would be a flex that most people could appreciate.

Another use that tends to become popular is in the music industry. Kings of Leon released a new album that included NFT versions with certain exclusive benefits such as privileged location in live shows, special album, and differentiated arts. The tokens would go on sale for two weeks and then become collectibles, which can be traded by their owners. Anyone can hear the band’s hits, but only buyers will have the original files.

NFT Categories

Do it Yourself

Now we present to you a solution to create an NFT using the standard ERC-721. For that, we need to write code in Solidity. This is an object-oriented programming language for writing smart contracts. It is used to implement smart contracts on various Blockchain platforms, most notably Ethereum. We created a file containing the interface with this token pattern. This is the interface of our token. The main difference about a fungible token is the existence of a unique ID for each token.

pragma solidity ^0.4.18;contract NFT {    event Transfer(address indexed _from, address indexed _to, uint256 _tokenId);    function balanceOf(address _owner) public view returns (uint256 _balance);    function ownerOf(uint256 _tokenId) public view returns (address _owner);    function transfer(address _to, uint256 _tokenId) public;
}

In the next file, we will create the product ownership structure. Modifiers are used to change the behavior of functions. This contract is declaring the onlyOwnerOf modifier that checks whether the account that is interacting with the contract is the owner of a particular product. The required function throws an exception if the condition is not met.

pragma solidity ^0.4.18;contract ProductFactory {    event NewProduct(uint productId, string name);    struct Product {
string name;
}
Product[] public products;

mapping (uint => address) public productToOwner;
mapping (address => uint) ownerProductCount;

modifier onlyOwnerOf(uint _productId) {
require(msg.sender == productToOwner[_productId]);
_;
}

function createProduct(string _name) public {
uint id = products.push(Product(_name)) — 1;
productToOwner[id] = msg.sender;
ownerProductCount[msg.sender]++;
emit NewProduct(id, _name);
}
}

The NFT interface has the methods and events that must be implemented by our token, the ProductFactory has the data structure and the function responsible for creating new products and the ProductOwnership contract implements the methods of the NFT interface.

pragma solidity ^0.4.19;import "./NFT.sol";
import "./ProductFactory.sol";
contract ProductOwnership is ProductFactory, NFT {
function balanceOf(address _owner) public view returns (uint256 _balance) {
return ownerProductCount[_owner];
}

function ownerOf(uint256 _tokenId) public view returns (address _owner) {
return productToOwner[_tokenId];
}

function _transfer(address _from, address _to, uint256 _tokenId) private {
ownerProductCount[_to] = ownerProductCount[_to] + 1;
ownerProductCount[msg.sender] = ownerProductCount[msg.sender] - 1;
productToOwner[_tokenId] = _to;
emit Transfer(_from, _to, _tokenId);
}

function transfer(address _to, uint256 _tokenId) public onlyOwnerOf(_tokenId) {
_transfer(msg.sender, _to, _tokenId);
}
}

For complete implementation and more other smart contracts, please access the following GitHub repository.

Conclusion

Non-Fungible Token is a fever that has taken over the elite of Silicon Valley. Its great differential is the ability to be unique entities that can’t be replaced with something else. Those can be used to represent digital files such as art, audio, videos, items in video games, and other forms of creative work. Using the ERC-721 standard we presented an implementation to create your own NFT. Now you just have to imagine new possibilities of use.

--

--

Matheus Leal
Nerd For Tech

M.Sc at Pontifícia Universidade Católica do Rio de Janeiro & Applying DevOps culture at Globo