The first XCM API in the Polkadot ecosystem meant to boost interoperability integration.

Dudo50
Networks @ FIIT STU
5 min readAug 22, 2023

This is a follow-up article that 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.

What is ParaSpell

ParaSpell is XCM & XCMP tool serving developers and innovators in the Polkadot/Kusama ecosystem. It significantly simplifies interoperability integration for developers. ParaSpell consists of four main repositories:

XCM API

We brought the first XCM API into 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. We collect them and unify them 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. This is easily solved by our XCM SDK which hides complex logic from developers requiring only a few basic details to be provided:

  • Origin Parachain name (optional: not required for Relay to Parachain transfer scenario)
  • Destination Parachain name (optional: not required for Parachain to Relay chain transfer scenario)
  • Currency symbol or id (optional: not required for both Parachain to Relay chain and Relay chain to Parachain transfer scenarios)
  • Destination wallet address
  • Amount to be transferred

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

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

We can see significantly more lines 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 use Basilisk XYK Pool operations
  • 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 UI

XCM UI serves as an example of a simple front-end that implements XCM SDK and allows users to test and play with XCM on a local network they can launch from our config. There are two configs available for two different startup libraries:

  • Zombienet (Currently Linux only)
  • Parachain launch (Linux and macOS ready)

XCM DOCS

This repository holds our official documentation. We always strive to make our documentation as easy to read and understand as possible. The documentation contains important guidance on implementing XCM API or XCM SDK into your dApp or how to operate XCM UI and start the localhost network along it for testing.

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 API, a redesign of the welcome page and a list of implemented Parachains at the bottom.

Updates we brought since the last report

  • Introducement of the first XCM API in the Polkadot ecosystem (Supporting XCM, Asset, XCM Pallet and HRMP operations)
  • Added system for simpler XCM version selection in XCM SDK (simpler to implement new compatible Parachains and migrate XCM version on already implemented Parachains)
  • In Parachain to Relay chain XCM SDK scenario we removed unnecessary currency parameter (XCM SDK is now able to cleverly determine which Relay chain user transfers their tokens to based on the Relay chain asset symbol assigned to each Parachain in the asset map)
  • New XCM SDK error: The user is unable to send tokens to Parachain on different Relay chain — further preventing user errors
  • Fix to assetUpdate XCM SDK script which was unable to fetch the newest assets from certain Parachains preventing asset map from being updated
  • Official documentation now includes a complex guide for XCM API. It also got new pages and a slight redesign of the welcome page.

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 as soon as XCM v4 rolls out making our products even more helpful to the community and developers.

Thanks for making this possible belongs to:

Special thanks belong to 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