Workspace IndexMath › Day 51

The Three Properties of Zero-Knowledge Proofs (Completeness, Soundness, Zero-Knowledge) TODO

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

Concept

An interactive proof system is a procedure by which a prover convinces a verifier that some statement is true, and a zero-knowledge proof requires three properties on top of that. Completeness means that if the statement is true and both parties honestly follow the protocol, the verifier accepts with overwhelming probability. Soundness means that if the statement is false, no prover can convince the verifier except with negligible probability; when this guarantee holds against every prover it's called a proof, and when it holds only against provers with bounded computational power it's called an argument. The zero-knowledge property means the verifier learns nothing beyond the fact that the statement is true, formalized as the existence of a simulator — one that doesn't know the witness — able to produce something indistinguishable from a real transcript. Depending on the strength of that indistinguishability, zero-knowledge is classified as perfect, statistical, or computational, and applications often require knowledge soundness — a guarantee that the prover actually knows the witness — rather than plain soundness.

In practice, what breaks is usually not the three properties themselves but the assumptions they rest on — the integrity of a trusted setup, or the assumptions made when converting an interactive protocol into a non-interactive one.

Code & Formula

# 영지식 증명의 3성질(완전성·건전성·영지식) — 그래프 3색칠 문제의 대화형 ZK 프로토콜을
# 여러 라운드 시뮬레이션해, "거짓 증명이 계속 통과할 확률이 지수적으로 줄어드는 것"을 본다.

import random

# 삼각형 하나(간선 3개) — 진짜 3색칠 가능한 그래프
edges = [(0, 1), (1, 2), (2, 0)]
coloring = {0: "R", 1: "G", 2: "B"}   # 증명자만 아는 비밀


def prover_commit(coloring, perm):
    # 색을 무작위로 재배치(퍼뮤테이션)해서 커밋 — 매 라운드 다른 색 배정처럼 보이게.
    return {v: perm[c] for v, c in coloring.items()}


def round_trip(coloring, edges, cheat=False):
    perm = {"R": "G", "G": "B", "B": "R"}   # 색 재배치(진짜 증명자는 이런 순열을 매번 새로 고름)
    committed = prover_commit(coloring, perm) if not cheat else {0: "R", 1: "R", 2: "B"}  # 부정직: 두 정점 같은 색
    u, v = random.choice(edges)             # 검증자가 무작위로 간선 하나 선택
    return committed[u] != committed[v]      # 그 간선의 두 끝점 색이 다른지만 공개


N = 20
honest_ok = sum(round_trip(coloring, edges) for _ in range(N))
cheat_ok = sum(round_trip(coloring, edges, cheat=True) for _ in range(N))
print(f"정직한 증명자: {honest_ok}/{N} 라운드 통과 (완전성 — 항상 통과해야 함)")
print(f"부정직한 증명자: {cheat_ok}/{N} 라운드 통과 (매 라운드 들킬 확률 >= 1/|E| — 반복할수록 사기 확률이 지수적으로 감소)")
print("영지식성: 검증자는 매 라운드 '두 끝점 색이 다르다'만 보고, 실제 색은 절대 못 봄")

Exercise

Pick a classic sigma protocol, such as graph three-coloring or proof of knowledge of a discrete log, write out completeness, soundness, and the simulator construction by hand, and reproduce the interactive process in simple code.

Practical Connection

When reviewing a rollup's validity proof or a privacy feature, the starting point for accurately assessing its trust assumptions is distinguishing whether the system is a proof or an argument, whether it has knowledge soundness, and what setup assumptions it relies on.

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/.


한국어

영지식 증명의 3성질(완전성·건전성·영지식) TODO

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

개념

대화형 증명 시스템은 증명자가 검증자에게 어떤 진술이 참임을 납득시키는 절차이며, 영지식 증명은 여기에 세 가지 성질을 요구한다. 완전성은 진술이 참이고 양쪽이 정직하게 프로토콜을 따르면 검증자가 압도적인 확률로 수락한다는 성질이다. 건전성은 진술이 거짓이면 어떤 증명자도 무시할 만한 확률로만 검증자를 속일 수 있다는 성질이며, 이 보장이 모든 증명자에 대해 성립하면 증명, 계산 능력이 제한된 증명자에 대해서만 성립하면 논증이라 부른다. 영지식성은 검증자가 얻는 것이 진술이 참이라는 사실뿐임을 뜻하며, 증인을 모르는 시뮬레이터가 실제 대화 기록과 구별할 수 없는 것을 만들어 낼 수 있다는 형태로 형식화된다. 구별 불가능성의 강도에 따라 완전, 통계적, 계산적 영지식으로 나뉘고, 응용에서는 단순 건전성보다 증인을 실제로 알고 있음을 보장하는 지식 건전성이 요구되는 경우가 많다.

실무에서 무너지는 지점은 대개 세 성질 자체가 아니라 그것이 성립하는 전제인데, 신뢰 설정의 무결성이나 대화형 프로토콜을 비대화형으로 바꿀 때의 가정이 여기에 해당한다.

코드 · 수식

# 영지식 증명의 3성질(완전성·건전성·영지식) — 그래프 3색칠 문제의 대화형 ZK 프로토콜을
# 여러 라운드 시뮬레이션해, "거짓 증명이 계속 통과할 확률이 지수적으로 줄어드는 것"을 본다.

import random

# 삼각형 하나(간선 3개) — 진짜 3색칠 가능한 그래프
edges = [(0, 1), (1, 2), (2, 0)]
coloring = {0: "R", 1: "G", 2: "B"}   # 증명자만 아는 비밀


def prover_commit(coloring, perm):
    # 색을 무작위로 재배치(퍼뮤테이션)해서 커밋 — 매 라운드 다른 색 배정처럼 보이게.
    return {v: perm[c] for v, c in coloring.items()}


def round_trip(coloring, edges, cheat=False):
    perm = {"R": "G", "G": "B", "B": "R"}   # 색 재배치(진짜 증명자는 이런 순열을 매번 새로 고름)
    committed = prover_commit(coloring, perm) if not cheat else {0: "R", 1: "R", 2: "B"}  # 부정직: 두 정점 같은 색
    u, v = random.choice(edges)             # 검증자가 무작위로 간선 하나 선택
    return committed[u] != committed[v]      # 그 간선의 두 끝점 색이 다른지만 공개


N = 20
honest_ok = sum(round_trip(coloring, edges) for _ in range(N))
cheat_ok = sum(round_trip(coloring, edges, cheat=True) for _ in range(N))
print(f"정직한 증명자: {honest_ok}/{N} 라운드 통과 (완전성 — 항상 통과해야 함)")
print(f"부정직한 증명자: {cheat_ok}/{N} 라운드 통과 (매 라운드 들킬 확률 >= 1/|E| — 반복할수록 사기 확률이 지수적으로 감소)")
print("영지식성: 검증자는 매 라운드 '두 끝점 색이 다르다'만 보고, 실제 색은 절대 못 봄")

연습

그래프 삼색칠이나 이산로그 지식 증명 같은 고전적 시그마 프로토콜 하나를 골라 완전성, 건전성, 시뮬레이터 구성을 각각 손으로 써 보고 간단한 코드로 대화 과정을 재현하라.

실무 · Verex 연결

롤업의 유효성 증명이나 프라이버시 기능을 검토할 때, 그 시스템이 증명인지 논증인지, 지식 건전성이 있는지, 어떤 설정 가정에 의존하는지를 구분해 읽는 것이 신뢰 가정을 정확히 평가하는 출발점이다.

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

← 50. 해시함수 설계 원리(스펀지·머클-담고르)52. 신뢰된 셋업 vs 투명성(STARK vs SNARK) →