Skip to content

chore: chonk proof compression poc#20645

Merged
johnathan79717 merged 7 commits intomerge-train/barretenbergfrom
lde/proof-compression-poc
Mar 3, 2026
Merged

chore: chonk proof compression poc#20645
johnathan79717 merged 7 commits intomerge-train/barretenbergfrom
lde/proof-compression-poc

Conversation

@ledwards2225
Copy link
Contributor

@ledwards2225 ledwards2225 commented Feb 18, 2026

Adds Chonk proof compression logic that utilizes two things:

  1. Suyash's proposed EC point compression: store (x, sign_bit) instead of (x, y); leverage curve equation to reconstruct y-coord
  2. Store all fields as u256 / 32 bytes. (Similar effect to Snappy compression but seems to do slightly better)

Overall effect is that each single "component" of the proof is represented as 32 bytes. E.g. an Fq (naively 2 Frs) becomes one u256. A bn254 commitment (naively 2 Fqs = 4 Frs) becomes one u256 representing the x-coord.

High level stats:

Metric Value
Original size 1,935 Fr elements = ~60 KB
Snappy compressed size ~47 KB
Compressed size ~35 KB
Compression ratio 1.72x
Compress time 0.64 ms
Decompress time 3.5 ms

@ledwards2225 ledwards2225 force-pushed the lde/proof-compression-poc branch from ede5e27 to 7b3b826 Compare February 18, 2026 21:26
@ledwards2225 ledwards2225 marked this pull request as ready for review February 18, 2026 21:28
ledwards2225 and others added 7 commits March 3, 2026 11:26
… output

- Fix misleading comment on translator witness count: the -3 is actually
  -4 (interleaved_range_constraints, no individual commitments) +1
  (gemini_masking_poly, in MaskingEntities not NUM_WITNESS_ENTITIES)
- Add compile-time static_asserts that verify each walk function's element
  count matches the canonical PROOF_LENGTH constants from the flavor headers
- Add out.reserve() to avoid reallocations during compression
- Add ChonkCompressProof and ChonkDecompressProof bbapi commands
- Fix translator proof walk for new layout (PR #20273)
- Add compressed_element_count() and compressed_mega_num_public_inputs() helpers
- Add compression ratio assertion (>= 1.5x) to C++ roundtrip test
- Add TS integration test for compress/decompress via bbapi
- Export toChonkProof and ChonkProof from @aztec/bb.js
@johnathan79717 johnathan79717 force-pushed the lde/proof-compression-poc branch from fe4e338 to 69add0f Compare March 3, 2026 14:07
@johnathan79717 johnathan79717 requested review from ludamad and removed request for johnathan79717 March 3, 2026 15:41
Copy link
Contributor

@johnathan79717 johnathan79717 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the compression part but maybe someone should review the API part I wrote.

@johnathan79717 johnathan79717 merged commit c572e95 into merge-train/barretenberg Mar 3, 2026
10 checks passed
@johnathan79717 johnathan79717 deleted the lde/proof-compression-poc branch March 3, 2026 16:06
@johnathan79717
Copy link
Contributor

@ludamad suggested we backport this because it unblocks work for a big quick win on the proof size.

AztecBot pushed a commit that referenced this pull request Mar 3, 2026
Adds Chonk proof compression logic that utilizes two things:
1. Suyash's proposed EC point compression: store (x, sign_bit) instead of (x, y); leverage curve equation to reconstruct y-coord
2. Store all fields as u256 / 32 bytes. (Similar effect to Snappy compression but seems to do slightly better)

Overall effect is that each single "component" of the proof is represented as 32 bytes. E.g. an Fq (naively 2 Frs) becomes one u256. A bn254 commitment (naively 2 Fqs = 4 Frs) becomes one u256 representing the x-coord.

High level stats:
| Metric            | Value                                    |
|-------------------|------------------------------------------|
| Original size     | 1,935 Fr elements = ~60 KB|
| Snappy compressed size   | ~47 KB                    |
| Compressed size   | ~35 KB                   |
| Compression ratio | 1.72x                                    |
| Compress time     | 0.64 ms                                  |
| Decompress time   | 3.5 ms                                   |
@AztecBot
Copy link
Collaborator

AztecBot commented Mar 3, 2026

✅ Successfully backported to backport-to-v4-staging #21064.

github-merge-queue bot pushed a commit that referenced this pull request Mar 3, 2026
BEGIN_COMMIT_OVERRIDE
chore: ecc group audit 1- remove dead code, documentation and test
(#20886)
chore: chonk proof compression poc (#20645)
feat: reduce CRS and polynomial memory for non-ZK proofs (#20731)
END_COMMIT_OVERRIDE
johnathan79717 added a commit that referenced this pull request Mar 4, 2026
Adds Chonk proof compression logic that utilizes two things:
1. Suyash's proposed EC point compression: store (x, sign_bit) instead
of (x, y); leverage curve equation to reconstruct y-coord
2. Store all fields as u256 / 32 bytes. (Similar effect to Snappy
compression but seems to do slightly better)

Overall effect is that each single "component" of the proof is
represented as 32 bytes. E.g. an Fq (naively 2 Frs) becomes one u256. A
bn254 commitment (naively 2 Fqs = 4 Frs) becomes one u256 representing
the x-coord.

High level stats:
| Metric | Value |
|-------------------|------------------------------------------|
| Original size     | 1,935 Fr elements = ~60 KB| 
| Snappy compressed size | ~47 KB |
| Compressed size | ~35 KB |
| Compression ratio | 1.72x |
| Compress time     | 0.64 ms                                  |
| Decompress time   | 3.5 ms                                   |

---------

Co-authored-by: Jonathan Hao <jonathan@aztec-labs.com>
alexghr added a commit that referenced this pull request Mar 5, 2026
BEGIN_COMMIT_OVERRIDE
chore: chonk proof compression poc (#20645)
feat: Update L1 to L2 message APIs (#20913)
fix: adapt chonk proof compression for v4 Translator layout (#21067)
fix: omit bigint priceBumpPercentage from IPC config in testbench worker
(#21086)
feat: standby mode for prover broker (#21098)
fix(p2p): remove default block handler in favor of block handler
(#21105)
chore: prepare barretenberg-rs for crates.io publishing (#20496)
feat: reenable function selectors + additional validation in public
setup allowlist (backport #20909, #21122) (#21129)
chore: remove stale aes comments (#21133)
chore: remove auto-tag job (#21127)
feat: calldata length validation of public setup function allowlist
(#21139)
feat: run AVM NAPI simulations on dedicated threads instead of libuv
pool (#21138)
feat: Remove non-protocol contracts from public setup allowlist (#21154)
END_COMMIT_OVERRIDE

---------

Co-authored-by: ledwards2225 <ledwards2225@users.noreply.github.com>
Co-authored-by: PhilWindle <PhilWindle@users.noreply.github.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: mrzeszutko <mrzeszutko@users.noreply.github.com>
Co-authored-by: spalladino <spalladino@users.noreply.github.com>
Co-authored-by: johnathan79717 <johnathan79717@users.noreply.github.com>
Co-authored-by: nventuro <nventuro@users.noreply.github.com>
Co-authored-by: alexghr <alexghr@users.noreply.github.com>
Co-authored-by: AztecBot <AztecBot@users.noreply.github.com>
Co-authored-by: Martin Verzilli <martin@aztec-labs.com>
ludamad added a commit that referenced this pull request Mar 10, 2026
BEGIN_COMMIT_OVERRIDE
chore: chonk proof compression poc (#20645)
feat: Update L1 to L2 message APIs (#20913)
fix: adapt chonk proof compression for v4 Translator layout (#21067)
fix: omit bigint priceBumpPercentage from IPC config in testbench worker
(#21086)
feat: standby mode for prover broker (#21098)
fix(p2p): remove default block handler in favor of block handler
(#21105)
chore: prepare barretenberg-rs for crates.io publishing (#20496)
feat: reenable function selectors + additional validation in public
setup allowlist (backport #20909, #21122) (#21129)
chore: remove stale aes comments (#21133)
chore: remove auto-tag job (#21127)
feat: calldata length validation of public setup function allowlist
(#21139)
feat: run AVM NAPI simulations on dedicated threads instead of libuv
pool (#21138)
feat: Remove non-protocol contracts from public setup allowlist (#21154)
feat!: Expose offchain effects when simulating/sending txs (backport
#20563) (#21110)
chore: bump minor version (#21171)
chore: backport #21161 (tally slashing pruning improvements) to v4
(#21166)
chore: More updated Alpha configuration (backport #21155) (#21165)
fix(p2p): report most severe failure in runValidations (#21185)
feat: add ergonomic conversions for Noir's `Option<T>` (#21107)
docs: clarifying Noir fields vs struct fields in event metadata (#21172)
fix: bump lighthouse consensus client v7.1.0 -> v8.0.1 (#21170)
fix: update dependencies (#20997)
chore: New alpha-net environment (#20800) (#21202)
chore: code decuplication + refactor (public setup allowlist) (#21200)
feat: mask all ciphertext fields with Poseidon2-derived values (backport
#21009) (#21140)
chore: disable sponsored FPC in testnet (#21235)
feat!: exposing pub event pagination on wallet (#21197)
refactor(pxe): narrow tryGetPublicKeysAndPartialAddress return type
(backport #21208) (#21236)
feat: orchestrator enqueues via serial queue (#21247)
feat: rollup mana limit gas validation (#21219)
chore: deploy SPONSORED_FPC in test networks (#21254)
fix(sequencer): fix log when not enough txs (#21297)
END_COMMIT_OVERRIDE

---------

Co-authored-by: ledwards2225 <ledwards2225@users.noreply.github.com>
Co-authored-by: PhilWindle <PhilWindle@users.noreply.github.com>
Co-authored-by: ludamad <adam.domurad@gmail.com>
Co-authored-by: mrzeszutko <mrzeszutko@users.noreply.github.com>
Co-authored-by: spalladino <spalladino@users.noreply.github.com>
Co-authored-by: johnathan79717 <johnathan79717@users.noreply.github.com>
Co-authored-by: nventuro <nventuro@users.noreply.github.com>
Co-authored-by: alexghr <alexghr@users.noreply.github.com>
Co-authored-by: AztecBot <AztecBot@users.noreply.github.com>
Co-authored-by: Martin Verzilli <martin@aztec-labs.com>
Co-authored-by: PhilWindle <60546371+PhilWindle@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: mverzilli <mverzilli@users.noreply.github.com>
Co-authored-by: benesjan <benesjan@users.noreply.github.com>
Co-authored-by: danielntmd <danielntmd@users.noreply.github.com>
Co-authored-by: deffrian <deffrian@users.noreply.github.com>
Co-authored-by: benesjan <janbenes1234@gmail.com>
ludamad added a commit that referenced this pull request Mar 11, 2026
BEGIN_COMMIT_OVERRIDE
chore: chonk proof compression poc (#20645)
feat: Update L1 to L2 message APIs (#20913)
fix: adapt chonk proof compression for v4 Translator layout (#21067)
fix: omit bigint priceBumpPercentage from IPC config in testbench worker
(#21086)
feat: standby mode for prover broker (#21098)
fix(p2p): remove default block handler in favor of block handler
(#21105)
chore: prepare barretenberg-rs for crates.io publishing (#20496)
feat: reenable function selectors + additional validation in public
setup allowlist (backport #20909, #21122) (#21129)
chore: remove stale aes comments (#21133)
chore: remove auto-tag job (#21127)
feat: calldata length validation of public setup function allowlist
(#21139)
feat: run AVM NAPI simulations on dedicated threads instead of libuv
pool (#21138)
feat: Remove non-protocol contracts from public setup allowlist (#21154)
feat!: Expose offchain effects when simulating/sending txs (backport
#20563) (#21110)
chore: bump minor version (#21171)
chore: backport #21161 (tally slashing pruning improvements) to v4
(#21166)
chore: More updated Alpha configuration (backport #21155) (#21165)
fix(p2p): report most severe failure in runValidations (#21185)
feat: add ergonomic conversions for Noir's `Option<T>` (#21107)
docs: clarifying Noir fields vs struct fields in event metadata (#21172)
fix: bump lighthouse consensus client v7.1.0 -> v8.0.1 (#21170)
fix: update dependencies (#20997)
chore: New alpha-net environment (#20800) (#21202)
chore: code decuplication + refactor (public setup allowlist) (#21200)
feat: mask all ciphertext fields with Poseidon2-derived values (backport
#21009) (#21140)
chore: disable sponsored FPC in testnet (#21235)
feat!: exposing pub event pagination on wallet (#21197)
refactor(pxe): narrow tryGetPublicKeysAndPartialAddress return type
(backport #21208) (#21236)
feat: orchestrator enqueues via serial queue (#21247)
feat: rollup mana limit gas validation (#21219)
chore: deploy SPONSORED_FPC in test networks (#21254)
fix(sequencer): fix log when not enough txs (#21297)
fix: Simulate gas in n tps test. Set min txs per block to 1 (backport
#21312) (#21329)
fix(log): do not log validation error if unregistered handler (#21111)
fix(node): fix index misalignment in findLeavesIndexes (#21327)
fix: limit parallel blocks in prover to max AVM parallel simulations
(#21320)
fix: use native sha256 to speed up proving job id generation (#21292)
fix(validator): wait for l1 sync before processing block proposals
(#21336)
fix(txpool): cap priority fee with max fees when computing priority
(#21279)
chore: reduce severity of errors due to HA node not acquiring signature
(#21311)
fix: (A-643) add buffer to maxFeePerBlobGas for gas estimation and fix
bump loop truncation (#21323)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants