Skip to main content

How It Works

Text content over 10 KB is automatically gzip-compressed before writing to Shelby. Decompression is transparent on read.
Write: "2100 chars of text" → gzip → 105 bytes on-chain
Read:  105 bytes from chain → gunzip → "2100 chars of text"

When Compression Applies

ContentCompressed?Why
Text > 10 KB✅ YesSignificant space savings
Text ≤ 10 KB❌ NoOverhead not worth it
Binary files (uploads)❌ NoAlready compressed (JPEG, MP4, etc.)
Encrypted content❌ NoCiphertext doesn’t compress well

Response Fields

{
  "id": "...",
  "sizeBytes": 105,
  "isCompressed": true
}
  • sizeBytes — the actual size stored on-chain (after compression)
  • isCompressedtrue if the content was compressed

Transparent Decompression

You don’t need to do anything special — GET /v1/memory/:id returns the original uncompressed content regardless of whether it was stored compressed.