Shape-shifters
In this week’s Nexus, we discuss some of the key benefits of semi-fungible tokens for game development, specifically around user experience, flexibility and efficiency
Semi-fungible tokens (SFTs) is one of the lesser understood token standards in web3 gaming, in contrast to the more established and straightforward models of fungible and non-fungible tokens. Given the technical opportunities they provide, they are worthwhile exploring - however, before we get into the technical details, let's start by discussing a simple example of how they are commonly used.
Generally speaking, SFTs are used in a way that is mostly identical to fungible tokens (FTs), but with a few interesting properties. First, unlike with standard FTs, there can be multiple types of SFTs within the same contract, thereby allowing SFTs to act as different types of resources. Second, as SFTs can exist in parallel to NFTs within a single contract, they can be transformed into NFTs.
Suppose you wanted to introduce multiple types of currency in a game, such as Gold, Silver, and Bronze - instead of creating separate contracts for each currency, you can use SFTs more efficiently and cheaply. Or, consider a game where initially a sword is identical to others in its basic form, but via special quests or other processes can be transformed into a special sword that is unique to you as a player. Both of these game scenarios can be achieved using a combination of fungible and non-fungible tokens, however, they would require multiple contracts and transactions and result in much higher costs.
The mechanism behind this functionality relies on a unique type of contract called ERC-1155, which enables the co-existence of different fungible and non-fungible tokens within the same contract. This makes the functionality suitable for any project, but particularly useful for games. We are not suggesting here that all games should be migrating their game resources on-chain, however, consolidating everything within a single contract allows for more efficiency, such as the batching of transactions.
When it comes to marketplaces, there are some interesting benefits to treating items as semi-fungible. With standard ERC-721 NFTs, where tokens are nearly identical except for minor details like mint numbers, the shopping experience may feel odd, as you look at identical assets and focus solely on the floor price.
With ERC-1155 tokens, the purchasing experience becomes significantly simpler and more user-friendly, particularly when purchasing multiple items.
NiftySwap takes the concept even further by leveraging Automated Market Makers (AMMs) to consolidate all the items and automatically determine their prices based on supply and demand.
Sunflower Land and Skyweaver are two great examples of games that use NiftySwap, and SFTs, in different ways. Sunflower Land, a farming simulation, revolves around cultivating and managing various crops and other resources such as wood and stone. Within the game, players frequently swap and exchange different resources and the game's primary fungible token, $SFL. Considering different production styles, as well as time and resource constraints, players may find themselves short or in excess of certain resources. To address this, players can use AMMs (Automated Market Makers) to trade resources without the need for explicit sale listings. Interestingly, the pools for swapping to $SFL are much more popular than those for swapping to $USDC, indicating that the system effectively prevents extractive behavior. And since these tokens behave like fungible assets, it is easy to establish barter systems, allowing for resource swapping through concepts like multi-token pools, thereby moving away from financialization models altogether.
In contrast, Skyweaver has a different style of resources with its trading cards. Physical trading cards (beyond the wear and tear) align with the concept of SFTs in the sense that there may be many different cards but copies of the same card are identical. There are 580 different cards in Skyweaver, which would make creating individual fungible token contracts for all of them prohibitively expensive. Splinterlands and Gods Unchained, like other TCGs, use NFTs for their cards. However, as these can also be upgraded, SFTs offer a suitable use case for them. SFTs also offer the flexibility to transition from fungible tokens to non-fungible tokens within the same contract. Considering that players of both Splinterlands and Gods Unchained often have base level (non-upgraded) cards, there is a strong case for transforming these base level cards into SFTs that can later become NFTs, once upgraded. Another option is to simply modify the SFT type since all upgraded cards are identical to each other. For instance, all level 2 versions of a Splinterlands card share the same characteristics. This eliminates the need to use NFTs when the token is not one-of-a-kind.
Of course there are some who would argue that NFTs are better as they are currently more universal, which is true. However, considering that OpenSea supports SFTs and Magic Eden partnered with Genopets to support their SFTs, there is some evidence that the adoption of SFTs is slowly but surely spreading.
The advantage of using ERC-1155s is that you no longer have to make the choice between supporting something as a fungible or non-fungible token. ERC-1155 tokens can effectively function as both, which is particularly useful if your game incorporates multiple types of tokens. Initially, PFP projects spearheaded by Cryptokitties, BAYC, etc. were designed around single NFT lines because they weren’t games. However, games have different requirements and should encompass multiple resources, surpassing the limited "one token or two tokens?" primitive design of web3 in 2021. While SFTs certainly aren’t the end of the evolution of tokens, they are a great upgrade. Lastly, for more on innovative token standards, we recommend reading Limit Break’s recently released upgrade to NFTs, ERC721-C.
Thank you for reading this piece of our weekly series “Nami’s Nexus”, where we look to decode web3 gaming and dive into the various intricacies of the industry and beyond. Don't forget to subscribe to our blog and follow us on Twitter to receive more web3 gaming content.