Polynomial IOPs — the trade-off between proof size and verification time TODO
Concept
A polynomial IOP (Interactive Oracle Proof) is an abstract protocol in which the prover submits polynomials as oracles and the verifier queries their evaluations at random points, reducing the correctness of a computation to a polynomial identity check. This abstraction layer discusses only completeness and soundness without using any real cryptography; once the oracles are replaced with an actual polynomial commitment scheme (PCS) and the protocol is made non-interactive via Fiat-Shamir, it becomes a concrete SNARK or STARK. That's why arithmetization (R1CS, PLONKish, AIR) is decoupled from the commitment scheme, and a system's proof size, verification time, proving time, and whether it needs a trusted setup are mostly determined by the choice of PCS. Pairing-based KZG has constant-size commitments and evaluation proofs with very fast verification, but it requires a structured trusted setup and isn't quantum-resistant. Hash-based FRI needs no trusted setup and relies only on hash assumptions, but trades that off for proof size and verification cost that grow poly-logarithmically.
On-chain verification cost scales almost directly with proof size and verifier computation, so choosing a proof system is really choosing your gas cost and trust assumptions at the same time.
Code & Formula
# 다항식 IOP — Schwartz-Zippel 보조정리: 서로 다른 두 다항식이 랜덤 점에서
# 우연히 같은 값을 낼 확률은 차수/체 크기(p)에 비례해 작아진다 (증명 크기 vs 검증 시간의 근거).
import random
p = 65537 # 작은 소수 유한체 GF(p)
def poly_eval(coeffs, x, p):
# Horner's method, mod p
result = 0
for c in reversed(coeffs):
result = (result * x + c) % p
return result
def collision_rate(deg, trials, p):
f = [random.randrange(p) for _ in range(deg + 1)]
g = f.copy()
g[0] = (g[0] + 1) % p # f - g 는 0이 아닌 차수 deg 다항식
hits = 0
for _ in range(trials):
r = random.randrange(p)
if poly_eval(f, r, p) == poly_eval(g, r, p):
hits += 1
return hits / trials
trials = 20000
for deg in (1, 8, 64):
rate = collision_rate(deg, trials, p)
bound = deg / p # Schwartz-Zippel 상한: 최대 deg/|F| 확률로 충돌
print(f"deg={deg:3d} 관측 충돌률={rate:.6f} 이론 상한(deg/p)={bound:.6f}")
print("\n결론: 차수가 커질수록 충돌 확률 상한이 커지므로, 검증자가 신뢰할 수")
print("있으려면 체 크기 p 를 다항식 차수보다 충분히 크게 잡아야 한다.")
docs/code/algorithms/algorithms-92.py
Exercise
Experiment with the Schwartz-Zippel lemma over a small finite field, and check how the probability that two different polynomials happen to agree at a random point scales with their degree relative to the field size.
Practical Connection
Compressing large volumes of off-chain matching in a prediction market into an on-chain settlement requires rollup-style validity proofs, and choosing between KZG (small proofs, needs trusted setup) and FRI (transparent, larger proofs) simultaneously decides your settlement gas cost and your security assumptions.
Where it lands in Jayverse
- Verex: write down which PCS (KZG vs FRI) is chosen for rollup-style settlement proofs, and why, as an Auditor-style methodology note. Gas cost and trust assumptions are one decision — record it, don't just pick it.
- Devnet: prototype the settlement-proof PoC on devnet first, one market's worth of matches, before committing to a PCS. A trusted-setup requirement (KZG) is a one-way door once anything is mainnet-adjacent.
- Auditor: once a PCS is chosen, track proof size and verifier gas cost as a recurring regression check. So on-chain settlement cost doesn't silently drift as the circuit grows.
Key expressions
| Expression | 뜻 · 쓰이는 자리 |
|---|---|
| trade-off | 상충 관계(하나를 얻으면 다른 걸 잃는 관계) · 증명 크기와 검증 시간 사이의 관계를 말할 때 · "the trade-off between proof size and verification time" |
| decoupled from | ~로부터 분리된 · 산술화 방식이 커밋먼트 스킴과 독립적일 때 · "is decoupled from the commitment scheme" |
| structured trusted setup | 구조화된 신뢰 설정(초기값을 안전하게 생성해야 하는 절차) · KZG 방식의 약점을 가리킬 때 · "requires a structured trusted setup" |
| quantum-resistant | 양자내성이 있는(양자컴퓨터 공격에 안전한) · 암호 방식의 안전성을 평가할 때 · "isn't quantum-resistant" |
| polynomial identity check | 다항식 항등식 검사 · 복잡한 계산 검증을 단순화한 결과물을 가리킬 때 · "to a polynomial identity check" |
| abstraction layer | 추상화 계층 · 실제 암호 기술과 분리된 개념적 설명 단계 · "This abstraction layer discusses only completeness and soundness" |
| non-interactive | 비대화형(질의응답 없이 한번에 완성되는) · Fiat-Shamir로 변환된 증명 방식을 가리킬 때 · "the protocol is made non-interactive via Fiat-Shamir" |
| scales almost directly with | ~에 거의 정비례해 커지다 · 온체인 검증 비용이 증명 크기에 비례할 때 · "verification cost scales almost directly with proof size" |
| IOP | 대화형 오라클 증명(Interactive Oracle Proof) · prover가 다항식을 오라클로 제출하고 verifier가 무작위 지점에서 평가값을 질의하는 추상 프로토콜 · "A polynomial IOP (Interactive Oracle Proof) is an abstract protocol" |
| PCS | 다항식 커밋먼트 스킴(Polynomial Commitment Scheme) · 증명 크기·검증 시간·신뢰설정 필요 여부를 좌우하는 핵심 구성요소 · "mostly determined by the choice of PCS" |
| SNARK | 간결한 비대화형 지식증명(Succinct Non-interactive ARgument of Knowledge) · Fiat-Shamir로 비대화형화된 구체적 증명 시스템 · "it becomes a concrete SNARK or STARK" |
| STARK | 확장 가능한 투명 지식증명(Scalable Transparent ARgument of Knowledge) · 신뢰설정 없이 해시 기반 FRI 계열로 구성되는 증명 시스템 · "it becomes a concrete SNARK or STARK" |
| KZG | Kate-Zaverucha-Goldberg 커밋먼트 · 페어링 기반의 고정크기 커밋먼트·평가증명, 검증은 빠르지만 구조화된 신뢰설정 필요 · "Pairing-based KZG has constant-size commitments" |
| FRI | Fast Reed-Solomon IOP of Proximity · 해시 기반 저차원성 검사 프로토콜, 신뢰설정은 불필요하나 증명 크기가 커짐 · "Hash-based FRI needs no trusted setup" |
| AIR | 대수적 중간표현(Algebraic Intermediate Representation) · 계산을 다항식 제약으로 표현하는 산술화 방식 중 하나 · "arithmetization (R1CS, PLONKish, AIR)" |
| R1CS | 1계수 제약 시스템(Rank-1 Constraint System) · 계산을 이차 제약식으로 표현하는 대표적 산술화 방식 · "arithmetization (R1CS, PLONKish, AIR)" |
If you study this on a given day, add a note link and a ✅ to this line in the source curriculum (docs/knowledge/dev-100-curriculum.md) and this spot will lead straight to the note body. You can also write directly on this page — but regenerating overwrites it, so it's safer to keep anything you want to save as markdown under docs/algorithms/.