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.
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:
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.
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
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.
Console printouts, SDK allows for printing into console so developer can alway check if call they constructed is correct.
Exporting registered assets for each compatible node in many useful functions
Exporting supported XCM pallets for each compatible node in useful functions
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:
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.
Above we can observe, that UI contains simple Wallet login with test accounts.
Above we can see XCM screen which is also very simple to navigate and nodes are pulled from relay chain by query.
Docs contain important information regarding SDK, UI and other repositories that are in ParaSpell or ParaSpell contributed to / collaborated with. The key areas are:
Guide on importing SDK
Guide on launching local network and UI
Guide on executing operations in UI
Guide on implementing SDK
- Important links
The old design had SDK integrated into dApp:
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.
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.
Technology Stack 💻️
- Polkadot api libraries
- Parachain launch
- Substrate compatible nodes (For now Rococo, Pichiu(Kylin network), Bifrost & Acala)
Ecosystem Fit 🌳
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.
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 | Features | ParaSpell XCM SDK | Moonbeam XCM SDK | | -----: | ----------- | ------------- | | Number of packages user has to install | User needs to install only 1 package | User needs to install 2 packages | | Support for Parachains | Already integrated for every XCM compatible pallet | Every new node has to be added manually by user | | Build pattern | Integrated as intuitive as possible | Integrated, not as intuitive to implement however | | Support for asset pallet operations | Integrated | Not integrated | | Support for HRMP pallet operations | Integrated users can open & close HRMP channels on their local chain (Useful feature for devs) | Not integrated | | Support for checking details that do not change | Integrated & 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 chains | Planned to be implemented in the future | No 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 | Features | ParaSpell XCM UI | Morph | | -----: | ----------- | ------------- | | Focus: | Developers & users that wish to try XCM locally first | Users | | Wiki: | Comprehensive Wiki explaining XCM, how to add assets to UI & Nodes and more implemented | Not implemented | | Support for transfers: | In three different scenarios | In two scenarios | | Support for local network configuration: | Fully implemented example network configuration that uses maintained Parachain-launch library | Not implemented | | Support for HRMP channel opening/closing: | Fully implemented | Not 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.
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 Name: Dušan Morháč
- Contact Email: email@example.com
- Registered Address: Tomášovská 453/2, Kalinovo 98501, Slovak Republic
- Registered Legal Entity: Dušan Morháč
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
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 🔩
- 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 💰️
|0b.||Documentation||We will provide both readme.md and official docs documentation|
|0c.||Testing and Testing Guide||Testing guide will be mentioned in official docs & core unit tests will be provided|
|0e.||Create Medium article about development of LightSpell||Add article covering new features & improvements brought with LightSpell|
|1.a||Integrate API for XCM functionality||Use Nest.js to integrate core XCM SDK functionality to send XCM messages|
|1.b||Integrate API for Asset functionality||Use Nest.js to integrate core XCM SDK functionality to do Asset operations|
|1.c||Integrate API for XCM Pallets functionality||Use Nest.js to integrate core XCM SDK functionality to query XCM Pallets of different Parachains|
|1.d||Integrate API for HRMP functionality||Use Nest.js to integrate core XCM SDK functionality to open/close HRMP channels|
|2.||Integrate token authentification||Integrate 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.a||Add core Integration tests||Add core Integration tests to ensure everything is working together as expected|
|3.b||Add core Endpoint (e2e) tests||Add 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 docs||Add 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]