- 💰 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 🦉