All About Closed-Loop Tokens
Enforcing specific rules and policies on token usage ensures greater security, compliance, and tailored functionality for specific app needs.
Closed-Loop Tokens (CLTs) allow for the creation of tokens on Sui that have defined rules and restrictions, enabling the creation of closed token systems. Unlike Sui’s Coin standard, which allows unrestricted usage and transfer, CLTs offer a more controlled and customizable approach.
In Sui, the Coin standard can be used to create flexible, unrestricted, and universally recognized coins. While this is advantageous for broad, general-use scenarios, it fails to meet the demands of use cases that require strict control over how, where, and by whom tokens are used.
CLTs are particularly valuable for apps using tokens for specifically defined purposes, such as rewarding loyal customers, complying with jurisdictional regulations, or creating a closed in-game economy.
The need for Closed-Loop Tokens
While the unrestricted nature of the Sui Coin standard proves extremely valuable for many uses, the free-flowing nature of a coin can actually be a limitation. These types of assets can be used broadly as they are freely transferable, wrappable, and can be recognized and accepted in any app.
This open-loop system is beneficial for many scenarios but falls short in apps requiring specific constraints. For instance, certain services might need tokens that can only be used for a specific purpose, by authorized accounts which have completed KYC checks, or in-game currency which can only be spent within specified marketplaces.
The need for such specific constraints arises in various scenarios. Loyalty programs, in-game currencies, and restricted marketplaces often work better in controlled environments where tokens cannot be traded or used outside their intended context. Regulatory compliance also demands restrictions on token usage to ensure only verified or authorized entities can hold and use these tokens. With the implementation of these controls, the potential for misuse, fraud, and regulatory breaches can be mitigated, which is essential in creating an economic system that can enforce specific rules and restrictions.
Opportunities unlocked by Closed-Loop Tokens
CLTs empower builders with a higher degree of control and customization over how tokens are used and transferred within their apps. Using the CLT standard in the Sui framework, developers can:
- Restrict token usage to authorized apps.
- Set up custom policies for transfers, spends, and conversions.
- Add arbitrary restrictions on token transfers between user addresses, spending tokens, and token usage in smart contracts.
These capabilities open up a wide range of possibilities. For example, tokens can be designed to prevent onchain trading, making them ideal for loyalty programs or in-game currencies where speculation is undesirable. They can also ensure compliance with regulatory requirements by restricting usage to verified accounts or specific services.
How Closed-Loop Tokens work
Builders implement CLTs through the sui::token module, which distinguishes them from traditional coins by their lack of the store ability. This means CLTs cannot be wrapped, stored as dynamic fields, or freely transferred unless a custom policy allows it. They can only be owned by an account and not stored in an app, but they can be spent. The authorization mechanism for CLTs is called an ActionRequest, allowing the token owner to specify which actions (transfers, spends, conversions) are permitted and enforceable through predefined rules.
A TokenPolicy is a shared object that the token creator can generate using the TreasuryCap, specifying the conditions for token transfers, spends, or conversions. These policies are enforced by programmable rules within the TokenPolicy, implemented as separate Move modules, allowing for modular and reusable policy definitions. To address token storage issues, CLTs utilize a spend method, where spent tokens can either be burned directly or delivered to the TokenPolicy as spent_balance. This balance cannot be reused and can only be burned, ensuring strict control over token lifecycle and usage.
Closing the loop
Closed-Loop Tokens offer a level of control and customization not possible with the Sui Coin standard or typical token standards found elsewhere on other blockchain protocols. By enabling developers to impose specific rules and restrictions on token usage, CLTs open up new possibilities for secure, compliant, and specialized apps. The adoption and implementation of CLTs will play a crucial role in shaping the future of DeFi and digital assets.
Note: This content is for general educational and informational purposes only and should not be construed or relied upon as an endorsement or recommendation to buy, sell, or hold any asset, investment or financial product and does not constitute financial, legal, or tax advice.