#tari #binary-encoding #serialization #representation #template-engine #bor

no-std tari_bor

The binary object representation (BOR) crate provides a binary encoding for template/engine data types

9 releases (breaking)

Uses new Rust 2024

new 0.13.0 Feb 11, 2026
0.12.0 Feb 9, 2026
0.11.1 Sep 25, 2025
0.10.4 Jul 2, 2025
0.1.0 Nov 22, 2023

#99 in Magic Beans


Used in 6 crates (4 directly)

BSD-3-Clause

31KB
711 lines

tari_bor

Overview

tari_bor is the low-level self-describing Binary Object Representation (BOR) used in Tari.

It provides a thin api over the ciborium crate.

Usage

Example: Serializing an Object

use tari_bor::serialize;

fn main() {
    #[derive(serde::Serialize, serde::Deserialize, Debug)]
    struct TestCase {
        bytes: Vec<u8>,
        pk: String,
    }

    let test_case = TestCase {
        bytes: vec![1, 2, 3, 4, 5],
        pk: RistrettoPublicKeyBytes::from([1; 32]),
    };
    let encoded = tari_bor::encode(&test_case).unwrap();
    let decoded: TestCase = tari_bor::decode(&encoded).unwrap();
}

Documentation

Detailed documentation is available at docs.rs/tari_bor.

Dependencies

~1.2–2.4MB
~43K SLoC