#celestia #blockchain #lumina

celestia-types

Core types, traits and constants for working with the Celestia ecosystem

3 unstable releases

0.2.0 Apr 19, 2024
0.1.1 Jan 15, 2024
0.1.0 Jan 12, 2024

#1315 in Encoding

Download history 137/week @ 2024-01-30 303/week @ 2024-02-06 449/week @ 2024-02-13 325/week @ 2024-02-20 326/week @ 2024-02-27 405/week @ 2024-03-05 528/week @ 2024-03-12 565/week @ 2024-03-19 869/week @ 2024-03-26 1366/week @ 2024-04-02 1382/week @ 2024-04-09 1195/week @ 2024-04-16 580/week @ 2024-04-23 448/week @ 2024-04-30 163/week @ 2024-05-07 301/week @ 2024-05-14

1,559 downloads per month
Used in 4 crates

Apache-2.0

330KB
6K SLoC

Celestia types

Core types, traits and constants you may encounter when working with the Celestia ecosystem.

Most of the types are built on top of the celestia-tendermint-rs and celestia-proto and support the serialization and deserialization using protobuf and serde to the format understood by nodes in celestia network.

use celestia_types::{Blob, nmt::Namespace};

let my_namespace = Namespace::new_v0(&[1, 2, 3, 4, 5]).expect("Invalid namespace");
let blob = Blob::new(my_namespace, b"some data to store on blockchain".to_vec())
    .expect("Failed to create a blob");

assert_eq!(
    &serde_json::to_string_pretty(&blob).unwrap(), 
    indoc::indoc! {r#"{
      "namespace": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQIDBAU=",
      "data": "c29tZSBkYXRhIHRvIHN0b3JlIG9uIGJsb2NrY2hhaW4=",
      "share_version": 0,
      "commitment": "m0A4feU6Fqd5Zy9td3M7lntG8A3PKqe6YdugmAsWz28="
    }"#},
);

Dependencies

~9–19MB
~262K SLoC