What is SPL404?
Last updated
Last updated
SPL404 is an experimental protocol that allows NFTs to be split and traded like tokens, improving the liquidity and transaction convenience of NFTs.
The combination of digital assets and NFT of art solves the problem of NFT liquidity, endows digital assets with cultural value, and allows digital assets and NFT to be exchanged at any time. Koala can be exchanged for platform NFT at any time, and NFT can be used as collateral to receive airdrops, and NFT can enjoy the bonus of platform ecological construction. (airdrop + collateral income)
It’s important to understand the underlying philosophy of SPL404 and the tradeoffs made to ensure smooth integration with protocols that are typically unaware of Token-2022 functionality. Each whole token is effectively tied to a typical ID, but is otherwise able to be traded or transferred fractionally. All Token-2022 interface functions respect typical operation whereby users are able to transfer distinct token id’s without friction. As this native fractional balance is transferred, however, whole tokens leave the users account, drawn from a queue when ownership of whole tokens changes. For example, when a user with a balance of 7.2 tokens transfers a fractional representation of 0.3, their most recently received token would be removed, and their balance would be 6.9. This begs the question of where whole tokens go under these circumstances. This is one of the most significant generalizations from the initial iteration of SPL404, where a LIFO pool is maintained of available ID’s assuming the maximum ID is aligned with total supply. For instance, when a new a collection is launched, new NFTs will be minted until the total number of NFTs is equal to the total supply (100 NFTs for a total supply of 100 * 10 ^ decimals). Once this point has been reached, if a token is removed from a users balance as result of a fractional transfer but the recipient does not experience a whole token balance change, this ID would then be added to this stack of pending ID’s. What this then offers is a persistent pool of static ID’s, allowing for more traditional collection design. How SPL404 supports these mixed interfaces is another interesting topic. SPL404 takes the approach of isolating independent logic where possible, and introducing pathing to support simple, seamless integration on overlapping standards. Pathing could best be described as a lossy encoding scheme in which token amount data and ids occupy shared space under the assumption that negligible token transfers occupying id space do not or do not need to occur.
The following interface outlines a set of functions that rely on this pathing approach:
SPL404 is still in active experimentation, having grown rapidly from an initial implementation used to support the koala launch. As adoption has grown and new use-cases have been identified, we’ve rapidly moved towards building a more generalized implementation that can better suport novel protocols, existing integrations and creators alike.
As a result of these efforts, the latest implementation has introduced a number of improvements:
Token-2022 type token ids are now banked and reused in a FIFO queue instead of increasing forever as they are minted and burned. This allows for a predictable set of NFT token ids, as in a typical NFT collection.
Transfers of full Solana tokens now transfer Token-2022 type tokens held by the sender to the recipient. In other words, if you transfer 3 full tokens as an ERC-20 transfer, 3 of the Token-2022s in your wallet will transfer directly to the recipient rather than those Token-2022s being burned and new token ids minted to the recipient.
Predictable events emitted during transfers, approvals, and other operations that clearly indicate whether attributed to solana / Token-2022.
Simplification and centralization of transfer logic.
Easier to use dedicated minting function.
EIP-2612 support for permit approvals.
EIP-165 support.
Numerous logical optimizations and gas savings.