Quick question about the Algorand features.
Can we build a new token or stable coin on Algorand with the capability to centrally retire the tokens after they’ve been transacted? We still need to maintain all the info public but need to prevent a token from exchanging hands after it’s been transacted once!
Hi, @al012, welcome to Algorand Forum!
You can use the clawback feature of the ASA. If it is NOT nulled out, then you can “take back” any time the token from the owner. Of course, you need to monitor your coins with a separate process, and after the first transaction you can “reach out” with your clawback address, and take back the coin.
The problem with this solution is that it is not event based, you need to monitor your coins with a separate process. It is not a problem if you have hundreds of coins, but the solution is not scalable, and with millions of coins it is quite unfasible.
Anybody has a better solution?
If you make some logic in your application to check that user balance consists only from transactions from some originating address, this might be doable… Other transactions can be taking back with the clawback feature…
Thanks @Maugli . The solution needs to be scalable! The owner should have the option to retire the token e.g. through an exchange and once it is retired it should be prevented from transacting again.
If you want any token holder to have the option to retire token forever, you can create a “sink” account that is a (stateless) contract account that only allows to opt-in once to the ASA, and then does not allow further transaction.
This essentially allows burning of the token easily.
But this option means that token holders themselves retire/burn the tokens.
If you want that a token can only be exchanged once, you can use ideas from Assets and Custom Transfer Logic | Algorand Developer Portal
At a high-level, you combine ASA with a stateful application.
You have the initial recipients of the ASA (the only ones allowed to transfer the ASA) opt in to a specific application that record the balance of ASA that they are allowed to transfer (i.e., initially all the tokens they have).
Then any transfer of the token is done by a group of two transactions (one ASA transfer and one application call).
The application call update this balance and only allow transfer of tokens if the transferred amount is below the recorded balance in the application.