I’d like to present here my vision for the next year of Statemint. I have spoken with people from other parachains, wallets, application developers, and service providers (custodians, exchanges, etc.) and think that it’s possible to make Statemint a lot more powerful for them and their users. These are the initiatives that some people at Parity are working on and I hope will be accepted by the DOT stakeholders in the referenda required to launch them.
The main features can be broken down into four tracks:
- Support for parachain native assets and bridged assets;
- More advanced NFT support;
- A decentralized exchange; and
- More advanced asset locking/reserving functionality.
Parachain Native Tokens and Bridged Assets
The current version of Statemint has one instance of the Assets pallet where anyone can permissionlessly claim an Asset ID and control that asset class from an “owner” account. But not every asset is controlled in that way.
The current Assets pallet uses integers to identify asset classes, with any metadata about them controlled by their creators. Just like on Ethereum where any user can deploy an ERC20 contract and call it “USD{x}”, anyone can do the same with an integer-based Asset ID on Statemint. This is not so big a problem, since users are already using the asset based on some trust in the creator. But when an asset class is actually controlled by a decentralized protocol, we can be more expressive of what that class is in its identifier.
A new (additional) instance of the Assets pallet on Statemint will use XCM MultiLocation
s to represent assets, and their corresponding origins to control them. This configuration will make it possible for parachains to send their native token to Statemint and use it with the API there. For example, Moonbeam’s native asset GLMR would have an ID of MultiLocation { parents: 1, interior: X1(Parachain(2004)) }
and the corresponding origin, namely the Moonbeam parachain origin, would control the minting and burning of the asset on Statemint. With the upgrade to XCMv3 and the Global Consensus primitive, it can even represent assets from bridged chains, for example ETH would be MultiLocation { parents: 2, interior: X1(GlobalConsensus(Ethereum)) }
.
This functionality serves a few purposes. In discussion with wallets, custodians, and exchanges, one of the pain points of integrating parachain tokens is that they require running individual parachain infrastructure like full nodes to process deposits, and require additional code to handle withdrawals because they need to be able to construct and broadcast transactions on each individual parachain. These parachains could use different balances pallets or order them differently. When we think of Polkadot hosting hundreds of parachains (and thousands of threads), this represents a huge obstacle (and cost) to network support. This is in contrast to for example adding support for an additional ERC20 token; the marginal effort is very small since an Ethereum node already serves all the data they need.
With support for these assets on Statemint, custodians/exchanges could just monitor one chain for deposits (applications and UIs would need to give the option to transfer to Statemint). For withdrawals, users could choose to withdraw to their address on Statemint (custodian makes an assets.transfer()
call) or to their address on the parachain (custodian makes an xcm.reserveTransferAssets()
call). There are two user experience bonuses here:
- For the custodian, they only need to transact on one parachain and can access every other without any infrastructure lift.
- For the user, they never actually need to “see” Statemint. It’s entirely abstracted away behind either the parachain wallet/application or the custodian.
Statemint support for bridged assets also keeps the Bridge Hub lean. It only needs to act as a message routing and forwarding service, but does not need to store any assets. The Bridge Hub origin would have permission on Statemint to manage the bridged assets via its messages. Like Statemint, the Bridge Hub can be completely abstracted out of user-view, with the Bridge Hub just providing an API to Statemint and other parachains. All fees can be taken at the origin parachain, and the user would never need to submit a transaction on the Bridge Hub.
Finally, Statemint support for parachain native assets will make it a gateway from DOT into these assets, and eventually a place where wallets can perform more advanced features with assets on Statemint (more on these below).
(cc @Peter from What needs to happen for our DeFi Ecosystem ASAP? - #4 by Peter)
Next Generation NFTs
Since launching Uniques on Statemine and Statemint, we’ve gotten a lot of community feedback from teams like Singular for application integration and have done our fair share of dogfooding by releasing NFTs there.
Earlier this year, we started an NFT working group with several community teams like RMRK, Phala, and Astar and got feedback from them about what kinds of features they wanted from native NFT functionality on a system parachain. This resulted in the Uniques V2 roadmap that has been under development (most of the heavy lifting by @jsidorenko).
The main features of this are the ability to buy/sell NFTs, including multi-asset support, smart attributes, and NFT fractionalization.
Smart attributes in particular have some interesting use cases. These allow the owner of an NFT to allow other entities (e.g. another account, an application, a parachain, a custom origin, etc.) to update certain attributes about the NFT. For example, a member of the Polkadot Technical Fellowship could have a membership badge that evolves over time by giving the Fellowship origin permission to update its attributes (e.g. Rank) on the badge directly. Smart attributes would also allow creators to participate in the future success of a collectible.
The final code for this is being reviewed and merged in FRAME, and we expect to launch it in the testnet Westmint before the holidays (devs - perhaps some holiday NFT tinkering?).
Decentralized Exchange
“Should Statemint have a DEX” has been a question since launch. For a long time I have fallen on the side of “no” (you will find many GitHub/Polkassembly posts from me stating as much), but from many discussions over the last year I have changed my mind.
I propose that we add a Uniswap V2 style DEX to Statemint, but am very interested to hear other arguments about this. Uniswap V2 is simple, well understood, and does not have privileged functions that control asset pairs. The design also plays nice with the Assets pallet; we could add a third instance of the pallet to represent the LP tokens where the DEX has control over these tokens.
A DEX on Statemint would serve as a path from DOT to any parachain native token (since they will be on Statemint too, as mentioned earlier). This gives parachain teams and their users permissionless, decentralized access to liquidity in the Polkadot network without relying on integration with third party custodians.
There have been several requests from people for a “trustless” DEX, i.e. one that would not be subject to any governance except Polkadot’s.
Finally, a DEX on Statemint improves its security and makes “sufficient” assets more adaptable and useful. For a long time, I thought we could get away with using a DEX on another parachain, but there are several scenarios where synchronous information enables more secure and flexible features. For example, right now governance has to be quite strict about what it considers a sufficient asset, because since that asset can pay transaction fees, and the owner of the asset can mint new tokens, they can buy unlimited execution for themselves. So governance must be conservative in only choosing “trusted” asset owners. By having a DEX on-chain that can synchronously handle the DOT fee to asset fee conversion, the network can be more lenient in allowing sufficiency since the protocol itself can handle any unscrupulous behavior from the asset owners by swapping the asset for DOT directly (removing DOT from the user’s point of view, and a large number of asset classes from the collators’).
Advanced Asset / Cross-Chain Features
Over the next year, one of the goals at Parity is to adapt the staking and governance related pallets so that they can work as parachains. Since DOT cannot be in two places at once, but both of these systems use overlapping locked DOT, we will need to be able to lock DOT in one place and “use” it somewhere else. One of the primitives for this, asset locking over XCM, comes with XCMv3.
We also want to extend this functionality to assets, as outlined in this tracking issue. This would allow assets on Statemint to be locked for simple things like vesting, but also for more complex applications like use in parachain protocols (or use in protocols on multiple different parachains). There are other advantages to this, e.g. what @xlc mentioned in How to Recover a Parachain - #16 by xlc.
Of course, parachain assets would always be “at home” on their native parachain and could be used there. This functionality just makes more things possible, but does not limit how anything on a particular parachain can function.
For parachains working with custodians and wallets/interfaces like Ledger Live, having this ability directly in Statemint allows them (and by extension, their users) to interact with parachains without needing to run nodes and infrastructure for them.
Summary
I hope this post gives people more clarity into the direction that I see Statemint going and what the team at Parity is working on.