Introduce the New Features of Zenlink Protocol v0.4.1
According to the latest news disclosed by Polkadot founder Gavin Wood at Polkadot Decoded, a virtual conference for the Polkadot community, Kusama will launch their parachain auctions next week. Zenlink has been closely following the official development progress of Polkadot (which has been updated frequently) so as to improve Zenlink Protocol. Now Zenlink Protocol v0.4.1 has been released and we are inviting our partners to integrate this version and test on it.
In this article, we will introduce the new features and design details of Zenlink Protocol v0.4.1 to give community members a better understanding of both Zenlink Protocol v0.4.1 and Zenlink itself.
Zenlink Protocol Core Architecture
Zenlink Protocol mainly consists of two parts: Zenlink Assets
and Zenlink Actions
. Based on the latest version of Zenlink Protocol v0.4.1, Zenlink will be able to exchange (Swap
) and realize the cross-chain transfer (Transfer By XCM
) of any asset on the chain.
Zenlink Protocol v0.4.1 Feature
- Based on the latest XCM protocol design
Recently Gavin had announced that he would restructure the XCM protocol and released a to-do list of refactoring XCM on Github. Zenlink has been following the latest developments of Polkadot XCM and upgrading the development of Zenlink Protocol. Based on the latest XCM protocol, Zenlink Protocol v0.4.1 has realized the free exchange of assets between parachains. - Follow the FRAMEv2 development specification
Zenlink Protocol v0.4.1 follows the latest FRAMEv2 development specifications for development. - Configurable swap rate (exchange fee)
With regard to the configuration of swap rates (exchange fee), Zenlink Protocol v0.4.1 has realized the customized swap rates setting for different integrators. As the swap rate is fixed at 0.3% in our first public test, some of our partners suggested that a configurable swap rate will help to improve the flexibility of deploying Swap functions, Zenlink Protocol v0.4.1 will solve this problem very well. - Compatible with Polkadot XCMP cross-chain asset processing
Zenlink Protocol v0.4.1 is compatible with Polkadot XCMP cross-chain asset processing in its design, and there will be a separate Transactor for Zenlink’s cross-chain asset processing, so that Zenlink can coexist with other cross-chain asset modules. - Zenlink Protocol whitelist registration — XCM trust collection management
At the time of actual deployment, Zenlink Protocol v0.4.1 will provide a whitelist registration mechanism for parachain projects, allowing assets to flow freely across parachains. - Assets can flow freely between parachains through Transfer-By-XCM
Zenlink Protocol v0.4.1 reconstructs the Transfer-By-XCM module, through which users will be able to transfer assets across any parachain and it can be separated from the Swap module, which greatly enriches the asset operation of users and give Zenlink integrators more choices at the same time.
The following features involve more specific implementations of protocols and will not be described in details here:
- The ZenlinkMultiAssets adapter comes with
Liquidity
andForeign
asset processing, which can be adapted to a variety of native assets such asNATIVE/LOCAL/RESERVE
. - Provides trait, such as LocalAssetHandler, OtherAssetHandler to support locally defined assets such as
LOCAL
andRESERVE
. - Assets under the control of
MultiAssetsHandler
are freely convertible.
Uniform Asset Identifier UAI v0.1.0
In previous versions, Zenlink used a triple (chain_id + module_index + asset_index
) to identify unique assets in the Polkadot parachain. During the iteration, we gave more accurate and specific meaning to the second field, module_index, and abstracted it into a uniform resource identifier (Uniform AssetId Identifier, UAI
), with the current version v0.1.0.
UAI v0.1.0 Definition
pub struct AssetId {
pub chain_id: u32, // Parachain ParaId
pub asset_type: u8, // Asset classes supported by Zenlink Assets
pub asset_index: u32, // Index number of the asset
}
asset_type
currently supports only the following values.
/// Native currency, The most basic assets on each Parachain
pub const NATIVE: u8 = 0;
/// Swap module asset, LP token generated by Zenlink DEX
pub const LIQUIDITY: u8 = 1;
/// Other asset type on this chain, Other asset modules on the native chain
pub const LOCAL: u8 = 2;
/// Reserved for future, Type of assets set aside
pub const RESERVED: u8 = 3;
In UAI v0.1.0, Zenlink Assets
supports a maximum of four locally defined assets: NATIVE/LIQUIDITY/LOCAL/RESERVED
. When these four kinds of assets are transferred across chains, a cross-chain mapping asset class Foreign
will be generated within the Zenlink Protocol, and the UAI
of the assets will not change before and after the cross-chain asset transfer.
Swap and Transfer-By-XCM
- Assets can be exchanged between the four original defined assets (
NATIVE/LIQUIDITY/LOCAL/RESERVED
) and the cross-chain mapped assets (Foreign
) via theMultiAssetsHandler
. - Four native definition assets (
NATIVE/LIQUIDITY/LOCAL/RESERVED
) are transferred across chains viaTransfer-By-XCM
to generate the mapped assetForeign
, which is also transferred back to the asset's native definition chain across chains viaTransfer-By-XCM
, on the target parachain.
Note
Cross-chain asset transfer (Transfer-By-XCM
) requires an HRMP Channel
to be opened between parachains in the registration whitelist.
Summary
Zenlink Protocol v0.4.1 mainly adapts to the latest Polkadot v0.9.1 code, has the ability to quickly integrate into the latest parachains, and optimizes the internal routing and asset representation scheme to unify the external exposure interface through abstraction.
New features such as configurable swap rates (exchange fee), compatibility with Polkadot XCMP cross-chain asset processing, and the provision of Zenlink Protocol registration whitelist will greatly improve the flexibility and versatility of Zenlink.
At the same time, the WASM version of Zenlink Protocol v0.4.1 has also been upgraded, so that Zenlink also has the ability to deploy to the WASM contract parachain in the first place, and the applicability of the platform has been greatly improved.
Above are the main design details of Zenlink Protocol v0.4.1, more technical details about Zenlink can be found at Github, and we will open source it before or after the mainnet launch.
📍 — Website | Twitter| Github | Telegram EN | Telegram CN | Announcements Channel
📚 — Whitepaper