SDK meant to unify cross-chain experience on Polkadot — Paraspell XCM SDK

Dudo50
Networks @ FIIT STU
5 min readFeb 6, 2023

This article is a follow-up article Development of ParaSpell — XCM & XCMP tool.

What was the ParaSpell team focused on in the beginning and what we are more focused on now?

At first, in the early stages of XCM, our team focused on analyzing technology and creating UI tool for people to learn XCM from. Technology back then was not working as reliably as it does today. For example, our first local network configuration featured the Polkadot-launch library that soon after our first Milestone for Web 3 Foundation became deprecated. We switched to Parachain-launch. After our delivery, we also noticed, that there is quite a lot of diversity between the XCM pallets nodes implemented. This lead us to the thought of XCM SDK which can unify this cross-chain experience for developers making it much simpler to implement support for cross-chain dApps. Currently, our team focuses mainly on SDK. We also created comprehensive documentation for SDK and are planning on creating a new version of UI that will feature the latest technology when it comes to Vue and Nuxt.

What is XCM SDK and how do I use it?

SDK stands for the Software development kit. Our SDK specifies on enhancing XCM technology across compatible nodes. Currently, this number is 42 and it will keep climbing as more nodes become compatible. SDK also allows for interesting asset operations with assets that are registered on compatible nodes. SDK also offers the ability to open/close HRMP channels & use XYK pallet. There are two patterns that we prepared for developers so SDK can suit their coding style more naturally. Those patterns are:

  • Builder pattern — call construction is very intuitive and currently, this style is very preferred among developers nowadays. It is displayed below.
  • Function pattern — way to construct calls in old-school style. Intuitive to some, becoming deprecated slowly. We will keep support for it however. It is displayed below.

SDK features a wide use case coverage and allows for the following actions:

  • Building XCM Calls in three scenarios (Parachain to Parachain, Parachain to Relay chain, Relay chain to Parachain)
  • Building Opening/Closing HRMP calls
  • Building XYK Pallet calls
  • Querying Assets that are registered on compatible nodes implemented in multiple useful functions for further operations (For example query native assets on Acala, query Relay chain asset symbol for Basilisk Parachain, and more..)
  • Import list of compatible nodes as constant

SDK also handles suggestions for what to enter into the required parts. It also handles errors in regard to entering details that are not correct (for example entered node is not one of 42 compatible and suggested).

These are just sneak peeks of how much we try to focus on developer experience with our SDK. We also print important details when your calls are being constructed so you can be certain you constructed the call you wanted to construct. Examples of suggestions and prints of important details can be seen below.

Above we can see, that SDK suggests what you can use, so you never have to guess. Below we can see important details being printed out while our XCM call is being constructed.

How to use UI and what is it good for?

Now, that XCM technology became much more known among developers UI focuses more on Parachain developers rather than dApp developers. Parachain developers can simply add their node to the localhost network configuration file that the repository has and test out HRMP channels or XCM transactions. It still however serves as a learning tool or an example of SDK implementation for dApp developers also.

UI currently allows for the following actions:

  • Opening HRMP channels between local nodes
  • Closing HRMP channels between local nodes
  • Transferring XCM messages across local nodes (In three scenarios Parachain to Parachain, Parachain to Relay chain & Relay chain to Parachain)
  • Playing with Basilisk XYK pallet for creating DEFI pools and swapping currencies in a decentralized way

The current version of UI also called V1 will soon become deprecated to a version called V2 which will upgrade outdated Vue2 to Vue 3 and add Nuxt along with many modules from the Sub-scaffold template that the ParaSpell team contributed to making.

What is a Sub-scaffold template?

The Sub-scaffold template was created to ease the onboarding experience of Web2 developers onto the Web3 world. It contains a lot of interesting modules like management of logged wallet, asset decimal conversion, list of available assets for compatible nodes pulled from XCM SDK as well as handling of where from and where to are users currently able to transfer which tokens. It also features ParaSpell XCM SDK or interesting KodaDot modules support. More features for this template are coming soon.

Future work for ParaSpell

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. We wish to research this topic more and include full support for it.

Another future work that stays the same from the previous article is including support for XCMP once it comes out. XCMP is still in active development and we currently use it's simplified version called HRMP.

Thanks for making this possible belongs to:

Special thanks to Viki Val, Web3 Foundation Team, the Basilisk node team & excellent Paraspell developers.

--

--

Dudo50
Networks @ FIIT STU

University student, blockchain developer, creator of ParaSpell