Enhancing Rust RPC Client and Nodes for Celestia Network

Subscribe to our newsletter
December 15, 2023

Enhancing Rust RPC Client and Nodes for Celestia Network

Introduction

Celestia is a data-availability network that offers a modular approach to blockchain architecture. In this case study, we delve into a project undertaken to elevate the functionality of the Rust RPC client and Rust nodes within the Celestia network. Our goal was to simplify the interaction between developers and the Celestia network, making it more accessible and efficient.

Type Analogues and RPC Interaction

To kickstart this project, our team focused on creating type analogues inspired by the Celestia-node. These analogues were designed to act as essential building blocks, streamlining the process of setting up necessary types for RPC (Remote Procedure Call) operations, and serve as the foundation for a functional Rust RPC client and node.

This significantly simplified the development process and fostered a smoother interaction between developers and the Celestia network.

Empowering Inclusion Proofs through NMT Interaction

One of the project's pivotal aspects was to enhance the interaction with the Namespaced Merkle Tree (NMT). In the Celestia network, inclusion proofs play a crucial role in ensuring data integrity. To make this process efficient, we needed a robust mechanism for verifying these proofs.

While there was already a Rust NMT crate available, it required enhancements to meet the dynamic requirements of the Celestia network. We took on the task of expanding the capabilities of the existing NMT crate to handle namespaces of varying sizes. This enhancement was a game-changer, aligning the crate perfectly with Celestia's versatile needs.

Key Focus Areas:

  1. Blob Type Implementation and Commitment Logic: A significant portion of our efforts was dedicated to implementing the blob type and integrating the logic required for generating commitments. This accomplishment streamlined the management of data blobs, making them easily retrievable using the RPC's blob module. 
  2. Modification of nmt-rs crate: We extended the capabilities of the nmt-rs crate by adding support for namespaces of different sizes with constant generics. This modification was essential for the Celestia network's adaptability and versatility.
  3. Forking tendermint-rs: Celestia is using a modified version of the Tendermint consensus protocol and we helped apply changes to the Rust implementation of it.

Conclusion

In conclusion, our project focused on enhancing the Rust RPC client and nodes for the Celestia network, making it more developer-friendly and efficient. By creating essential type analogues, adapting commitment generation logic, and enhancing NMT interaction, we empowered developers to engage effectively with the Celestia network through Rust.

These improvements not only simplify development but also bolster data integrity through efficient inclusion proofs. Our contributions to the Celestia Network have played a vital role in enhancing its functionality, reinforcing its capabilities, and ensuring it remains a pioneering force in the blockchain landscape.

Engage with Us

Curious to learn more? You're welcome to explore our GitHub repository to keep up with our progress and actively participate in our journey of advancement.

Project fact box

Technologies used: Rust, Tendermint, JsonRPC, protobuf, nmt

Main challenges: Tendermint fork, conforming to both jsonrpc and protobuf representations of Celestia types, keeping up with rapid development of Celestia

Problems we solved: Support for the arbitrary namespace size in nmt-rs, re-applying celestia modifications to tendermint protocol, achieving full compatibility with celestia types for both json and proto representations, integration testing with the real celestia network

Subscribe to news from us

to receive company news, client cases and technical articles on the latest applications of blockchain and web3.
Thank you! Please verify your subscription by clicking on the link we've sent you.
Oops! Something went wrong while submitting the form.