Skip to main content

LightSpell XCM API by ParaSpell✨

  • Team Name: ParaSpell✨
  • Payment Address: 0xB7d45Ef044fD9342e4c03e28D9e9bddA2d4Fe3e1 (USDC)
  • Level: 1 🐣

Project Overview 📄

Previously completed grants:

What is ParaSpell: ParaSpell is an XCM & XCMP Developer tool meant to ease the integration of cross-chain functionality into dApps. As we have learnt by now, cross-chain experience between Parachains can be very diverse. ParaSpell means to unify this experience by doing all the research for developers. We have wrapped all XCM pallets from compatible nodes into simple patterns from which it is easy to create XCM calls. As an example, we provide the image below.

img1

In this image, we can see, that ParaSpell saves much time for developers. Just one call can contain multiple lines of JSON which would otherwise have to be integrated manually by the developer. ParaSpell does it in marginally fewer lines and hides the complex logic of building messages which ensures, that messages are constructed correctly. This call in the end results in the following lengthy extrinsic:

img2

The following extrinsic can be subscribed into and we can check for its events on the front end. ParaSpell provides the front end for testing XCM transactions and XCM called UI-V2. This UI is also deployed on Netlify so users only have to run the local network to start testing. UI also provides the ability to open or close HRMP channels or test out XYK pool functionality that was implemented in collaboration with the HydraDX team. In the picture below we provide an overview of the UI.

Screenshot 2023-02-15 at 10 36 01

Overview 🎨

ParaSpell is split into three main repositories at the moment and one new is being added soon:

  • XCM API - TBA: Meant to provide much faster response than integrating XCM SDK as well as being easier to integrate than XCM-SDK (No install needed)
  • XCM SDK: Meant to unify cross-chain experience on Substrate. Can serve any dApp developer that wishes to integrate XCM or other pallets support for they app.
  • UI-V2: Allows for launching local network and testing XCM or HRMP channels across that local network
  • Docs: Extensive documentary for overview of ParaSpell, guide for SDK and UI

SDK

This SDK currently support 46 compatible XCM nodes. They can transfer XCM messages in three different scenarios.

  • Parachain to Parachain - HRMP
  • Parachain to Relay chain - UMP
  • Relay chain to Parachain - DMP

SDK contains many useful features that allow for easier inntegration:

  • Builder pattern implementation, easy to construct XCM calls, much more used recently for simplicity of implementation.

  • Suggestions, SDK contains TYPES that help to guide developer through integration. For example he get's compatible nodes suggested. 1_59xApnboumYhzuRHKx60TA

  • Console printouts, SDK allows for printing into console so developer can alway check if call they constructed is correct. 1_2KT6Z1rxxprmE03XWYY-HA

  • Exporting registered assets for each compatible node in many useful functions

  • Exporting supported XCM pallets for each compatible node in useful functions

And more..

UI-V2

UI is used as testing tool for Parachain developers, they can simply add their node into network and test it with HRMP channels as well as XCM transfers. UI also allows dApp developers to test and learn XCM before integrating it from our SDK.

UI is made to be as simple to use as possible. It is now also deployed on netlify so developers only have to start local network from configuration file provided by ParaSpell which starts network of Relay chain and 3 different Parachains (Bifrost,Karura & Pichiu)

Below are some examples of UI with running network:

Screenshot 2023-02-16 at 13 31 06

Above we can see open/ close channel screen. It is simple to work with and intuitive. Nodes are pulled from relay chain by query so if network is not running you cannot see any nodes.

Screenshot 2023-02-16 at 13 31 20

Above we can observe, that UI contains simple Wallet login with test accounts.

Screenshot 2023-02-16 at 13 31 33

Above we can see XCM screen which is also very simple to navigate and nodes are pulled from relay chain by query.

Docs

Docs contain important information regarding SDK, UI and other repositories that are in ParaSpell or ParaSpell contributed to / collaborated with. The key areas are:

  • Introduction
Screenshot 2023-02-16 at 13 44 58
  • Guide on importing SDK
Screenshot 2023-02-16 at 13 45 09
  • Guide on launching local network and UI
Screenshot 2023-02-16 at 13 48 43
  • Guide on executing operations in UI
Screenshot 2023-02-16 at 13 45 24
  • Guide on implementing SDK
Screenshot 2023-02-16 at 13 46 01
  • Important links
Screenshot 2023-02-16 at 13 45 30

Architecture 🏗️

Old

The old design had SDK integrated into dApp:

taskFlow

UI is purposely designed to be as simple as possible. This guarantees, that all tasks can be done quickly and without extended searching. All necessary screens also feature notifications which will as a milestone explain be callback reactive. The loading screen is only present on the first application & network startup, once accessing the same screen after the application was loaded it will be skipped automatically. The screen serves to register necessary assets in parachain nodes. This is only required to be run once per network startup.

SDK currently handles transfers to 46 compatible Parachains and also can transfer to both Relay chains.

New

In the new design with XCM API, there is no need for integrating XCM SDK. There is only a need to send the request. No more installing packages. Works way faster and offloads dApp from heavy computing to generate calls. taskFlowNew

Technology Stack 💻️

  • Vue.js
  • Node.js
  • Typescript
  • Polkadot api libraries
  • Make
  • Parachain launch
  • Substrate compatible nodes (For now Rococo, Pichiu(Kylin network), Bifrost & Acala)
  • Nest.js

Ecosystem Fit 🌳

XCM API

As mentioned in a tweet from Alice&Bob, we need Chain APIs to put XCM on steroids - link. We aim to achieve this by utilizing the XCM-SDK technology we built previously. Using XCM API compared to implementing XCM SDK into dApp can bring three main benefits:

  • Calls are generated much quicker
  • API is much simpler to implement than SDK
  • No need to install anything (Comes with the benefit of saving space and without issues with dependencies)

Why we chose NestJS for XCM API: By choosing Nest.js as our backend HTTP REST API framework, we can harness the power of Node.js, leverage TypeScript's benefits, ensure maintainability through its modular architecture, and take advantage of its extensive community support. This will enable us to build a reliable, scalable, and well-documented XCM API that seamlessly integrates with the existing XCM SDK. In addition, Nest.js offers a powerful code generation feature that allows us to quickly scaffold boilerplate code for controllers, services, modules, and more. By utilizing the Nest.js code generator, we can significantly reduce development time and effort, ensuring rapid prototyping and efficient implementation of the XCM API endpoints. Compared to other TypeScript frameworks, Nest.js stands out with its modular architecture, seamless integration with Node.js, and strong community support, offering developers a scalable and maintainable solution.

XCM SDK

There are not many XCM & XCMP-related development tools released currently. We aim to aid this mostly empty space and help developers to understand XCM & XCMP as the current state-of-the-art technology by providing documentation and a user interface in which they can do development tasks more easily and faster.

In Polkadot and Kusama ecosystems, there are few XCM-related tools in development. For example, Moonbeam XCM SDK was released only recently. We bring a comparison table that compares our ParaSpell SDK to Moonbeam SDK

FeaturesParaSpell XCM SDKMoonbeam XCM SDK
Number of packages user has to installUser needs to install only 1 packageUser needs to install 2 packages
Support for ParachainsAlready integrated for every XCM compatible palletEvery new node has to be added manually by user
Build patternIntegrated as intuitive as possibleIntegrated, not as intuitive to implement however
Support for asset pallet operationsIntegratedNot integrated
Support for HRMP pallet operationsIntegrated users can open & close HRMP channels on their local chain (Useful feature for devs)Not integrated
Support for checking details that do not changeIntegrated & also be covered with some error handling eg (too little amount being sent, not sufficient for XCM transfer)Integrated in the form of a small "map" for different Tokens & Node IDs
Support for Axelar GMP (General message passing) that will connect Substrate with EVM chainsPlanned to be implemented in the futureNo data

Unlike the already mentioned "Moonbeam XCM" platform ParaSpell provides UI enhancement that uses our XCM SDK and users can try/learn technology from it. ParaSpell also includes support for 46 Substrate Parachains that have XCM pallets compared to Moonbeam XCM to which users have to implement compatible nodes manually. ParaSpell SDK only needs one package compared to Moonbeam XCM which has a total of two. Compared to Moonbeam XCM which contains only XCM calls ParaSpell also contains calls that can open or close HRMP channels. We also include support for Parachains that have a template pallet for XCM called polkadotXCM this pallet is a little harder to work with than xTokens, even more for inexperienced developers. On top of that, this proposal aims to improve ParaSpell even further with introduction of LightSpell XCM API. We have not yet seen any XCM-API proposals or project and we aim to solve this gap as first team.

Another comparison worth mentioning is UI vs Morph which is also an enhancement of the XCM UI Transfer tool

FeaturesParaSpell XCM UIMorph
Focus:Developers & users that wish to try XCM locally firstUsers
Wiki:Comprehensive Wiki explaining XCM, how to add assets to UI & Nodes and more implementedNot implemented
Support for transfers:In three different scenariosIn two scenarios
Support for local network configuration:Fully implemented example network configuration that uses maintained Parachain-launch libraryNot implemented
Support for HRMP channel opening/closing:Fully implementedNot implemented

Unlike the already mentioned "Morph" platform ParaSpell focuses more on developers. ParaSpell features complete network install and startup configuration in one single command. This automatization ensures, that developers do not need to do any extra tasks when they wish to run development nodes locally. ParaSpell also allows developers to open and close HRMP channels between Parachains they connected. Like "Morph", ParaSpell can also transfer fungible tokens in three scenarios. From Parachains to Relay chain, from Relay chain to Parachains & from Parachains to Parachains.

We are currently in talks with several Parachain teams that like the idea of unified SDK for XCM transfers as much as we do. SDK that unifies XCM can be very helpful for the entire ecosystem in our opinion. With the introduction of XCM API, this improves even further.

Our target audiences are Web3 projects and starting/current blockchain developers.

Team 👥

Team members

Dušan Morháč - Student, project Founder & Core Dev. Faculty of Informatics and Information Technologies STU in Bratislava

Michael Absolon - Student, XCM SDK & XCM API Core Dev. Faculty of Informatics and Information Technologies STU in Bratislava

Contact

  • Registered Address: Tomášovská 453/2, Kalinovo 98501, Slovak Republic
  • Registered Legal Entity: Dušan Morháč

Team's experience

  • Dušan is the founder & researcher behind this project and he has successfully presented it at the international conference ICECET2022 held in Prague from which there is an article regarding XCMP & ParaSpell project. It is published by IEEE link. He also successfully presented it at ICBC 2023 conference held in Dubai. Dušan also studies Blockchain technology and had a bachelor's thesis about cross-blockchain sharing from which this idea was born. Dušan continues research on this idea in his Master's thesis. He is actively working on ParaSpell https://github.com/paraspell full-time & has also participated in other ecosystem projects. Recently he attended Polkadot Blockchain Academy 2023 in Buenos Aires which gave him a lot of insight into the ecosystem and he also graduated from the academy successfully. Here is NFT that was minted as a certificate by Parity - link
  • Michael is a dedicated TypeScript developer with 2 years of full-time experience in the Web2 sphere. Michael's expertise in this field was further solidified in 2019 when he won first place in the Junior Internet Web competition for his online multiplayer game, which was written in JavaScript. In addition to his professional background, Michael also achieved a bachelor's degree in the same computer science University as Dušan and he is currently pursuing a master's degree which focuses on Blockchain. His passion for technology led him to explore Blockchain technology in his free time. He was recently offered the opportunity to work on ParaSpell XCM SDK with Dušan and he delivered many of the key features SDK now offers.

Team Code Repos

Team Github Profiles 🧑‍🎓

Team LinkedIn Profiles 🧑‍🎓

Development Status 📖

The new XCM-API is in development and we are currently searching for the fastest server with the lowest cost requirements.

SDK is currently released into the main and is in a version that is fully operable. There are still some tweaks we plan to add and make, they are not part of this grant however. UI-V2 currently runs on state-of-the-art technology version VueJS 3 and the newest version of Nuxt. It deprecated V1 and introduced a much smoother interface and modules brought from the sub-scaffold template ParaSpell contributed to. Docs are currently in ready state but there is still some tweaking to do.

Sidenote: We have recently developed an article about Polkadot & Paraspell called Enhancing XCMP Interoperability Across Polkadot Paraverse and it was accepted to the International IEEE BCCA 2023 conference held in Kuwait.

Development Roadmap 🔩

Overview

  • Total Estimated Duration: 2 months
  • Full-Time Equivalent (FTE): 1 FTE
  • Total Costs: 10 000 USD

Milestone 1 - Create LightSpell⚡️: XCM-API

  • Estimated duration: 2 months ⌛️
  • FTE: 1
  • Costs: 10 000 USD 💰️
NumberDeliverableSpecification
0a.LicenseMIT
0b.DocumentationWe will provide both readme.md and official docs documentation
0c.Testing and Testing GuideTesting guide will be mentioned in official docs & core unit tests will be provided
0e.Create Medium article about development of LightSpellAdd article covering new features & improvements brought with LightSpell
1.aIntegrate API for XCM functionalityUse Nest.js to integrate core XCM SDK functionality to send XCM messages
1.bIntegrate API for Asset functionalityUse Nest.js to integrate core XCM SDK functionality to do Asset operations
1.cIntegrate API for XCM Pallets functionalityUse Nest.js to integrate core XCM SDK functionality to query XCM Pallets of different Parachains
1.dIntegrate API for HRMP functionalityUse Nest.js to integrate core XCM SDK functionality to open/close HRMP channels
2.Integrate token authentificationIntegrate token authentification with limited requests to remove the possibility of DDOS (Bigger request limit can be requested for free via email provided in docs)
3.aAdd core Integration testsAdd core Integration tests to ensure everything is working together as expected
3.bAdd core Endpoint (e2e) testsAdd core endpoint tests to let the user try to use API without writing any code and also to demonstrate if API works
4.Integrate LightSpell into ParaSpell docsAdd comprehensive guide for every feature that API will offer link

Future Plans 🔭

Once everything will be implemented according to the proposed plan application will still be under constant improvement as technology will progress. For example, once the XCMP protocol will be released we wish to deprecate the HRMP protocol we currently use for channels.

The project goal is that XCM-SDK & XCM-API will serve dApp developers and UI will teach new substrate developers to use XCM and will serve existing substrate developers to test their freshly baked Parachains.

The newly added XCM-API will simplify XCM-SDK integration and will be much faster than integrating XCM-SDK into dAPP directly. Both repositories will remain dependent on each other. Further maintenance funding for servers and keeping XCM API up to date will be requested from Polkadot treasury.

Additional Information

How did you hear about the Grants Program? Personal recommendation

Project achievements in chronological order ⌛️
  • 📙 Article about the project created & presented at international conference ICECET2022 held in Prague (450 out of 1000+ articles accepted) Link to IEEE publication - IEEE Sharing Fungible Assets Across Polkadot Paraverse
  • 🥈 2nd Prize, Build an XCM-related Tool for Moonbeam - Polkadot North America Hackathon Hackathon entry
  • 🥉 3rd Prize, EVM+ DApp for aUSD yield - Polkadot North America Hackathon Hackathon entry
  • 🎈 Web 3 Foundation base grant Application, Delivery
  • 🐍 Basilisk treasury proposal 2 / 2 Approved link, link2
  • 🔭 Web 3 Foundation phase 2 grant Milestone 3 / 3 delivered Application, Delivery1, Delivery 2 & 3
  • 📕 Article about Polkadot & ParaSpell created & accepted to be presented at international cross-chain conference IEEE ICBC 2023 held in Dubai [links TBA]
  • 💼 Kusama Treasury Funding proposal number 1 - Upgrade SDK, Application, Delivery
  • 🏗️ Web 3 Foundation phase 3 grant (Make SDK better) Milestone 1 / 1 delivered Application, Delivery
  • 📘 Article about Polkadot & ParaSpell created & accepted to be presented at international cross-chain conference IEEE BCCA 2023 held in Kuwait [links TBA]