主要来源 https://blog.ethereum.org/2016/12/05/zksnarks-in-a-nutshell/ 中“Tradeoff between Input and Witness Size”段落
论文GGPR12中,生成的proof只有7个elements of a group. Verifier主要需要计算pairing等式的成立(如 W := E(w(s)),W’ := E(α w(s)),则e(W’, E(1)) = e(E(α w(s)), E(1)) = e(g,g)αw(s) = e(gw(s),gα) = e(E(w(s)), E(α)) = e(W, E(α)))以及计算E(vin(s))。 计算E(vin(s))的时效与input size的大小呈线性关系。 在verification时,witness string size和验证QSP都不会有任何影响。 也就是说,因为SNARK在做verify时仅仅是check多项式at a single point而不是计算整个多项式,所以SNARK在verify复杂问题和简单问题都需要相同的时效。
影响SNARK verification时效的因素主要有:
- the level of security(如 the size of the group)
- the maximum size for the inputs
所以,降低input size的大小,转移input的信息至witness,是一种可行的办法: