Solana Token-2022 Standard: A Technological Renaissance or an Echo From the Past?
Exploring the Hype: Unveiling the Excitement Surrounding the New Token Standard on Solana and the Implemented Features in Token-2022
Disclaimer: The content presented in this article, along with others, is based on opinions developed by the analysts at Dewhales and does not constitute sponsored content. At Dewhales, we firmly adhere to a transparency-first philosophy, making our wallets openly available to the public through our website or DeBank, and our articles serve as vehicles for self-expression, education, and contribution to the ecosystem.
Dewhales Capital does not provide investment advisory services to the public. Any information should not be taken as investment, accounting, tax or legal advice or as a recommendation to purchase, sell or hold or to pursue any investment style or strategy. The accuracy and appropriateness of the information is not guaranteed by Dewhales Capital.
1. Introduction
2. SPL (Solana Program Library)
3. Introduction of the Token-2022 Program
4. New functionality in Token-2022
5. Functionality to be added in the future
6. Projects based on the Token-2022 standard
7. Conclusion
1. Introduction
Recently, there has been an emergence of new types of standards and tokens designed to facilitate blockchain operations and smart contract execution without significant changes. For instance, in the Ethereum Virtual Machine (EVM) in 2023, the eip4337 protocol was finally launched, enabling the implementation of Account Abstraction functionality without interfering with Ethereum's logic and consensus. However, the most widespread developments are not the new protocols, often requiring an understanding of numerous variables and nuances. In 2023, various token formats started appearing across different blockchains.
In fact, where competition was previously observed mainly between different blockchains, now competition is evident even within blockchain networks, among different token standards:
BRC20 - native tokens for BTC, allowing users to bypass smart contracts and store script files in Bitcoin, using them to link tokens to specific satoshis. Users can deploy, issue, and transfer tokens using BRC20, embedding JSON data into sequential records.
SRC20 (STAMPS - Secure Tradeable Art Maintained Securely) - a new standard for BTC from Stampchain, developed based on BRC20. Its notable distinction lies in BRC20 transactions being stored in witness data, while SRC20 transactions are stored in spending data.
Ordinals, opening the possibility of placing images and other data types in the BTC blockchain without using a separate token or sidechain. It can be considered a successor to Colored Coins and Counterparty.
erc1155 - a token standard for the Ethereum blockchain proposed by Enjin in 2018. It's a unique token standard allowing the creation of both fungible and non-fungible tokens within a single contract. One of the main advantages of erc1155 is reducing the number of transactions needed to manage multiple token types, similar to what Account Abstraction offers through other means.
erc4626 - a standard aimed at optimizing and standardizing technical parameters for income storages. It presents a standardized API for tokenized income storages, representing shares of a single base erc20 token.
erc6551 - a new token standard proposed in February 2023, giving each erc721 token a smart contract account. These "token-bound accounts," as they are called, enable ERC-721 tokens (NFT standard) to own assets and interact with applications without requiring changes to existing smart contracts or erc721 infrastructure.
erc777, aimed at extending the functionality of the erc20 standard to eliminate its limitations. erc777 implements "Hooks," a feature that combines token transfer and contract notification in a single message. The erc777 standard is backward compatible with the erc20 standard, allowing erc20 and erc777 tokens to interact with each other.
Solana also joined the scene, launching the Solana Token-2022 Program - a new type of token called Supertoken. Let's delve into what sets Token-2022 apart from the familiar SPL.
2. SPL (Solana Program Library)
Initially, the Solana blockchain introduced what is known as SPL - Solana Program Library. Solana token standards are stored in the Solana Program Library, which serves as a repository for programs operating within the Solana blockchain runtime environment. The program provides a standardized interface for creating, using, and destroying tokens that are compatible with the Solana blockchain.
In Ethereum, fungible tokens use the erc20 standard, while non-fungible tokens use the erc721 standard. Each erc20 token has its own smart contract, and each NFT collection has its own erc721 (or erc1155) contract.
Here lies a significant difference in the operational logic between Solana and Ethereum. Unlike ERC standards (except for erc1155), which distinguish between fungible and non-fungible tokens, SPL encompasses both. The functionality of various SPL tokens can vary within the SPL standard, as they can be NFTs, low-volume fungible tokens, or tokens combining features of other types. Essentially, instead of deploying a new erc20 smart contract for each new token, all users need to do is send an instruction to the token program. Depending on the instruction user send, the token program will mint/transfer/burn tokens.
In Solana, tokens are not simply stored at the user's wallet address. In the Solana chain, so-called token accounts are created for tokens, linked to the user's account address. A token account stores the quantity of tokens a specific user holds for a particular token type. So, if a user has 100 SPL1 tokens and 5 SPL2 tokens, the user's account will have two token records specifying the balance and owner of the tokens.
One advantage of the "program/account" model is that you can have a single shared program that works with different data. The best example of this is the SPL token program. To create a new token, you don't need to deploy code as in Ethereum. Instead, you create an account that can mint tokens and other accounts that can receive them. The mint address uniquely determines the token type, and all are passed as arguments to a single static instance of the program.
However, overall, as mentioned earlier, the functionality of SPL closely resembles simple erc20/erc721, and despite different token creation and behavioral logic, SPL lacks some features that are becoming increasingly necessary in the evolving crypto industry. The SPL Token program is considered complete, and there are no plans to add new functionality.
3. Introduction of the Token-2022 Program
While there is the option to fork the token program and add new features, achieving widespread adoption becomes a challenge. Therefore, to provide additional functionality to tokens on the Solana network without altering the operation of the existing program, a decision was made to create a new library for token programs - Token-2022, which began its development after the first Breakpoint event in 2021. The goal of Token-2022 is to offer new functional capabilities to tokens without disrupting the existing ecosystem, ensuring the security and integrity of current tokens.
You can think of Token-2022 as a new and improved version of the token program on Solana. It can handle both fungible and non-fungible tokens. This new program still retains all the features of the old Token program but now comes with a set of new useful functions designed to enhance token functionality on Solana. These new features, which are the real magic of Token 2022, are presented in the form of so-called extensions.
Token-2022 supports the same instruction schemes as the original Token program. The byte representation of instructions remains unchanged, ensuring compatibility between the two programs. Developers can distinguish between Token and Token-2022 by simply modifying the program_id in the instruction. Additionally, the structure of accounts and mints in Token and Token-2022 is similar. For the initial byte representation, it remains the same. However, Token-2022 introduces new fields in the form of extensions to implement additional functions.
4. New Features in Token-2022
As mentioned earlier, the Token-2022 Program expands capabilities for developers on the Solana network through the introduction of so-called extensions. Token-2022 introduces new fields in the form of extensions to implement additional functions specified during asset creation. Despite some of these proposed functions being implemented in other chains, the superior speed of Solana and lower transaction costs create excellent conditions for the flourishing of this functionality in Token-2022. These extensions offer the following features:
Confidential Transfers - Arguably the most significant addition to Token-2022. This feature utilizes zero-knowledge proofs to encrypt token balances and transfer amounts for SPL tokens. Token-2022 requires homomorphic encryption, a scheme allowing hidden mathematical operations without the need for decryption.
Homomorphic encryption is a special class of encryption schemes that enables certain types of computations to be performed on encrypted data without the need for decryption. Thus, these hidden computations yield an encrypted result that, when decrypted, is equivalent to the result of applying the same mathematical operations in plaintext. Token-2022 uses "twisted ElGamal encryption" to ensure the execution of hidden mathematical operations on encrypted text.
Confidential transfers are verified using Sigma protocols, a special class of zero-knowledge proofs where one party (the prover) can prove to another party (the verifier) that it knows a secret without revealing the secret itself. These Sigma protocols are necessary for several instructions provided with the extension. Only the account owner with the decryption key can view their balance in this confidential system. However, there might be cases where a third party needs to verify balances, whether for auditing purposes or compliance requirements. The Confidential Token Extension allows this through the Global Auditor system (somewhat resembling the implementation of confidential transactions in Obscuro). In this system, each account can have a separate decryption key, allowing the owner to selectively grant read access to specific accounts. The mint or organization issuing assets has a special data structure that may optionally include a global "auditor encryption key."
InterestBearingMint (Interest Rate) - Perhaps the second most crucial innovation, enabling the creation of tokens that accumulate interest over time (resulting in the token's price increasing instead of changing its quantity in the wallet) - reward-bearing tokens. In Ethereum, this standard has been implemented for quite some time; for example, stETH LIDO is such a token. The challenge with tokens whose quantity changes over time (rebase) is their poor compatibility with DeFi infrastructure, as they require additional complex calculations due to changes occurring not only unevenly but even decreasing, posing challenges for interacting with oracles and assessing liquidity pool values. Reward-bearing tokens simply change their price, making them more easily accepted by DeFi protocols.
Transfer Fees - Automatically charges a fee for each token transfer from the mint. An example of this is SafeMoon on BSC, which introduced a 10% transaction fee, with 5% redistributed among other SafeMoon holders. This incentivizes holders to HODL.
NonTransferable - Allows the creation of tokens that cannot be transferred but can be burned. This is ideal for creating unique achievements or rewards. These tokens can also be useful for selling event tickets, as users won't be able to send the ticket to someone else.
Transfer Hook - An extension that allows invoking custom code every time a transfer occurs. This enables a developer to have a program on the chain triggered every time someone transfers a token from a specific mint. This can be used for managing transfer fees for NFT transfers or initiating "events" in a game related to item transfers, such as bandits robbing users and stealing some of users items, or for updating metadata associated with a game item, such as a character evolving similar to a Pokémon, in trading.
MintCloseAuthority - Addresses a significant gap in the Token program by allowing the closure of mint accounts at a chosen address, which was previously impossible.
In addition, Token-2022 introduces new feature fields for user accounts, further enhancing flexibility in asset management:
Through the ImmutableOwner extension, Token-2022 adds a security layer, making it impossible to reassign the account owner. This feature enhances the security of token transactions. To better understand this, let's look at how tokens are stored in the standard token program. Typically, when someone wants to send a token to a wallet, the first step is to create a token account to store that token inside the recipient's wallet. This account is created from a combination of the token mint's address and the recipient's wallet address. It's entirely normal and expected that once this account is created, its ownership rights can be transferred to someone else. With the Immutable Owner extension in Token-2022, this will become impossible.
The DefaultAccountState extension allows token mint creators to restrict token usage by freezing all new token accounts by default. It provides an additional level of control over the distribution and use of tokens. This means that users can receive a token, but users won't be able to do anything with it until the token creators allow it.
Token-2022 allows specifying a permanent delegate for a token account. Essentially, this enables users to appoint someone (a representative) who will always have the authority to manage tokens from the mint. They can perform actions such as transferring or burning tokens. If this extension is used, the delegate will have unrestricted delegation rights over any account in this mint. This can be potentially risky, as this delegate/person can transfer or burn tokens in someone else's wallet.
5. Planned Future Functionality
Increased Transaction Size: To facilitate confidential transfers in a single transaction, as opposed to being split across multiple transactions, the Solana network needs to accommodate transactions with a larger payload.
Confidential Transfers with Fee: Due to the transaction size limit, implementing confidential transfers with a fee is currently not feasible.
More ZK Features
6. Projects Based on Token 2022
When working with projects based on Token-2022, it's important to note that Token-2022 is still under review and not intended for full production use. Additionally, this standard emerged relatively recently and is continuously being refined, so there are currently few projects in the public domain, both in development and already launched.
Among the most notable projects based on Token-2022 at present are:
Fluxbeam: An experimental DEX with extensive functionality, including a Telegram bot supporting Solana v2 (Token-2022) tokens. The FLUXB token employs the mechanics of so-called "reflections": during trading, users pay fees that are then distributed to FLUXB token holders. While commonplace for erc20, this is a novel concept for Solana.
BERN: A vivid example utilizing the new fee-related functionality, specifically the Transfer Fees feature. It employs a 6.9% transfer fee to reward holders of $BERN and another token $BONK.
Solarmoon: Utilizes a transfer fee to reduce supply and create a deflationary tokenomics for $MOON. A 5% fee from each transfer goes to a "Held Account," to which the SolarMoon team has irrevocably relinquished access, ensuring these tokens are permanently locked and inaccessible.
Jupiter: A DEX aggregator enabling the trading of Token-2022 standard tokens, including via Fluxbeam.
7. Conclusion
The Token-2022 standard introduces numerous improvements, offering more flexibility and new use cases to the Solana ecosystem. Additionally, this standard holds particular interest in the context of crypto industry regulation and Real World Assets (RWA), as it enables new usage scenarios based on features such as ImmutableOwner, DefaultAccountState, and configurable transaction privacy. The capabilities of NonTransferable and DefaultAccountState functions can prove valuable in gaming, making in-game economies and design more versatile and flexible.
Collectively, Token-2022 emerges as a technology that unlocks new possibilities for the Solana blockchain, potentially expanding the range of use cases and attracting a larger user base. Moreover, some implemented Token-2022 features may ultimately simplify the design of smart contracts and protocols, reducing transactional load through fewer contract invocations. Coupled with the large bandwidth of the Solana blockchain, this could also enable the emergence of any non-obvious use cases.
However, it is crucial to note that Token-2022 is currently in the development and audit stage. As features like transfer fees pose challenges for integrators, it is recommended to adhere to the standard token library unless there is a compelling need for these specific new functions.
For similar reasons, listing Token-2022 tokens on centralized exchanges is challenging. The libraries are still undergoing refinement, and adding such tokens to the list requires consideration of numerous nuances related to the discussed functions. Additionally, new features and capabilities are continuously being introduced into the Token-2022 code, necessitating separate audits. The latest audits were conducted in April 2023 by organizations such as Halborn, Trial of Bits, Zelic, and NCC Group.
In any case, Solana is likely on the brink of significant changes. Observing the development of Token-2022 and projects around this standard is recommended, similar to the growth observed with the popularity of BRC20 tokens.