Workspace IndexMath › Day 52

Trusted Setup vs. Transparency (STARK vs. SNARK) TODO

Math · Day 52 / 52 · December — Cryptography & Information Theory (Day 44-52)

Concept

Many SNARKs require a trusted setup to generate public parameters before the proof system can be used, and if the secret value used in that process (often called "toxic waste") is not destroyed, forged proofs become possible. That's why an MPC ceremony is used to make the setup secure as long as just one participant is honest, and universal, updatable setups like KZG-based ones — which don't need to be redone per circuit — are preferred. STARKs rely only on hash functions and error-correcting codes, so they have no secret parameters at all, making them transparent and eliminating the setup trust assumption. The cost is proof size and verification cost: STARK proofs are generally larger than pairing-based SNARK proofs. Being hash-based is also often cited as giving STARKs a more conservative security assumption against quantum attacks.

Choosing a proof system is a question of trust assumptions before it's a question of performance — if the setup is compromised, everything verified on top of it becomes meaningless.

Code & Formula

# 신뢰된 셋업 vs 투명성(STARK vs SNARK) — 신뢰된 셋업이 있는 스킴은 "독성 폐기물"(toxic
# waste, 셋업에 쓰인 비밀 난수)이 새면 위조 증명이 가능해진다는 걸 토이 버전으로 보여준다.

import random


def trusted_setup():
    # 이 비밀(tau)을 아무도 몰라야 안전 — 만약 한 명이라도 저장해 두면 "독성 폐기물" 유출.
    tau = random.randint(1, 10**9)
    public_params = pow(2, tau, 10**9 + 7)   # 공개되는 건 tau 로 만든 파생값뿐
    return tau, public_params


def verify_honest_proof(public_params, claimed_value):
    return claimed_value == public_params


def forge_with_leaked_tau(tau):
    # tau 가 새어 나가면 검증자를 속이는 "증명"을 그냥 다시 계산해서 만들 수 있다.
    return pow(2, tau, 10**9 + 7)


tau, params = trusted_setup()
print(f"신뢰된 셋업 공개 파라미터 = {params}")
print("정직한 증명자:", verify_honest_proof(params, params), "(정상 검증 통과)")

forged = forge_with_leaked_tau(tau)   # tau 를 안다면 누구나 위조 가능
print("tau 유출 시 위조 증명도 검증 통과:", verify_honest_proof(params, forged))
print("\n반대로 STARK 류(투명성)는 이런 비밀 tau 자체가 없다 — 공개 무작위성(예: 해시)만")
print("쓰므로 '독성 폐기물'이 존재하지 않는다. 대가는 증명 크기가 더 크다는 것.")

Exercise

Prove the same simple circuit using both a library that needs a trusted setup and one that's transparent, then tabulate the presence/absence of setup artifacts, proof size, and verification time.

Practical Connection

When reviewing a validity proof for an L2 rollup, or privacy and off-chain computation verification for a prediction market, on-chain verification gas and setup trust assumptions are decided exactly on this trade-off.

If you study this on a given day, add a note link and a ✅ to this line in the source curriculum (docs/knowledge/math-50-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/.


한국어

신뢰된 셋업 vs 투명성(STARK vs SNARK) TODO

Math · Day 52 / 52 · 12월 — 암호학·정보이론 (Day 44–52)

개념

많은 SNARK는 증명 시스템을 쓰기 전에 공개 파라미터를 생성하는 신뢰된 셋업을 요구하고, 이때 쓰인 비밀값(흔히 toxic waste라 부른다)이 폐기되지 않으면 거짓 증명을 만들 수 있다. 그래서 다자간 의식(MPC ceremony)으로 참가자 중 한 명만 정직하면 안전하도록 만들고, KZG 기반의 universal·updatable 셋업처럼 회로마다 다시 하지 않아도 되는 형태가 선호된다. STARK는 해시 함수와 오류정정부호에만 의존하는 구성이라 비밀 파라미터가 없고, 따라서 투명(transparent)하며 셋업 신뢰 가정이 사라진다. 대가는 증명 크기와 검증 비용으로, 일반적으로 STARK 증명이 페어링 기반 SNARK보다 크다. 또한 해시 기반이라는 성질 덕분에 STARK는 양자 공격에 대한 가정이 더 보수적이라는 점도 자주 언급되는 차이이다.

증명 시스템 선택은 성능 문제이기 이전에 신뢰 가정 문제이고, 셋업이 오염되면 그 위의 모든 검증이 무의미해진다.

코드 · 수식

# 신뢰된 셋업 vs 투명성(STARK vs SNARK) — 신뢰된 셋업이 있는 스킴은 "독성 폐기물"(toxic
# waste, 셋업에 쓰인 비밀 난수)이 새면 위조 증명이 가능해진다는 걸 토이 버전으로 보여준다.

import random


def trusted_setup():
    # 이 비밀(tau)을 아무도 몰라야 안전 — 만약 한 명이라도 저장해 두면 "독성 폐기물" 유출.
    tau = random.randint(1, 10**9)
    public_params = pow(2, tau, 10**9 + 7)   # 공개되는 건 tau 로 만든 파생값뿐
    return tau, public_params


def verify_honest_proof(public_params, claimed_value):
    return claimed_value == public_params


def forge_with_leaked_tau(tau):
    # tau 가 새어 나가면 검증자를 속이는 "증명"을 그냥 다시 계산해서 만들 수 있다.
    return pow(2, tau, 10**9 + 7)


tau, params = trusted_setup()
print(f"신뢰된 셋업 공개 파라미터 = {params}")
print("정직한 증명자:", verify_honest_proof(params, params), "(정상 검증 통과)")

forged = forge_with_leaked_tau(tau)   # tau 를 안다면 누구나 위조 가능
print("tau 유출 시 위조 증명도 검증 통과:", verify_honest_proof(params, forged))
print("\n반대로 STARK 류(투명성)는 이런 비밀 tau 자체가 없다 — 공개 무작위성(예: 해시)만")
print("쓰므로 '독성 폐기물'이 존재하지 않는다. 대가는 증명 크기가 더 크다는 것.")

연습

같은 간단한 회로를 신뢰된 셋업이 필요한 시스템과 투명한 시스템 각각의 라이브러리로 증명해 보고, 셋업 산출물 유무·증명 크기·검증 시간을 표로 비교해 보기.

실무 · Verex 연결

L2 롤업의 유효성 증명이나 예측시장의 프라이버시·오프체인 계산 검증을 검토할 때, 온체인 검증 가스와 셋업 신뢰 가정이 정확히 이 트레이드오프 위에서 결정된다.

공부한 날 원본 커리큘럼(docs/knowledge/math-50-curriculum.md)의 이 줄에 노트 링크와 ✅ 를 붙이면, 이 자리는 노트 본문으로 바로 이어집니다. 노트 없이 이 페이지에 바로 적어도 됩니다 — 다만 다시 생성하면 덮어쓰이므로, 남길 글은 docs/algorithms/ 의 마크다운으로 쓰는 편이 안전합니다.

← 51. 영지식 증명의 3성질(완전성·건전성·영지식)