The ERC-1155 token is a type of standard token within Ethereum with the ability to change the landscape of DApps within this blockchain, thanks to its multitoken capacity and a new number of functions designed to provide a better user experience and programming.
Ethereum is known for its Tokens designed to facilitate the deployment of smart contracts associated with them and their functionalities, and one of the most recent standards in that sense is the ERC-1155.
Like the standards ERC-20 y ERC-721 As we've already talked about, ERC-1155 is a basic formulation designed to create useful tokens that make life easier for developers, while giving them a powerful and dynamic tool to work with.
ERC-1155, a standard for handling tokens with multiple functions
The ERC-1155 token is a type of standard token that has the ability to store under its control, tokens that can act as if they were an ERC-20 or ERC-721 token, or both at the same time under the same address.
The idea is simple and seeks to create a smart contract interface that can represent and control any number of fungible and non-fungible token types. In this way, the ERC-1155 token can do the same functions as an ERC-20 and ERC-721 token, and even both at the same time. And best of all, improving the functionality of both standards, making it more efficient and correcting obvious implementation errors on the ERC-20 and ERC-721 standards. This standard was developed by Witek Radomski, Andrew Cooke, Philippe Castonguay, James Therien, Eric Binet, and Ronan Sandford.
The ERC-1155 token is fully described in a EIP (Ethereum Improvement Proposal), more specifically in the EIP-1155, from which it derives its name.
Why were ERC-1155s created?
To understand why ERC-1155 tokens were created, it is necessary examine some intermediate points which will give us a better understanding of this point. Among those points we can mention:
The limitations of the ERC-20 token
The ERC-20 (for fungible tokens) and ERC-721 (for non-fungible, NFT) tokens of Ethereum are widely used within the ecosystem. Just take a look at Etherscan to see the enormous number of tokens of this type that exist. However, both tokens have limitations, some of them quite severe.
For example, in the ERC-20 token, one major limitation is the lack of a way to "react" to ERC-20 transfer events. This results in ERC-20 tokens being trapped forever in contracts when users accidentally sent tokens to the wrong address. In this way, if you transfer to an incorrect ERC-20 address, what you have transferred is lost forever.
The limitations of the ERC-721 token
For their part, ERC-721 tokens also have their own limitations. For example, getting a token identifier directly is impossible, and this makes transactions with these tokens difficult. In fact, if, for example, you have a set of 10 NFTs that you want to transfer to another person, that transfer will require you to carry out 10 different transactions, with the corresponding commission charge, and that greatly increases the cost of this simple operation, as well as the load of network operations, having a tremendous impact on the usability of Ethereum. In those scenarios you will have to transfer token by token, being impossible to transfer all 10 at the same time, something quite absurd.
Another problem is traversing the ERC-721 tokens. This requires that all tokens within the contract be traversed for the purposes of providing a response to the DApp and the user in question. Imagine for a moment that an ERC-721 contract has under its registration 1 million tokens, that means that, if a person wants to know the status of their tokens, they must send a transaction to the network which will go through this million tokens, it will match them with the user's addresses and then deliver the response. That is the greatest demonstration of inefficiency that can be had in a system of this type.
Incompatibility between ERC-20 and ERC-721 tokens
With this, ERC-20 and ERC-721 tokens are incompatible with each other. In fact, the contracts are so different that creating additional functionality linking the two is a daunting task, and would likely have heavy network impact, potential failures, and high commission costs.
This is especially important because many DApps make use of both types of tokens, and due to this limitation, the logic of their operation becomes more complex. If a single smart contract could be used to handle everything, it would be much easier to program, as well as being more secure and less complex to design.
A more efficient way to use resources and schedule
Given this scenario, the ERC-1155 has been created, in order to unite both worlds under the same contract, overcoming the limitations already described and making their management more efficient. Not only that, this solution even would avoid the huge fragmentation of tokens that exists today, allowing the same type of contract to control both types of tokens.
This, for example, would allow a DApp developer to use ERC-1155 so that its users can register fungible tokens (tokens that can be used as payment currencies) and non-fungible tokens (collectibles, exchangeable elements within the DApp or game) using the same contract, the same address and simplifying the logic of the DApps and the associated smart contracts. Without a doubt, it is a more efficient use of resources, something that would not come more in blockchains like Ethereum and its limited resources.
NFT Elementary Course
Basic levelIt is clear that nothing will be the same from the NFTs, and therefore it is essential to know all the basic aspects that this type of token contains.
New functions and possibilities of the ERC-1155 token
A moment ago we talked about the ERC-20 and ERC-721 tokens having limitations to be overcome and that ERC-1155 was the answer to it. At this point you will wonder What can you really do with an ERC-1155? Well, these are some of the possibilities:
Mass transfers as standard
The ERC-1155 standard allows native mass transfers of the tokens included in a smart contract. In this way, if, for example, we have a series of NFT tokens or fungible tokens (or both), we can transfer in the same operation, several of these tokens, making a single operation make this transfer effective.
In this way, it is possible to save on transaction costs, minimize the impact on the network, and enable a trading system (escrow/atomic swap) using said tokens much more easily.
Multiple tokens in the same contract
In addition to this, an ERC-1155 can describe the existence and operation of multiple tokens at the same time. That is, an ERC-1155 can create one or more fungible tokens (like ERC-20) and can also describe one or more non-fungible tokens (like ERC-721) all within the same contract, facilitating deployment and programming. thereof.
Integrated token type detection
Another functionality within the ERC-1155 token is the ability to integrate the functionality of the ERC-165 (known as the Standard Detection Interface) within the same system. In this way, the ERC-1155 token is capable of detecting the token's interface and adapting its behavior depending on it. This is especially useful due to the multi-token nature of the ERC-1155 and simplifies application design.
Secure token transfer
Perhaps one of the most promising features of the ERC-1155 token is the secure token transfer. To do this, the ERC-1155 standard smart contract includes a function that verifies that the transaction has been carried out, and if not, reverts it to return control of the tokens to its issuer.
This is especially useful when we make a mistake in the transcription or copy of addresses and instead send our tokens to the wrong address unable to process our transaction. In that case, the transfer is void, and the issuer recovers the tokens, allowing it to verify the address again and retry the operation. To avoid attacks from double-spending, there are a number of rules described that prevent this behavior, making it safe against these types of attacks and other traps.
Current use of ERC-1155 tokens
Currently, there are few platforms that do active use of ERC-1155 tokens, being one of them, the game producer Enjin, known for building the game Minecraft. In fact, Enjin is one of the companies that most means has put to promote the use of this new standard, something logical, considering that he has been one of the creators of this new system, by the hand of developer Witek Radomski.
Enjin has demonstrated the power of this new token by creating a large number of games that are powered by its Enjin Coin (an ERC-20 token), which is attached to a series of smart contracts that game developers send to ENJ. to create new and unique fungible or non-fungible ERC-1155 tokens. These tokens can be traded on the Enjin Marketplace, or exchanged for your ENJ at any time. As more custom tokens are minted, more ENJ is removed from the ecosystem, making it more scarce. The result: its ecosystem has grown significantly and the ENJ token positioned itself as one of the fastest growing tokens of 2020.
The utility and technical superiority of ERC-1155 seems to be enormous when compared to ERC-20 and ERC-721, making it clear that little by little it will take on more and more spaces. You can see the progress of projects that use ERC-1155 in this websitesIt is only a matter of time that we see more and more projects using this technology.