Skip to content
blockchain-compression cargo add →

// use case

Account state snapshots

// Snapshot dumps compress hardest of all

Account snapshots are dense with repeated owner fields, program IDs, and key shapes. The Accounts preset targets exactly this structure and reports the highest non-archival ratios in the README.

preset: Accounts reported ratio: 15–40:1

// why it fits

  • Owner and program fields repeat across thousands of accounts — the dictionary references them.
  • The 15–40:1 range is an illustrative figure for account-state workloads, not a measured guarantee.
  • Deterministic decompression means snapshots restore identically on any machine.
  • Pair with your snapshot tooling as a post-processing step; it needs only the raw bytes.

// example

use blockchain_compression::presets::solana::{
    SolanaCompressor, SolanaPreset,
};
use blockchain_compression::core::traits::CompressionStrategy;

let mut compressor = SolanaCompressor::new(
    SolanaPreset::Accounts,
);

let compressed   = compressor.compress(data)?;
let decompressed = compressor.decompress(&compressed)?;
assert_eq!(data, decompressed.as_slice());

See the quickstart for the full setup and the presets page for how ratios trade against CPU cost.