ERC721x — A Smarter Token for the Future of Crypto Collectibles
11 months ago
ERC721x is an extension of ERC721 that adds support for multi-fungible tokens and batch transfers, while maintaining full backward compatibility.
Here at Loom Network, we've been hard at work on Relentless TCG, a 100% on-chain collectible card game that's targeted at mainstream audiences.
Recently, we finished a Kickstarter campaign, and as part of the early backer rewards, we needed to deliver almost 2 million cards to these backers.
We started with a normal ERC721 smart contract, but quickly realized that we needed some adjustments to make it mainstream-friendly.
Transfers should cost very little gas, even if the player is transferring a large quantity of items. For example, someone might want to transfer a few hundred very cheap cards that are worth little individually, but quite valuable in bulk.
One contract should contain multiple "classes" of items. In a card game like Relentless TCG, not every item is unique. There may be thousands of identical copies of the same card owned by different users, and the contract should be able to recognize that these items are part of the same class.
Compatibility with marketplaces, wallets, and existing infrastructure (e.g. Etherscan). Wallet and marketplace makers provide a valuable service to the community, and it makes sense to leverage their existing work.
The Current Landscape
We are not the first ones to need something like this, and there have been a few brilliant proposals on GitHub.
However, every single instance sacrifices compatibility with existing wallets and marketplaces by creating an entirely new specification.
While we wholeheartedly support new breakthroughs, it seemed to us that the more pragmatic path — the one we can use NOW instead of months later — would be to extend ERC721 somehow, rather than abandoning it altogether.
Our Approach: Extending ERC721 with ERC1178
Out of all the existing solutions to this problem, the one that best suited our needs was ERC1178.
It is extremely easy to read and understand because of its similarity to ERC20 — easy enough that any curious user can audit the smart contract and see what the developer put in it. (If they need a little help, doing a couple lessons onCryptoZombies.ioshould be enough 😉)
It has very little bloat — just the bare minimum to implement the necessary features. The fewer things added, the better the chances are that it's secure, because it deviates less from battle-tested code.
It's really useful for things beyond just games — for example, creating a token that can represent preferred, common, or restricted shares of a company.
Using ERC1178 as the base, we added a very thin optional layer of features to support crypto-collectibles, then wrapped everything with an ERC721 compatibility layer.
We call it ERC721x.
ERC721x adds support for features necessary for real world usage of crypto-collectibles in games, with a compatibility wrapper to make it fully backward compatible with existing ERC721 services.
Real World Usage
ERC721x is immediately usable with any ERC721-compatible wallet, marketplace, or service.
For example, you can browse for a Relentless TCG card in Trust Wallet and easily transfer it to your friend. That person can check the status of the transfer on Etherscan, and then resell it by sending it to OpenSea or Rarebits.
Then, services that support the enhanced ERC721x features (such as cheap batch transfers) can implement the gas savings in the background without the end user needing to know any of the technical details.
For example, on the Loom Trading Post, you can send hundreds of cards for the price of sending one, and you can enjoy transactions that are completely free by storing the cards on PlasmaChain 😎
Beyond the technical bits that make up blockchains, the spirit of blockchain tech is equally (if not more) important.
Services should be interoperable, open, and compatible. It doesn't matter if you add a million features if the end user has no wallet that can open the items and no services like Etherscan that can view them.
At the same time, any improvements made to a technology should aim to be as seamless as possible. We can see a wonderful example of this with our USB devices. There's absolutely no need for us to stop and think, "Is this USB 1.0, 2.0, or 3.0?" We are spared from this mental overhead because, even if not all the new features are supported, we will still be able to use the device the exact same way. (At least, until USB C came along 😒).
It's these two principles that led us to create the new ERC721x, specifically for crypto-collectibles, and open source it for the crypto community.
Get started now on the officialERC721x.org
You can also check out the source code on our GitHub, audit the code, and help contribute.
ERC721x source code on GitHub
1. Connecting Ethereum, EOS, and Tron: Making Blockchain Interoperability a Reality