sumcheck
БесплатноБез исполняемых скриптовНе проверенComprehensive reference for the Sumcheck protocol implementation in barretenberg. Use when working on sumcheck prover/verifier, relations, ZK sumcheck…
от AztecProtocol★ 458 звёзд на GitHubОб этом скилле
Sumcheck Protocol Implementation
Overview
Sumcheck is the core interactive proof protocol (made non-interactive via Fiat-Shamir) that reduces a multilinear polynomial identity over a boolean hypercube {0,1}^d to a single-point evaluation. It is the central component of the Honk proving system.
Claim: sum_{X in {0,1}^d} pow_beta(X) * F(P_1(X), ..., P_N(X)) = 0
where P_i are multilinear witness/selector polynomials, F is the batched relation polynomial, and pow_beta is the gate separator polynomial.
Code Layout
Core: barretenberg/cpp/src/barretenberg/sumcheck/
sumcheck.hpp— Prover, Verifier, and compile-time handler structssumcheck_round.hpp— Per-round logic for both prover and verifiersumcheck_output.hpp— Output struct (challenge vector, claimed evaluations, ZK data)zk_sumcheck_data.hpp— Libra masking polynomials and running sumsSumcheck.md— Detailed mathematical documentation
Supporting:
polynomials/gate_separator.hpp— pow_beta polynomialpolynomials/row_disabling_polynomial.hpp— ZK row maskingflavor/partially_evaluated_multivariates.hpp— Book-keeping table for partial evaluationflavor/flavor_concepts.hpp— Flavor dispatch conceptsrelations/— Relation types, utilities, parameters, nested containers
Tests:
sumcheck/sumcheck.test.cpp— Prover/verifier correctness, ZK, Grumpkin, failure casessumcheck/sumcheck_round.test.cpp— Round-level: univariates, batching, check_sum, paddingultra_honk/sumcheck.test.cpp— Integration test with real UltraFlavor circuit
Callers:
ultra_honk/ultra_prover.cpp/ultra_verifier.cpp— Ultra/Mega/MegaZK flavorseccvm/eccvm_prover.cpp/eccvm_verifier.cpp— Grumpkin committed sumcheckhypernova/— HyperNova foldingchonk/batched_honk_translator/— Batched Honk+Translator
Architecture
Proving Pipeline
OINK PHASE (pre-sumcheck)
Commit to wires, lookup counts, log-deriv inverses, permutation product.
Draw alpha (subrelation separator) and gate challenges (beta_0,...,beta_{d-1}).
SUMCHECK PHASE
For round i = 0..d-1:
Compute round univariate (extend edges, accumulate relations, batch with pow)
[ZK] Add Libra masking contribution, subtract row disabling correction
Send round univariate to transcript, draw challenge u_i
Partially evaluate all polynomials at u_i
[Padding] For round i = d..virtual_log_n-1:
Send zero/virtual univariate, draw challenge
Extract claimed evaluations from top of book-keeping table
PCS PHASE (post-sumcheck)
[ZK] SmallSubgroupIPA proves Libra evaluation
Shplemini reduces multivariate opening claims to univariate
KZG/IPA proves the univariate opening
Key Design Patterns
Compile-time flavor dispatch: The Flavor template parameter bundles all configuration. Handler structs (RoundUnivariateHandler, VerifierZKCorrectionHandler) use if constexpr and specializations to select behavior at compile time based on flavor traits.
Prover round structure: Each round extends polynomial evaluations from {0,1} to {0,...,D}, accumulates relation contributions into univariate accumulators, then batches over relations using alpha powers and the gate separator factor.
Verifier round structure: Each round checks S(0) + S(1) == target_sum, then computes the next target as S(u_i). The final step evaluates the full batched relation at the challenge point and compares.
Committed sumcheck (Grumpkin/ECCVM path): Instead of sending round univariate evaluations in the clear, the prover commits to each round univariate and sends the commitment plus evaluations at {0, 1} only. The verifier does NOT perform the usual check_sum and compute_next_target_sum during sumcheck — it defers all consistency checks to the PCS phase, where Shplemini batch-verifies the round univariate commitments together with the polynomial opening claims. This is controlled by IsGrumpkinFlavor and handled via the RoundUnivariateHandler and SumcheckVerifierRound specializations.
Book-keeping table: Partial evaluation halves the polynomial table each round. After d rounds, a single row remains holding the claimed evaluations at the challenge point.
Flavor System
Each flavor provides a compile-time configuration bundle that parameterizes sumcheck.
Key Flavor Traits
| Trait | Effect on Sumcheck |
|---|---|
Relations |
Tuple of relation types composing the Honk relation |
MAX_PARTIAL_RELATION_LENGTH |
Determines round univariate degree |
BATCHED_RELATION_PARTIAL_LENGTH |
MAX+1 (non-ZK) or MAX+2 (ZK, for row disabling) |
HasZK |
Enables Libra masking + row disabling |
NUM_SUBRELATIONS |
Total subrelation count, determines alpha array size |
Dispatch Points
| Concept | Dispatch |
|---|---|
HasZK |
ZK prove path (Libra + row disabling) |
IsGrumpkinFlavor |
Committed sumcheck (commit round univariates) |
Установить sumcheck в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sumcheck?
Comprehensive reference for the Sumcheck protocol implementation in barretenberg. Use when working on sumcheck prover/verifier, relations, ZK sumcheck (Libra/row disabling), ECCVM committed sumcheck, flavors, gate separator, partial evaluation, or any code in the sumcheck/ directory and its integrations.
Как установить скилл sumcheck?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sumcheck запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic