Closed DevNebulaX closed 3 days ago
Please visit #444 also.
Speaking of improvements, I'd like infallible (and preferably non-panicking) store functions; they seem more optimal. They could be implemented as in https://gist.github.com/ProgramCrafter/c79293307b7df0740b87ae244072a4d3.
Thank you for your submission. After careful review, we regret to inform you that we cannot proceed with your application at this time, as a Rust SDK has already been implemented as part of the Bounty program (see bounty #182).
Summary
TL-B serialization is a fundamental component of the TON blockchain, enabling the encoding and decoding of data structures in a compact, efficient, and schema-based binary format. To provide Rust developers with seamless support for this critical feature, we propose developing a TL-B serialization library in Rust. This library will allow developers to work with TL-B schemas directly in their Rust applications, enhancing the capabilities of TON-based tools and services.
Context
The TL-B (Type Language - Binary) format is widely used within the TON blockchain for serializing and deserializing data structures, such as messages, cells, and state data. While other programming languages have partial implementations or utilities for TL-B serialization, Rust lacks a comprehensive and developer-friendly library tailored for this purpose. By creating a dedicated TL-B serialization library in Rust, we can empower developers to build efficient and reliable applications in the TON ecosystem. Key features of the proposed library include: • Support for defining and parsing TL-B schemas directly in Rust. • Serialization and deserialization of TL-B data structures into binary format. • Bit-level data manipulation for precise TL-B compliance. • Recursive structure handling for complex TL-B schemas. • Error handling to ensure data integrity and conformity with TL-B specifications. • Integration with existing TON blockchain tools, such as tonlibjson, for seamless workflows.
Suppose we have a simple TL-B schema: use std::io::{self, Read, Write};
// Example struct matching the TL-B schema struct User { text: String, age: i32, }
// Serialization impl User { fn serialize(&self, writer: &mut impl Write) -> io::Result<()> { // Serialize the text as a string (length-prefixed, for example) let text_bytes = self.text.as_bytes(); let length = text_bytes.len() as u32; writer.write_all(&length.to_be_bytes())?; writer.write_all(text_bytes)?;
}
References
Develop a Rust library that implements TL-B serialization, enabling developers to encode, decode, and manipulate TL-B data structures effortlessly within Rust applications.
Estimate suggested reward
$5,000 USD in TON equivalent