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.
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)
- Blob β Binary content (encrypted or plaintext), content-addressed by BLAKE3 hash
- Digest<T> β 32-byte BLAKE3 content hash, phantom-typed for safety
| 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 |
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.
This crate is #![no_std] compatible by default. Enable the std feature for standard library support.
Licensed under either of Apache License, Version 2.0 or MIT license at your option.