The Point - Why, What, and a little How:
The point of this post is to gauge interest in a community led initiative to migrate all SNIP-20 tokens to SNIP-22s. If there is enough interest I propose we pass a community spend proposal to compensate the execution of this migration.
Preface - Give me a break:
I may make some technical errors here in describing aspects of SNIP-20s and SNIP-22s. This is due to the immateriality of the details I may get wrong, as well as time constraints for fully research those details. Unless the error is relevant and material, I donāt want to focus on it for any discussion that follows.
SNIP-20 Background - The Problem:
The initial SNIP-20 standard made possible fungible tokens that have privacy. No one but the viewing key holder can see the balance or the history of transactions. This standard is the foundation on which much of what we think of as Secret Network has been built. But, SNIP-20s have a major flaw. The transaction history is incomplete, both in the sense of lacking certain transactions, and lacking critical information for the transactions that are included in the history. Essentially all you can see is movements of funds and the addresses involved, along with an ID that is an incrementing number added to each transaction. What is missing is any mint or burn transaction and, critically, neither the timestamp nor the block of the transaction are saved. The consequence of this lack of information is that unless you create a viewing key prior to a transactions, and save that viewing key, and all subsequent ones, if you ever create a new one, there is no way to recreate the historical events. (There are various ways in which you can come close, some involving community organization, that I can discuss with anyone interested, but they all require a lengthy explanation).
The viewing key is important here because it highlights the problem as I see it. You can use an archival node and preserved viewing key(s) to derive the block of each transfer. The problem is that A) it is resource intensive to do this, both computationally and time and effort-ly, and B) viewing keys were not āsoldā to the general Secret Network user as something they absolutely needed to save.
I hope it is clear why I mentioned the possibility of immaterial errors in describing this stuff at the beginning. Just framing this issue is time consuming and risks confusing or seeming like a mere ātechnical issueā that is too in the weeds. But the wonkiness of the topic
belies its importance.
SNIP-22 Background - The Fix:
More recently the SNIP-20 standard was updated fixing the issues I outlined above. This means that a user of SNIP-22s can recreate their history precisely with minimal time and effort. SNIP-22 also offers a number of enhancements beyond this issue that make migration that much more valuable. But I wonāt list them here, just trust that they are much better.
Back to the Point - Is this important?:
IMHO, migrating all SNIP-20 tokens is critical for Secret Network to move forward on a solid footing. To outline one reason for this, if we want large scale trading on Secret Swap we need professional traders to know they can use a tool to calculate their tax exposure, or just track their history for insights after the fact. Again IMO, Secret Network is about privacy, not about opacity. It is about control for the user, and that can only exist with information being available.
The problem with the solution - How hard is this?:
This is hard. Here is a list of implications of doing this:
- New contracts will need to be deployed for most bridge tokens, LP tokens, swap pairs, staking contracts
- Weāll need to write a nice generic migration contract that lets people deposit their coins in exchange for minting new ones on the new token (easy to write, but gotta get the configuration right because we have several dozen tokens)
- All token holders will need to be made aware of this, actively migrate all their base tokens (maybe we can provide a fancy LP migration contract? IDK)
- We will need to build a UI allowing people to easily migrate their tokens, make new viewing keys, migrate liquidity for LPs, etc
- The bridge will need to either continue supporting pulling out from older contracts, or offer the migration to holders of old tokens before allowing them to pull out of SN (latter might be annoying to people but probably a lot easier to implement)
- maybe more things that havenāt been considered yet, like token symbols and things like that.
Conclusion:
To summarize in reverse order:
- This is hard to do
- This is important
- SNIP-22s are private, but give the user their transaction history
- SNIP-20s are opaque even to the user
- I know the explanation is long and boring, and I may have made technical mistakes, but lets focus on the point
Next Steps:
If this gets enough interest, I want to move it to a signaling proposal on chain. It has been suggested to me that we should request that validators donāt vote on this. That we prove interest by asking only individual addresses to vote. I see the point here, but I worry that A) most people donāt vote, maybe never had B) the importance of this may be much greater than the interest in fixing it. If it is the difference between SCRT being a top 50 coin or not, but we donāt get enough votes because people arenāt paying enough attention, what then?
Anyway after that I would like to work with the leads and the foundation to identify parties who can work on the solution and then pass a community spend to pay them to do it.