Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

sumcheck

БесплатноБез исполняемых скриптовНе проверен

Comprehensive reference for the Sumcheck protocol implementation in barretenberg. Use when working on sumcheck prover/verifier, relations, ZK sumcheck…

AztecProtocolот 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 structs
  • sumcheck_round.hpp — Per-round logic for both prover and verifier
  • sumcheck_output.hpp — Output struct (challenge vector, claimed evaluations, ZK data)
  • zk_sumcheck_data.hpp — Libra masking polynomials and running sums
  • Sumcheck.md — Detailed mathematical documentation

Supporting:

  • polynomials/gate_separator.hpp — pow_beta polynomial
  • polynomials/row_disabling_polynomial.hpp — ZK row masking
  • flavor/partially_evaluated_multivariates.hpp — Book-keeping table for partial evaluation
  • flavor/flavor_concepts.hpp — Flavor dispatch concepts
  • relations/ — Relation types, utilities, parameters, nested containers

Tests:

  • sumcheck/sumcheck.test.cpp — Prover/verifier correctness, ZK, Grumpkin, failure cases
  • sumcheck/sumcheck_round.test.cpp — Round-level: univariates, batching, check_sum, padding
  • ultra_honk/sumcheck.test.cpp — Integration test with real UltraFlavor circuit

Callers:

  • ultra_honk/ultra_prover.cpp / ultra_verifier.cpp — Ultra/Mega/MegaZK flavors
  • eccvm/eccvm_prover.cpp / eccvm_verifier.cpp — Grumpkin committed sumcheck
  • hypernova/ — HyperNova folding
  • chonk/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)
Полный SKILL.md на GitHub

Установить 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), без исполняемых скриптов.

Похожие скиллы

Сравнить sumcheck с