> For the complete documentation index, see [llms.txt](https://parad0xlabs.gitbook.io/parad0xlabs-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://parad0xlabs.gitbook.io/parad0xlabs-docs/liquefy-compression-+-proofs/how-it-works.md).

# How It Works

Liquefy is a columnar compression engine with a commitment layer bolted on. The compression is why people install it; the commitments are why it belongs in Web0. Both ship in the open ([`Parad0x-Labs/liquefy`](https://github.com/Parad0x-Labs/liquefy), MIT).

***

## Columnar, not blob

General-purpose compressors (gzip, Zstd) treat your file as one stream of bytes. Liquefy splits **structured** data into columns first, then compresses each column with the best-fitting codec from a library of \~24 — because a column of timestamps, a column of amounts, and a column of URLs each compress best a different way. That structure-awareness is where the 1.4–6× edge over Zstd (and 33–61× over raw) on receipt/log data comes from.

```python
import liquefy

blob   = liquefy.compress(records)        # list/dict of structured rows
out    = liquefy.decompress(blob)         # verified against SHA-256 of the original
assert liquefy.verify(blob)               # round-trip check, raises on mismatch
```

***

## Per-Column Commitment (PCC) — disclose one column, prove it, hide the rest

When you compress in commit mode, Liquefy builds a Merkle commitment over the columns:

```
leaf  = SHA-256(column_name, zone_map, raw_payload)
root  = MerkleRoot(leaves)        # one root fingerprints the whole dataset
```

Now you can hand someone a **single column** — say, just `amount` — *uncompressed*, with an inclusion proof against the root. They verify that column really came from the sealed dataset without ever seeing the other columns. That's the primitive OpenClaw uses to show an auditor the payments without dumping the entire log.

***

## Predicate-on-Zone — compliance proofs that decompress zero rows

Each block carries an **exact** zone-map (the true min/max of its values), committed into the leaf. That lets Liquefy answer questions like *"did this agent ever spend over the cap?"* by checking the committed zone-maps **block by block, decompressing nothing**:

* It's **O(blocks)**, not O(rows) — fast on huge datasets.
* It's **zk-free** — plain hashing, no trusted setup, no circuit.
* It's **fail-closed** — a block whose zone-map can't prove it stayed under the cap fails the check rather than passing silently.

"This spending limit was never exceeded" becomes a cheap, verifiable claim instead of a manual log scrape.

***

## Compression-as-notary

Every Liquefy archive can emit a **Decode-Receipt**: `{ engine + version, blob hash, plaintext SHA-256, MRTV }`. That's a portable proof that *this exact engine* turns *this exact blob* back into *this exact data*. Anchor that receipt (Web0 anchors it to Solana) and you've turned the act of compression into a notarized event — the foundation of OpenClaw's "the record wasn't tampered with" guarantee.

***

## Limits

* **Value-lossless, verified recovery.** Restores are checked against the original's SHA-256. Some codec paths normalize formatting (e.g. JSON whitespace), so we claim *value-lossless*, not a blanket *byte-for-byte*; the archival path layers MRTV verification (and SSIM/dimension checks for media) for bit-perfect guarantees where required.
* **Numbers are corpus-specific.** 33–61× / 1.4–6× are measured on particular structured datasets in the repo. Random or already-compressed data won't see that.
* The commitment/predicate layer is **opt-in** (commit mode) — plain `compress()` is just fast compression.

***

**Next:** [**Monetize**](/parad0xlabs-docs/liquefy-compression-+-proofs/make-money.md) **— open-core economics and why the engine under the products is the cheap part that sells the expensive part.**


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://parad0xlabs.gitbook.io/parad0xlabs-docs/liquefy-compression-+-proofs/how-it-works.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
