tari_bor

Crates.iotari_bor
lib.rstari_bor
version0.11.1
created_at2023-11-22 08:29:20.140096+00
updated_at2025-09-25 04:43:04.489601+00
descriptionThe binary object representation (BOR) crate provides a binary encoding for template/engine data types
homepage
repositoryhttps://github.com/tari-project/tari-ootle
max_upload_size
id1044971
size44,464
Stan Bondi (sdbondi)

documentation

README

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.

Commit count: 1223

cargo fmt