Lec 1
完全就是计算理论。
preliminary
段然老师在计算理论课上告诉过我们:NP 是“静态” (static) 的证明,IP 是一个 prover 和 verifier 进行交互式证明。
Interactive Proof: For language , interactive proof system for is a pair of p.p.t algorithm with internal r.n.g. (即probabilistic TM 的随机带) , where
- completeness:
- soundness: and any p.p.t. algorithm (with ), .
在课程中,我们只关心只有 soundness 条件的问题。(即如果 则永远不会出错)
IP 关心的是 prover 是否忠诚,但是 ZKP 更关心 prover 是否安全,即 verifier 能否通过 prover 获取到它自身计算不了的信息。在 NP 中,static proof 就是一种 knowledge。
如果命题为真,且 prover 自身没有问题,则 verifier 收到的消息应当可以在同等算力下模拟出来(不需要算力无限的 prover),使用一个 p.p.t. TM 形式化这个过程。
view: We call , where is the common input, is the internal r.n.g., is the message exchanged in round . also called transcript, written as .
Perfect honest-verifier ZK: We say an interactive proof is perfect honest-verifier zero-knowledge if there exists a p.p.t. algorithm such that .
注意这个恒等号限制他们的 r.n.g. 分布也要相等,且与 transcript 相关。
这个 “honest verifier” 是有用的,因为 ZKP 关心的是 prover 的安全性。所以一般意义的 Perfect ZK 有限制:
Perfect ZK: is interactive proof, for any p.p.t. algorithm , there exists a p.p.t. algorithm such that .
新增的限制保证了 prover 的安全性。即使 verifier 不诚实,prover 也不会泄露任何 verifier 不能计算的信息。
ZKP of GNI
证明 GNI in IP 的 构造事实上是 perfect ZK 的。(ref: ToC Lecture 11 slide p19)
completeness:
- if is not isomorphic to then is isomorphic to exactly one of
- prover can choose correct
soundness:
- if then prover sees the same distribution on for
- no information on c any prover can succeed with probability at most 1/2
zero-knowledge:
- samples and as , then .
Other Securities
事实上,保证 和 分布完全相同并不太有必要—— 的计算能力只限于多项式级别。因此我们只需要在多项式时间内几乎无法分辨这两个分布,这引出了:
Negligible Functions: Let , we sat is negligible (as a function of ) if for any positive polynomial , there exists a constant such that .
显然这个函数对于加法和乘法封闭。
在课程中为了方便,定义 is noticeable in :存在 当 充分大。
定义 happens with overwhelming probability: 当 充分大。
使用 衡量分布之间的差别,也被称作 Statistical Distance:
称 为 statistical close,此时 为 statistical zero-knowledge.
当然也有 computational ZK: For any p.p.t. algorithm , .
三种 security 的安全度递减。
我们称所有拥有 perfect ZK 交互式证明的语言组成的类为 ,相对应地定义 ,则有
如果 则 .
[AH91] 证明了 。
Liberal Sense
GNI in PZK 的构造相当平凡,然而在处理很多问题时很难找到这么平凡的解。所以真正的定义放松了一点限制:
真正的 ZK 定义: is interactive proof, for any p.p.t. algorithm , there exists a p.p.t. algorithm such that
-
has at most 1/2 probability to output , which means simulation failed.
-
Let be conditioned on , then , and are identical/statistical close/computational indistinguishable.
还有一种定义是将 的限制放松为 expected polynomial time TM,被称作 ZK in the liberal sense 上课介绍的定义也是这个。但这种定义存在争议,教科书中说存在满足该定义未知是否满足上面定义的交互式证明。他没有给出例子,我也不知道是什么。
总之,放松了定义之后出现了一些非平凡的例子:
GI in PZK
- prover 随机选取一个图 ,加密(施加随机排列 )得到 发送给 verifier
- verifier 均匀随机一个 challenging bit
- prover 给出 。(实现方式是先确定 ,然后如果 则回答 否则回答 ,如果这一步才调用图同构算法后文的分析的时候会出现小问题,因为图同构算法不一定能保证均匀的取到每一个答案1)
completeness: 如果图是同构的,则任何时候都存在 ,prover 可以随时调用图同构算法求出 。
soundness: 如果图不是同构的,verifier 有 1/2 概率选到不存在 的情况,无论如何都无法回答正确的 。
zero-knowledge:
- 需要构造 使得 和 接近,但是 并不知道 的同构排列,因此我们无论如何都无法在 的情况下模拟出 prover 的解。(如果可以,那么 verifier 也可以自行计算出同构排列了)
- 可能会有想法说:由于 只需要输出一个同分布的交互序列,因此我们可以调转顺序,先 sample 出 和 ,再画靶子得到 .
- 这样乍一看很合理,还没有放宽定义,但这么做是有问题的:我们无法先 sample 出 。不同于 honest-verifier 的情况, 是任意的,而且可以依赖于 。至少按我们的理解来讲,很难做到在不模拟 的情况下得到 ,更别说得到它的分布并反推随机带了。
- 因此事实上的构造是: 按照 的逻辑得到 与 ,然后模拟 (其中随机带 由 的随机带给定,并作为输出的一部分)得到 ,如果 ,输出 。否则 可以确定第三步给出的是 。
- 在这种情况下, 的概率由 的 1:1 逻辑均分了,因此 输出 的概率恰为 1/2,符合条件。
- 对于 的证明,书上写的很长。我稍微简化一下:
- 定义 ,则 。因为 的数量是 而 是确定的,因此对于固定的 只有 个 ,取决于 的输出。这其实描述了 的分布,就是 上的均匀分布,因为 的输出被提前预测了,而给出的排列和图都是均匀的。
- 对于真实情况下的 view,因为 是均匀的,因此得到的 对于固定的 也是均匀的。而加密得到的图已经是均匀的了,所以 view 的分布也是 上的均匀分布。
通过把模拟机重复 次可以做到 的模拟成功率。但是书上说如果 的增长速度超过 则可能不是零知识的,说是后面会讨论。我不明白这是什么意思,大概学到后面就知道了。