- ๐ฐ Save Money: Reduce Solana account rent by 60-80%
- ๐ง Smart Selection: Automatically chooses the best compression algorithm
- โก Blazing Fast: Written in Rust for maximum performance
- ๐ Data Integrity: Built-in checksums and validation
- ๐ฏ Solana-Native: Purpose-built for blockchain data pattern
- ๐ Multi-Algorithm: Custom + industry-standard algorithms (LZ4/Zstd)
- ๐ฆ Minimal Dependencies: Core library stays lean and efficientL-CLI
Reduce Solana storage costs by up to 80% with intelligent compression algorithms
Features โข Quick Start โข Architecture โข Benchmarks โข Documentation
OWLSOL-CLI is a high-performance, production-ready compression toolkit specifically designed for Solana blockchain applications. It intelligently analyzes your data and automatically selects the optimal compression algorithm, reducing on-chain storage costs while maintaining data integrity.
- ๐ฐ Save Money: Reduce Solana account rent by 60-80%
- ๐ง Smart Selection: Automatically chooses the best compression algorithm
- โก Blazing Fast: Written in Rust for maximum performance
- ๐ Data Integrity: Built-in checksums and validation
- ๐ฏ Solana-Native: Purpose-built for blockchain data patterns
- ๏ฟฝ Dual-Layer Approach: Combines custom algorithms + Solana-compatible compression (LZ4/Zstd)
- ๏ฟฝ๐ฆ Zero Dependencies: Core library has minimal external dependencies
| Algorithm | Best For | Typical Ratio | Speed |
|---|---|---|---|
| Huffman | Text, JSON, varied symbols | 40-60% | โกโกโก Fast |
| Dictionary | Repeated patterns, structured data | 50-70% | โกโก Medium |
| RLE | Long runs, simple repetition | 70-90% | โกโกโกโก Fastest |
| Algorithm | Best For | Typical Ratio | Speed |
|---|---|---|---|
| LZ4 | General purpose, balanced | 45-65% | โกโกโกโก Ultra-fast |
| Zstd | Maximum compression | 55-75% | โกโก Medium |
| Hybrid | Mixed data types | Best of all | โกโก Medium |
๐ก Smart Selection: OWLSOL automatically picks the optimal algorithm based on data analysis
- โ Intelligent Analysis: Shannon entropy, pattern detection, run-length analysis
- โ Auto-Selection: Heuristic-based algorithm selection
- โ Data Validation: Checksum verification, size validation
- โ Solana Integration: Cost estimation, devnet deployment simulation
- โ CLI Interface: Beautiful progress bars, colored output
- โ Batch Processing: Compress multiple files efficiently
- โ Benchmarking: Performance metrics and reports
- Quick (Linux/macOS):
curl -fsSL https://raw.githubusercontent.com/owl-sol/OWLSOL_CLI/main/scripts/install.sh | bash- Manual:
- Download a tarball from the Nightly release matching your platform:
- Linux: x86_64-unknown-linux-musl, aarch64-unknown-linux-musl
- macOS: x86_64-apple-darwin, aarch64-apple-darwin
- Extract and place
owlsolin your PATH.
- Download a tarball from the Nightly release matching your platform:
owlsol --help
owlsol compress file.txt
owlsol decompress file.txt.owlsol
owlsol --version
#### For Developers
**From source:**
```bash
# Clone the repository
git clone https://github.com/owl-sol/OWLSOL_CLI.git
cd OWLSOL_CLI
# Build the project
cargo build --release
# Run the CLI
./target/release/owlsol --help
# Or install to cargo bin
cargo install --path cli# Compress a file (auto-select algorithm)
owlsol compress -i data.json
# Compress with specific algorithm
owlsol compress -i data.json -a huffman
# Compress and show Solana cost savings
owlsol compress -i nft-metadata.json --deploy
# Decompress a file
owlsol decompress -i data.json.owlsol -o restored.json
# Analyze file without compressing
owlsol stats -i data.json --verbose
# Run benchmarks
owlsol benchmark -i data.json -n 100๐ฆ OWLSOL Compression
โ Read 2,456 bytes
โ Compressed in 12.34ms
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Compression Results โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฃ
โ Algorithm: Huffman โ
โ Original Size: 2,456 bytes โ
โ Compressed Size: 987 bytes โ
โ Compression Ratio: 59.81% โ
โ Space Saved: 1,469 bytes โ
โ Checksum: a3f2c891 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Saved to data.json.owlsol
Metadata: data.json.owlsol.meta.json
๐ก Solana Cost Analysis
Compressed: 0.000007 SOL
Uncompressed: 0.000017 SOL
๐ฐ Savings: 0.000010 SOL (59.81%)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CLI Layer โ
โ โข Argument parsing (Clap) โ
โ โข User interface & formatting โ
โ โข Progress indicators โ
โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Core Library โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Compressor (Orchestrator) โ โ
โ โ โข Data validation โ โ
โ โ โข Analysis โ Selection โ Compression โ โ
โ โ โข Metadata generation โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Custom Algorithms Layer โ โ
โ โ โข Huffman โข Dictionary โข RLE โ โ
โ โ (OWLSOL-optimized for blockchain data) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Industry-Standard Compression Layer โ โ
โ โ โข LZ4 (Facebook's fast compression) โ โ
โ โ โข Zstd (Facebook's high-ratio compression) โ โ
โ โ โก Same algorithms used by Solana internally โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Analyzer & Selector โ โ
โ โ โข Entropy calculation โ โ
โ โ โข Pattern detection โ โ
โ โ โข Intelligent algorithm selection โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Solana Integration โ
โ โข RPC client wrapper โ
โ โข Cost calculation โ
โ โข Devnet deployment โ
โ โข Compatible with Solana's native compression โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
owlsol-cli/
โโโ cli/ # ๐ป CLI application
โ โโโ commands/ # Command implementations
โ โ โโโ compress.rs
โ โ โโโ decompress.rs
โ โ โโโ stats.rs
โ โ โโโ benchmark.rs
โ โโโ ui/ # User interface
โ โโโ formatter.rs
โ
โโโ core/ # ๐ง Compression engine
โ โโโ algorithms/ # Compression algorithms
โ โ โโโ huffman.rs
โ โ โโโ dictionary.rs
โ โ โโโ rle.rs
โ โ โโโ lz4.rs
โ โ โโโ zstd.rs
โ โโโ compressor.rs # Main orchestrator
โ โโโ decompressor.rs # Decompression logic
โ โโโ analyzer.rs # Data analysis
โ โโโ selector.rs # Algorithm selection
โ โโโ metadata.rs # Metadata structures
โ โโโ utils/ # Utilities
โ โโโ bitstream.rs
โ
โโโ solana/ # ๐ Solana integration
โ โโโ client.rs # RPC client wrapper
โ โโโ account.rs # Account structures
โ
โโโ program/ # ๐ On-chain program (Future)
โโโ ... # Anchor program
OWLSOL uses intelligent heuristics to automatically select the best compression algorithm from both layers:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Dual-Layer Algorithm Decision Tree โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Is entropy > 7.5?
โโ YES โ NONE (random/encrypted data)
โ
โโ NO โ Continue analysis
โ
โโ Has many repeated sequences? (>5% of data)
โ โโ YES โ DICTIONARY (Custom Layer)
โ
โโ Has long runs? (max_run > 10 OR avg_run > 3)
โ โโ YES โ RLE (Custom Layer)
โ
โโ Text-like? (unique_bytes < 128)
โ โโ YES โ HUFFMAN (Custom Layer)
โ
โโ Need maximum speed?
โ โโ YES โ LZ4 (Solana-Compatible Layer) โก
โ
โโ Need maximum compression?
โ โโ YES โ ZSTD (Solana-Compatible Layer) ๐๏ธ
โ
โโ Mixed patterns?
โ โโ YES โ HYBRID (try all, pick best)
โ
โโ Default โ LZ4 (Solana-Compatible Layer)
Legend:
Custom Layer - Optimized for blockchain data patterns
Solana-Compatible - Same as Solana internal compressionPerformance metrics on real-world Solana data:
Algorithm: Huffman
Compression: 60.4%
Speed: 8.2ms
Solana Savings: 0.000002 SOL
Algorithm: Dictionary
Compression: 73.3%
Speed: 15.7ms
Solana Savings: 0.000013 SOL
Algorithm: Zstd
Compression: 85.0%
Speed: 23.4ms
Solana Savings: 0.000048 SOL
| Algorithm | Compression | Decompression |
|---|---|---|
| Huffman | 45 MB/s | 78 MB/s |
| Dictionary | 62 MB/s | 85 MB/s |
| RLE | 120 MB/s | 150 MB/s |
| LZ4 | 95 MB/s | 180 MB/s |
| Zstd | 38 MB/s | 92 MB/s |
Tested on AMD Ryzen 7 5800X, 16GB RAM
# Compress all JSON files in a directory
for file in solana-accounts/*.json; do
owlsol compress -i "$file" -a auto
done# Setup Solana devnet
./scripts/setup-devnet.sh
# Run comprehensive benchmarks
./scripts/benchmark-all.sh
# Generate test data
./scripts/generate-test-data.sh
# Run all tests
./scripts/run-tests.shuse owlsol_core::{Compressor, CompressionAlgorithm};
fn main() -> anyhow::Result<()> {
// Auto-select algorithm
let compressor = Compressor::new();
let result = compressor.compress(&data)?;
println!("Compressed: {} bytes โ {} bytes",
result.metadata.original_size,
result.metadata.compressed_size
);
// Force specific algorithm
let result = compressor.compress_with_algorithm(
&data,
Some(CompressionAlgorithm::Huffman)
)?;
Ok(())
}OWLSOL has comprehensive test coverage:
# Run all tests
cargo test
# Run with output
cargo test -- --nocapture
# Run specific test suite
cargo test --package owlsol-core
# Run benchmarks
cargo bench- โ Unit tests for each algorithm
- โ Integration tests for roundtrip compression
- โ Property-based tests with random data
- โ Edge case handling (empty data, corrupted data, etc.)
- โ Performance regression tests
# Generate and open documentation
cargo doc --open- ARCHITECTURE.md - Deep dive into system design
- ALGORITHMS.md - Algorithm explanations
- API.md - API reference
- BENCHMARKS.md - Detailed benchmark results
- DEPLOYMENT.md - Deployment guide
- CONTRIBUTING.md - Contribution guidelines
- Core compression engine
- Huffman, Dictionary, RLE algorithms
- LZ4, Zstd integration
- CLI interface
- Solana cost estimation
- Comprehensive test suite
- On-chain Solana program (Anchor)
- Actual on-chain deployment
- Web dashboard for visualization
- Performance optimizations
- Additional algorithms (Brotli, LZ77)
- Real-time compression for RPC responses
- Compression-aware Solana SDK
- Multi-threaded batch processing
- WASM support for browser use
- Native macOS/Windows/Linux binaries
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
# Clone and build
git clone https://github.com/owl-sol/OWLSOL_CLI.git
cd OWLSOL_CLI
cargo build
# Run tests
cargo test
# Check code quality
cargo clippy
cargo fmt --check- ๐ Report bugs
- ๐ก Suggest features
- ๐ Improve documentation
- ๐ง Submit pull requests
- โญ Star the repository
This project is licensed under the MIT License - see the LICENSE file for details.
- Solana Foundation - For the amazing blockchain platform
- Rust Community - For the excellent ecosystem
- Data Compression Research - Standing on the shoulders of giants
- GitHub Issues: Report a bug
- Discussions: Ask questions
- Twitter: @owlsol
- Discord: Join our community
Built with โค๏ธ by the OWLSOL Team
Making Solana storage affordable, one byte at a time ๐ฆ