// features
Storage infrastructure for chains that keep growing.
As state bloats, cheaper archival and data movement stop being nice-to-haves and become core
infrastructure. No feature here is aspirational — each maps to code in the repo: the
CompressionStrategy trait, the Solana dictionary
in presets/solana.rs, and the six preset levels.
100% lossless
Every compress/decompress operation is round-trip validated. decompress(compress(x)) == x is the trait contract, enforced by tests on every preset.
Solana byte dictionary
A hardcoded reference pool of common program IDs, instruction discriminators, lamport amounts, transaction markers, and the Base58 charset. Matches collapse to tiny back-references.
Six named presets
FastCompression through MaxCompression map to Zstd levels 3, 6, and 19. Pick by workload — real-time, transactions, accounts, or archival.
Feature-gated backends
deflate (default), lz4, and zstd are Cargo features. The Solana presets require zstd; the trait layer works with any backend you enable.
Deterministic & self-contained
The dictionary is a constant built at construction. No online training, no per-customer model, no separate dictionary file to ship or locate.
Pure Rust, no node
A compression library, not a chain client. No RPC, no validator, no network dependency at runtime. You hand it bytes; it returns smaller bytes.
Chain-agnostic core
The CompressionStrategy trait and pattern engine in core/ have no chain knowledge. Build your own dictionary for other chains on top of the same machinery.
Honest ratio ranges
The one measured claim is "up to 60:1 on archival workloads with MaxCompression." Every other preset range is illustrative and workload-dependent — ratios track how repetitive your data is, so benchmark on your own bytes before planning capacity.
// preset at a glance
Six presets, one dictionary.
Ratios are the README's published ranges. See the presets page for how to choose.
| Preset | Zstd level | Reported ratio | Best for |
|---|---|---|---|
| FastCompression | 3 | 5–15:1 | Real-time processing |
| Transactions | 3 | 10–30:1 | Transaction data |
| Instructions | 6 | 10–25:1 | Program instructions |
| Accounts | 6 | 15–40:1 | Account state snapshots |
| Mixed | 6 | 12–35:1 | General-purpose |
| MaxCompression | 19 | 20–60:1 | Archival storage |
Ready to try it?
The quickstart gets you
from cargo add to a verified round-trip in five steps.