Translate

mercoledì 25 maggio 2022

NFT: standards, functional properties and types

The Non-Fungible Token (NFT) is a type of cryptocurrency derived from Ethereum’s de facto NFT smart contracts was first proposed in Ethereum Improvement Proposals (EIP)-721 and recently further developed in EIP-1155


NFT differs from classic cryptocurrencies because it is unique and cannot be similarly traded, making it suitable for uniquely identifying something or someone.

To be specific, using NFT on smart contracts (in Ethereum), a creator can easily prove the existence and ownership of digital assets in the form of videos, images, art, event tickets, etc.

In addition, the creator can also earn royalties every time the NFT changes hands, either on any NFT marketplace or through peer-to-peer exchange.The deep liquidity and convenient interoperability actually allow the NFT to be a promising solution for intellectual property protection, although it represents little more than code.

HOW AN NFT WORKS

The components I will list are the foundations for a fully functioning NFT scheme in which the central structure is the Blockchain, programmable and suitable for Smart Contract implementation, supporting (public key) addresses and transactions on the same chain.

The creation of NFTs thus requires an underlying distributed ledger for records, exchange transactions, and trading (seller-buyer or simple transfer) in the peer-to-peer network.

As can be seen in the functional diagram, the creation of an NFT consists of several steps, concatenated together.

First, a raw element (be it a drawing or a form of “analog” expression) is digitized, converting the data into a format suitable for the blockchain. The owner (of the NFT) then stores the raw data in a database outside the blockchain, leveraging systems such as IPFS, which we discussed in our previous article.

Note that it can also store raw data within a blockchain, as is the case in Takamaka for example, although in most cases no one uploads a digitized format to the blockchain for the simple fact that, apart from Takamaka, this operation in 99.9 percent of cases consumes a lot of gas ( thus costing a lot of money ).

At this point he signs the transaction, that is, the owner of the NFT signs a transaction, including the hash of the NFT data, and then sends the transaction to the Smart Contract. If the person who signs the transaction has performed KYC on Takamaka, the owner of the public key will be able to unequivocally claim ownership over that NFT.

Now through the SC, the “minting” of the NFT is performed and then the exchange between public keys takes place, such as that between a seller and a buyer, or simply the transfer from one wallet to another..

It should be noted that tokens can be of various “structures” and thus be used in different ways and for different purposes.

TYPES OF NFTS.

NFTs can be of the ERC-721 or ERC-1155 type.

Although ERC-20 is not an NFT token, it is the most widely used token standard in the Ethereum Blockchain and in fact enabled the introduction of the ERC-721 contract, a non-fungible token standard (NFT) that differs from the fungible token (ERC-20).

The NFT token is unique and can be distinguished from another token, particularly because each NFT has a variable, uint256 called tokenId.

This contract address pair uint256 tokenId is globally unique.

All NFTs have a uint256 variable called tokenId, in ERC-721s the contract address pair, uint256 tokenId must be globally unique.

So a dApp can have a “converter” that uses the tokenId as input and outputs an image such as zombies, weapons, skills or awesome kittens !

Insights sample code.

Link: https://ethereum.org/it/developers/docs/standards/tokens/erc-721/

A recently introduced standard is ERC-1155 (Multi Token Standard), which extends the representation of fungible and non-fungible tokens.

ERC-1155 can represent different types of configurable tokens.

ERC-1155 extends the functionality of tokenId, where each of them can

independently represent different types of configurable tokens. The field can contain its custom information such as metadata, block time, date, supply,

or any other attribute, as explained in a previous article here

STRENGTHS OF NFTS

NFT schemes are thus essentially decentralized applications that enjoy the benefits/properties from their underlying public ledgers. Among the key properties is Verifiability , precisely because NFTs through Token metadata, can always be publicly verified.

With the Blockchain structure, full and complete transparent execution is always possible, which includes the minting of the NFT, sale, purchase and then transfer.

If the signing of the NFT is done with a certainly verified public key, ownership is always demonstrable, and if metadata and trading records are stored persistently, these can no longer be manipulated once transactions have been confirmed.

NFTs and its corresponding products can always be arbitrarily traded.

®️ SMART CONTRACT IN TAKAMAKA

To program Smart Contract (SC) in Takamaka, we only use the Hotmoka library.

Takamaka has built in a sidechain that executes hotmoka (the smart contracts in the future release of takamaka) with a latency of about 1 second, we can then execute a transaction in very few seconds, here is that if we were to use Takamaka to pay at the Supermarket (for example) the time would be very short.

With Hotmoka, transactions are executed in a simplified environment, with extremely low cost and latency, and with high speed of execution.

Hotmoka is nothing more than a Java framework (a collection of methods and libraries) from Takamaka , which limits the use and replaces nondeterministic methods with deterministic methods.

By connecting to the Hotmoka framework, with a java ide, you can immediately write SC code, and all this is done using only methods already present in java .

Therefore, writing an SC with Hotmoka is like writing a Java Spring microservice or a Hibernate-based service. These are libraries that extend the language and make method lists, which is why Hotmoka is natively compatible with any java ide ( Atom , IntelliJ , NetBeans …).

The way Hotmoka’s transaction system works, it is possible to consider the execution flow as a nonsimultaneous monothread (execution of an entire process without interruption). This is a great advantage from a programming point of view, because it eliminates the problems associated with parallelism and execution synchronization .

G. Antino CTO for the takamaka team

We have reached the last stage of integrating the Hotmoka library on the Takamaka node, testing is yielding comforting results in terms of both processing speed and security.

Stay tuned, we are on the right track.

Links and references for the article