The first XCM Router in the Polkadot ecosystem meant to boost cross-chain exchange implementations.

Dudo50
Networks @ FIIT STU
6 min readDec 21, 2023

This follow-up article documents news and state-of-the-art work brought by the ParaSpell team. Previous articles are Development of ParaSpell — XCM & XCMP tool, SDK meant to unify cross-chain experience on Polkadot — Paraspell XCM SDK, ParaSpell XCM SDK Phase 3 innovations & upgrades & The first XCM API in the Polkadot ecosystem meant to boost interoperability integration.

What is ParaSpell

ParaSpell is the organization behind a set of XCM & XCMP tools serving developers and innovators in the Polkadot/Kusama ecosystem. These tools significantly simplify interoperability integration for developers. ParaSpell currently consists of four main repositories:

XCM Router (SpellRouter☄️)

The first XCM Router in the ecosystem. By utilizing XCM SDK and the 9 largest Parachains DEXes, XCM Router allows users to send XCM Exchange Messages across the ecosystem. For example — Transfer DOT from Polkadot and receive ASTR on Astar. All this within one call and three signatures. This seamless operation allows for a better user experience limiting possibilities of user error.

XCM Router brings the following advantages:

  • 579 Asset Pools connected across 9 DEXes and 30 Parachains
  • Largest liquidity bridging tool in the ecosystem
  • Easy to implement — 1 typescript package
  • 3 Calls packed into one call

XCM Router comes with Playground where developers can test out its features and consider which features are needed for their dApp:

The following image is an example of a call from Polkadot — DOT transfer to Astar ASTR through HydraDX Dex:

All this complicated stuff is done for you by the XCM router. You can sit back and relax while you sign three transactions and receive your desired asset on the destination chain.

XCM API (LightSpell⚡️)

The first XCM API in the ecosystem. It uses XCM SDK logic and allows developers to construct XCM calls without the need to install any additional libraries. They can deploy XCM API themselves or use our deployment. XCM API brings the following advantages:

  • No need to install any packages
  • Offloads applications from heavy computing required to construct calls
  • Saves application server costs
  • Allows for simple integration into the application
  • Ability to deploy API yourself to enhance speed and request amount further
  • Durable against DDOS attacks due to limited requests per minute (Upgradeable by request)

XCM API integrates all of the features featured in XCM SDK.

Below we can see a package-less integration example:

XCM SDK ✨

XCM SDK serves many purposes and is very versatile. As its name suggests it mainly focuses on unifying the XCM experience on Polkadot & Kusama. This is possible through lots of research on each compatible Parachain XCM Pallet. This data is collected and unified into a simple package that is easy to implement and can build XCM calls in just one line. This is very needed because most Parachains customize their XCM pallets to fit their use cases and there is a ton of diversity which can make the Polkadot flagship feature hard to implement into applications in a reasonable time. The problem is easily solved by XCM SDK which hides complex logic from developers requiring only a few basic details to be provided.

Calls would look like this if developers were to implement them manually:

And like this after the magic of ParaSpell✨ is applied:

Significantly more lines can be seen in the first picture compared to the second. The complex logic present in the first picture is hidden from the developer that uses XCM SDK and calls are much faster to construct. This can lead to significantly faster application development in the ecosystem.

XCM SDK also comes with other useful features:

  • Ability to do different asset query operations that are useful for the front end (for example Query assets registered on specific Parachain — XCM SDK returns well formatted easy to use JSON object). These asset operations are possible because XCM SDK has an asset map for each implemented Parachain. This means, that Queries are instant and do not require any connection to Parachain to fetch data.
  • Ability to query which XCM Pallets specific implemented Parachain has. This is also possible because XCM SDK has an XCM Pallet map for each implemented Parachain making Query operation instant as they do not need to be fetched from Parachain.
  • Ability to do HRMP channel operations on the locally launched network (Open or Close HRMP channels)
  • Ability to Query Parachain WS ports
  • User error prevention (Unable to create calls between Parachains that are on different Relay chain, unable to transfer asset that is not registered on destination Parachain and more)

XCM DOCS 📚

This repository holds official documentation for all three repositories mentioned above. The main goal is to make documentation as easy to read and understand as possible. The documentation contains important guidance on implementing XCM API, XCM Router and XCM SDK into dApps.

As visible in the picture above, documentation covers every topic that developers need to be able to easily implement our products. Now with a new section covering XCM Router.

Updates we brought since the last report

  • Introducement of the first version of XCM Router — the first cross-chain liquidity routing tool in the Polkadot ecosystem
  • Fixes to XCM SDK (During XCM Router development we encountered a few issues with XCM Transfers that we were now able to fix)
  • Refactoring of multiple XCM SDK functions
  • SDK Amount parameter now contains correct types instead of type Any
  • New WS Port query functionality in XCM SDK
  • We deprecated XYK in SDK and UI V2 (As most developers now opt for XCM API and XCM Router)

Future work

As technology always progresses we strive to bring the newest and freshest features. One of the recent updates to XCM technology was support for NFT (Non-fungible) tokens. As a long-term goal, we wish to research this topic more and include full support for it as soon as XCM v4 rolls out making our products even more helpful to the community and developers.

Our main short-term goal is to continue maintaining our repositories under maintenance funding. We also wish to regroup all XCM Tool repositories into monorepository for the ability to share common types, save code and reduce package sizes even further.

Thanks for making this possible goes to

Special thanks belong to the Web3 Foundation Team for their continuous support of our development. Another significant thank you goes to the excellent Paraspell developers.

--

--

Dudo50
Networks @ FIIT STU

University student, blockchain developer, creator of ParaSpell