The ability to attach items to your NFTs seems like a great idea. In fact, it’s such a great idea that people have come up with several different ways to do it. This post aims to compare NFT Inventory, an open source technology that lets you add functional on-chain inventory slots to NFTs developed by Moonstream and Game7, with a quite established NFT standard, ERC-6551, that creates a separate NFT-owned wallet to store items in.
Is NFT Inventory an alternative to ERC-6551 (also known as Tokenbound)? What are the differences? Why would you choose to use one over the other?
A simple answer is that the NFT Inventory is designed specifically for the needs of web3 games, while ERC-6551 is a more general protocol. The key difference between the two protocols, with respect to gaming, is that NFT Inventory allows users to designate not just that an NFT owns or is using a token but also the purpose for which that token is being used.
So what? Well, this means that the NFT Inventory contract supplies valuable on-chain information about the game state–for example, that an item is being used as a weapon, that the weapon is currently equipped, or that an experience point is being used as a permanent marker of a character’s level. ERC-6551 does not provide this type of information.
The tables below compare the basic features of each protocol.
Overview
Both protocols allow NFTs to take ownership of on-chain assets. The Inventory system is designed specifically for the needs of web3 games.
Inventory system | Tokenbound accounts | |
Intended use | Gaming | General |
Callable by | Owners of any ERC721 token in a collection | Owner of an individual NFT |
Designates | Ownership and use of an item | Ownership of an item |
Benefits for Game Design
Lets users… | Inventory | Tokenbound |
Have characters (versus players) own the tokens representing their items, ranks, alliances, etc. | ✔ | ✔ |
Sell items along with character NFTs | ✔ | ✔ |
Add value to their NFTs based on in-game achievements | ✔ | ✔ |
Designate ownership | ✔ | ✔ |
Designate inventory slots | ✔ | |
Designate which items can be equipped in a slot | ✔ | |
Equip/unequip items | ✔ | |
Have sole control over equipping items to their characters | ✔ | |
Designate slots as persistent (permanent effects) | ✔ | |
Create fully on-chain metadata | ✔ | . |
In depth
How the NFT Inventory System works:
- Allows game admins to define inventory slots for their ERC721 collections, and specify which ERC20, ERC721, and ERC1155 tokens can be equipped in each slot.
- When a player equips an “item” token into an inventory slot, ownership of that “item” is transferred to the Inventory contract.
- The Inventory contract owns all the items that are equipped into its slots for all ERC721 tokens in a collection.
- Only the owner of an ERC721 token can unequip items from its inventory slots.
- Inventory is permissionless – anyone can deploy an Inventory contract for an NFT collection. There can be multiple Inventories per NFT collection.
- Inventory slots can be marked as persistent, which means that once tokens are equipped into those slots they cannot be unequipped. This allows for permanent status effects on game NFTs.
- Inventory allows for fully on-chain metadata, making the blockchain the source of truth for token state – this is really important for on-chain games which cannot easily consume JSON metadata from off-chain storage. Metadata can be consumed off-chain in the standard way using the Metadata Transformer.
How Tokenbound accounts work:
- Each tokenbound account is a token-gated smart contract account with gating based on ownership of its subject NFT.
- There are no semantics in tokenbound accounts besides ownership. If an NFT owns 5 swords, there is no way to specify which of those swords it is using in a game.
- Tokenbound accounts can execute arbitrary transactions “as their subject NFT” using the execute method.
- Tokenbound accounts can be created using a registry. If someone is committed to using a registry, the accounts are created using CREATE2, so tokens can be sent to the tokenbound account even before the account is created.
- Each NFT in a collection has its own smart contract account.
- Anyone (not just the owner of the NFT) can send tokens into a Tokenbound account
- Future Primitive has built a renderer which displays the tokens an NFT owns nicely on Open Sea and other marketplaces.
If you would like to contribute to the development of the NFT Inventory System, you can do that by joining our working group under the brand of “Loot Ledger” every Wednesday at 5PM UTC. The Inventory Working Group now has a dedicated Charmverse space that you can join using this link.
To know how NFT Inventory can benefit your web3 game – reach out to us on Discord to discuss. Thank you for reading!