Polkadot-API 2024-Q1 update

:wave: Hi there!

In my previous post, I shared my vision for the future of the Polkadot-API. It’s been an exhilarating journey, and together, we (yes, in plural!) are thrilled to announce that the first beta version is now available! Let’s take a moment to walk through our progress, step by step.

Our First Quarter Supported by the Treasury

During the first quarter, we presented our ambitious plan to the Polkadot community, outlined in our proposal here. Our goal is to create a minimal, library-agnostic interface that facilitates interactions with Polkadot-based chains. Additionally, we aim to leverage key components within our ecosystem, such as smoldot, integrated via the new JSON-RPC API, to enhance the functionality of the Polkadot Client.

We Delivered!

polkadot-api v0.1.0 Released!

We’re excited to announce that just a few days ago, we released the first beta version of the polkadot-api package! This marks a significant milestone as polkadot-api now adheres to the semver specification, and we are committed to providing CHANGELOGs for every version released. The package is tree-shakable, developer-friendly, and optimized for easy bundling, featuring numerous subpaths.

A massive “thank you” goes to Ajay Dhore who kindly relinquished his unused package name polkadot_api, allowing us to secure polkadot-api for our use. In recognition of his generosity, we are proposing an OpenGov tip to ensure he feels appreciated by our vibrant community.


We’ve also launched a comprehensive dapp example named papi-teleporter. This tool facilitates the teleportation of assets between the relay chain and asset hubs across Polkadot, Kusama, Westend, and Rococo, as well as between Polkadot and Kusama themselves. Utilizing smoldot, it connects seamlessly to these chains. The source code is public and available for use here!

Polkadot-API Documentation is Live! :rocket:

We are thrilled to present the first version of our documentation, meticulously designed to assist new users during their onboarding process. Documentation has become a cornerstone of our strategy to reduce barriers for developers in the Polkadot ecosystem.

Codegen Enhancements and Documentation for Intellisense

Significant progress has been made in code generation, thanks to @voliva, who developed a sophisticated method for generating code from any metadata. This feature enhances the developer experience by providing strongly typed calls for runtime transactions and more, all accessible through our CLI papi. Additionally, metadata documentation is now integrated with your editor’s Intellisense, allowing for direct navigation while coding.

At the recent Polkadot Summit in Bangkok, @voliva showcased our innovative approach to generating checksums for any type in the runtime metadata, including enums and cyclic types—a truly remarkable advancement!

Recovering from the stop Event

A stop event is typically undesirable during execution, but we have developed a robust strategy to handle it. As outlined in the new JSON-RPC API documentation, we’ve implemented a reliable recovery process. In most scenarios, dApps will seamlessly continue operations without any awareness of the event, as we can swiftly reconnect and restore the state, including the completion of any interrupted operations. Kudos to @voliva for this incredible achievement!

Leveraging the New Tx Broadcast API

We are pleased to confirm the successful implementation of the new Transaction Broadcast API, a fundamental component of the Polkadot-API’s functionality. This allows us to stay at the forefront of the latest features in the new JSON-RPC API. PR.

Support for Early Adopters

We owe a huge thank you to @mcornholio, Philip Poloczek, @wirednkod, and all our early adopters who have played a crucial role in refining Polkadot-API. Their diligent efforts in finding bugs, suggesting improvements, and seeking guidance have been invaluable. We’ve made it a priority to be as responsive as possible, assisting everyone eager to integrate Polkadot-API into their projects.

A special shout-out to @mcornholio, whose keen eye for detail has led to the discovery of the most bugs and edge cases. His contributions have been instrumental, providing detailed logs and methods to reproduce the issues he encountered. His vigilance even identified an issue with the Polkadot-SDK.

Reporting Bugs to smoldot and polkadot-sdk

Throughout development, we’ve encountered several discrepancies within the sdk and smoldot. We are delighted by the enhanced communication and collaboration with other teams in the ecosystem, which have been crucial to our mutual improvement. Instances of our collaborative efforts include bug reports and fixes documented in these links: 1, 2, 3, and 4. These interactions have significantly benefitted the broader Polkadot community, helping to stabilize and strengthen our shared technological foundations.


Asset Management

Following the approval of our first proposal, we observed that the price of DOT was significantly higher than at the time we submitted our proposal. In response to this favorable market condition, we opted to retain the excess DOT in our pure-proxy multisig. We staked these additional funds to contribute to the security of the network. This strategic decision allows us to utilize the excess DOT to offset potential decreases in future proposal valuations due to market fluctuations.

Asset Incident

Following the disbursement from our first proposal, we utilized HydraDX for the conversion of DOT into USDT. Unfortunately, a knowledge gap led to the temporary loss of control over the USDT tokens (~100k USDT). We promptly addressed this issue with the HydraDX community, and through the robust mechanisms of our governance system, we successfully regained access to the funds via a referendum. We are immensely grateful to the HydraDX council and its remarkable community for their support and cooperation in resolving this matter. :pray:

We’re Growing!

Víctor Oliva (aka @voliva)

Since introducing him in our first proposal to the Treasury, @voliva’s first quarter with the project has been nothing short of phenomenal. He has played a pivotal role in defining the architecture of the Polkadot-API and has pioneered innovative features such as type-checksum based on JS-types. His contributions are vital to the ongoing development and success of the project.

Carlo Sala (aka @carlosala)

We are excited to announce that our team is expanding! Many of you may already be familiar with @carlosala from his active involvement in the community. He has now joined our project as the third team member. Carlo brings a wealth of technical expertise and social acumen, positioning him as the public face of the project. Keep an eye on the repo, as he will soon start contributing!

Streamsphere Labs is Here!

To better organize the financial aspect of our project, @voliva and @josep have established Streamsphere Labs as a Spanish SL (similar to an LLC). This new structure will streamline our operations and financial management. Moving forward, proposals for the Polkadot-API will be submitted under the Streamsphere Labs banner.

Path Forward

Path to v1

As outlined in our Q4 2023 recap, our objective remains steadfast: to release Polkadot-API v1 by the end of Q2. This quarter, our efforts are concentrated on stabilizing the libraries to ensure that v1 is robust, stable, and as free from bugs and inconsistencies as possible. We anticipate no major breaking changes during this period.

Imminent Improvements

Transaction Enhancements

Feedback from our early adopters has highlighted three key areas for improvement in transaction handling:

  1. Enhanced Error Reporting: We will enhance support for transactions that fail after being broadcasted, providing a strongly typed error message to help dApp developers quickly understand the issue.
  2. More Events in Transaction Submission:
    • We will introduce an event to notify developers when a transaction becomes invalid after broadcast.
    • An additional event will be added to alert developers if a transaction is no longer in the canonical chain after we have reported the txInBestBlock event. This will aid developers in tracking the status of their transactions.
  3. Easier Access to Transaction Hashes: We plan to simplify how developers can retrieve transaction hashes.

Codegen Enhancements

We aim to make significant improvements in the following areas:

  1. Reduced Bundle Sizes: We have identified strategies to decrease our bundle sizes effectively.
  2. Whitelisted Descriptors API: We are exploring the feasibility of introducing an API for whitelisted descriptors. This is currently under research.

We have outlined an ambitious yet achievable roadmap to realize these enhancements.

Collaboration with Other Stakeholders

This quarter, we are particularly focused on assisting other community members, such as wallet developers and tool builders. Our goal is to guide them and understand how our lower-level libraries can be integrated into their tools and dApps, facilitating a smoother transition to using Polkadot-API.

Participation at PBA

@josep and @voliva will be attending the forthcoming PBA event in Singapore in June 2024. During this time, development on Polkadot-API may slow slightly, although @josep is known for his dedication to working through the night! By then, @carlosala will be fully integrated into the team, ensuring that both development and support for early adopters will continue unabated. We are grateful to the PBA organizers for this incredible opportunity and believe that a deeper understanding of the underlying technology will significantly enhance our ability to improve the tools we are developing.

Upcoming OpenGov Proposal

In the next few hours, we will be publishing our second OpenGov proposal. Please stay tuned and lend your support to help us continue our work in delivering impactful solutions! Your support is crucial for our ongoing development and success. Stay involved, and let’s keep pushing boundaries together! :rocket:


Great progress! Thanks, @josep!

1 Like

Epic work! Amazing that we got the name :star_struck:

1 Like