Skip to content

Latest commit

Β 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

README.md

sedimentree_core

Core data partitioning scheme for efficient metadata-based synchronization.

Warning

This is an early release preview with an unstable API. Do not use for production at this time.

Overview

Sedimentree organizes data into hierarchical layers (strata) based on the number of leading zero bytes in content hashes. This enables efficient diffing and synchronization of encrypted data without requiring decryption.

Depth 0: β–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆ β–ˆβ–ˆ   (strict filter β†’ few commits per fragment)
         ↓ require more leading zero bytes
Depth 1: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   (looser filter β†’ more commits per fragment)
         ↓ require more leading zero bytes
Depth 2: β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   (loosest filter β†’ most commits per fragment)

Key Concepts

Blobs and Digests

  • Blob β€” Binary content (encrypted or plaintext), content-addressed by BLAKE3 hash
  • Digest<T> β€” 32-byte BLAKE3 content hash, phantom-typed for safety

Commits and Fragments

Type Description
LooseCommit Individual commit metadata with parent references (not yet rolled into a fragment)
Fragment A range of commits at a specific depth, bundled with checkpoint metadata
Sedimentree Complete metadata structure for a document

Depth Metric

The DepthMetric trait determines how commits are partitioned into layers:

pub trait DepthMetric {
    fn to_depth(&self, id: CommitId) -> Depth;
}

Default implementation CountLeadingZeroBytes uses the number of leading zero bytes in the commit identifier, giving ~1/256 probability per depth level.

no_std Support

This crate is #![no_std] compatible by default. Enable the std feature for standard library support.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.