Halo2 学习笔记——设计之Proving system之Circuit commitments(3)

1. 引言

在创建proof之前,Prover有a table of cell assignments that it claims satisfy the constraint system。该table具有 n = 2 k n=2^k n=2k行,可分为 advice columns、instance columns 以及 fixed columns。
将第 i i i个fixed column中的第 j j j行的assignment定义为 F i , j F_{i,j} Fi,j,同理,定义advice 和 instance assignment为 A i , j A_{i,j} Ai,j
【注意,此处将fixed column assignment 与advice/instance column assignment区分的主要原因是:fixed columns由Verifier提供,而advice columns和instance columns 由Prover提供。实际上,instance column 和 fixed column的commitment均由Prover和Verifier计算,仅advice commitment会存储在proof中。】

为了对这些assignment进行commit,需为每列构建degree n − 1 n-1 n1 Lagrange polynomials,基于的evaluation domain size 为 n n n(其中 ω \omega ω n n n-th primitive root of unity):

  • a i ( X ) a_i(X) ai(X) interpolates such that a i ( ω j ) = A i , j a_i(\omega^j) = A_{i,j} ai(ωj)=Ai,j.
  • f i ( X ) f_i(X) fi(X) interpolates such that f i ( ω j ) = F i , j f_i(\omega^j) = F_{i,j} fi(ωj)=Fi,j.

然后为每列的polynomial创建blinding commitment:
A = [ Commit ( a 0 ( X ) ) , … , Commit ( a i ( X ) ) ] \mathbf{A} = [\text{Commit}(a_0(X)), \dots, \text{Commit}(a_i(X))] A=[Commit(a0(X)),,Commit(ai(X))]
F = [ Commit ( f 0 ( X ) ) , … , Commit ( f i ( X ) ) ] \mathbf{F} = [\text{Commit}(f_0(X)), \dots, \text{Commit}(f_i(X))] F=[Commit(f0(X)),,Commit(fi(X))]

F \mathbf{F} F会作为key generation的一部分生成,使用的blinding factor为 1 1 1 A \mathbf{A} A由Prover构建并发送给Verifier。

2. Committing to the lookup permutations

1)首先,Verifier提供sampling challenge θ \theta θ 用于keep individual columns within lookups independent。

2)然后,Prover commits to the permutations for each lookup:

  • 已知a lookup 具有 input column polynomials [ A 0 ( X ) , … , A m − 1 ( X ) ] [A_0(X), \dots, A_{m-1}(X)] [A0(X),,Am1(X)] 和 table column polynomials [ S 0 ( X ) , … , S m − 1 ( X ) ] [S_0(X), \dots, S_{m-1}(X)] [S0(X),,Sm1(X)],Prover会构建2个压缩的多项式:
    A compressed ( X ) = θ m − 1 A 0 ( X ) + θ m − 2 A 1 ( X ) + ⋯ + θ A m − 2 ( X ) + A m − 1 ( X ) A_\text{compressed}(X) = \theta^{m-1} A_0(X) + \theta^{m-2} A_1(X) + \dots + \theta A_{m-2}(X) + A_{m-1}(X) Acompressed(X)=θm1A0(X)+θm2A1(X)++θAm2(X)+Am1(X)
    S compressed ( X ) = θ m − 1 S 0 ( X ) + θ m − 2 S 1 ( X ) + ⋯ + θ S m − 2 ( X ) + S m − 1 ( X ) S_\text{compressed}(X) = \theta^{m-1} S_0(X) + \theta^{m-2} S_1(X) + \dots + \theta S_{m-2}(X) + S_{m-1}(X) Scompressed(X)=θm1S0(X)+θm2S1(X)++θSm2(X)+Sm1(X)

  • Prover会根据 lookup argument的rules 来 permutes A compressed ( X ) A_\text{compressed}(X) Acompressed(X) S compressed ( X ) S_\text{compressed}(X) Scompressed(X)

3)Prover为所有的lookups创建blinding commitments,并将相应的blinding commitments发送给Verifier。
L = [ ( Commit ( A ′ ( X ) ) ) , Commit ( S ′ ( X ) ) ) , …   ] \mathbf{L} = \left[ (\text{Commit}(A'(X))), \text{Commit}(S'(X))), \dots \right] L=[(Commit(A(X))),Commit(S(X))),]

4)Verifier收到 A \mathbf{A} A F \mathbf{F} F L \mathbf{L} L之后,发送将用于permutation argument和lookup argument中的random challenges β , γ \beta,\gamma β,γ。(因为2个argument是独立的,因此可复用 β , γ \beta,\gamma β,γ。)

3. Committing to the equality constraint permutation

c c c为the number of columns that are enabled for equality constraints。

m m m为可容纳于column set 中的maximum number of columns,该值不会超过 PLONK配置的polynomial degree bound。

u u u为定义在 Permutation argument 中的 number of “usable” rows。

b = c e i l i n g ( c / m ) b = \mathsf{ceiling}(c/m) b=ceiling(c/m)

1)Prover构建长度为 b u bu bu 的 vector P \mathbf{P} P,对于每一个column set 0 ≤ a < b 0\leq a <b 0a<b和每行 0 ≤ j < u 0\leq j<u 0j<u,有:
P a u + j = ∏ i = a m min ⁡ ( c , ( a + 1 ) m ) − 1 v i ( ω j ) + β ⋅ δ i ⋅ ω j + γ v i ( ω j ) + β ⋅ s i ( ω j ) + γ . \mathbf{P}_{au + j} = \prod\limits_{i=am}^{\min(c, (a+1)m)-1} \frac{v_i(\omega^j) + \beta \cdot \delta^i \cdot \omega^j + \gamma}{v_i(\omega^j) + \beta \cdot s_i(\omega^j) + \gamma}. Pau+j=i=ammin(c,(a+1)m)1vi(ωj)+βsi(ωj)+γvi(ωj)+βδiωj+γ.
2)Prover 从 1 1 1开始,计算a running product of P \mathbf{P} P,同时计算a vector of polynomials Z P , 0.. b − 1 Z_{P,0..b-1} ZP,0..b1 that each have a Lagrange basis representation corresponding to a u u u-sized slice of this running product,详细参看Permutation argument
3)Prover为每个 Z p , a Z_{p,a} Zp,a多项式创建blinding commitments,并将这些blinding commitments值发送给Verifier:
Z P = [ Commit ( Z P , 0 ( X ) ) , … , Commit ( Z P , b − 1 ( X ) ) ] \mathbf{Z_P} = \left[\text{Commit}(Z_{P,0}(X)), \dots, \text{Commit}(Z_{P,b-1}(X))\right] ZP=[Commit(ZP,0(X)),,Commit(ZP,b1(X))]

4. Committing to the lookup permutation product columns

对于每个lookup,除了需要commit to the individual permuted lookups,Prover还需要commit to the permutation product column:

  • Prover构建a vector P P P
    P j = ( A compressed ( ω j ) + β ) ( S compressed ( ω j ) + γ ) ( A ′ ( ω j ) + β ) ( S ′ ( ω j ) + γ ) P_j = \frac{(A_\text{compressed}(\omega^j) + \beta)(S_\text{compressed}(\omega^j) + \gamma)}{(A'(\omega^j) + \beta)(S'(\omega^j) + \gamma)} Pj=(A(ωj)+β)(S(ωj)+γ)(Acompressed(ωj)+β)(Scompressed(ωj)+γ)
  • Prover构建a polynomial Z L Z_L ZL,该polynomial Z L Z_L ZL具有a Lagrange basis representation corresponding to a running product of P P P,初始有 Z L ( 1 ) = 1 Z_L(1)=1 ZL(1)=1
  • Verifier收到 A \mathbf{A} A F \mathbf{F} F L \mathbf{L} L(即已commit to all the cell values used in lookup columns和每个lookup的 A ′ ( X ) , S ′ ( X ) A'(X),S'(X) A(X),S(X))之后,发送将用于random challenges β , γ \beta,\gamma β,γ
  • Prover使用 β , γ \beta,\gamma β,γ用于combine the permutation argument for A ′ ( X ) A'(X) A(X) S ′ ( X ) S'(X) S(X)并保持两者独立。
  • Prover为每个 Z L Z_L ZL多项式创建blinding commitments,并将这些blinding commitments 发送给Verifier:
    Z L = [ Commit ( Z L ( X ) ) , …   ] \mathbf{Z_L} = \left[\text{Commit}(Z_L(X)), \dots \right] ZL=[Commit(ZL(X)),]

参考资料

[1] Halo2 Book 之 circuit commitment

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
【优质项目推荐】 1、项目代码均经过严格本地测试,运行OK,确保功能稳定后才上传平台。可放心下载并立即投入使用,若遇到任何使用问题,随时欢迎私信反馈与沟通,博主会第一时间回复。 2、项目适用于计算机相关专业(如计科、信息安全、数据科学、人工智能、通信、物联网、自动化、电子信息等)的在校学生、专业教师,或企业员工,小白入门等都适用。 3、该项目不仅具有很高的学习借鉴价值,对于初学者来说,也是入门进阶的绝佳选择;当然也可以直接用于 毕设、课设、期末大作业或项目初期立项演示等。 3、开放创新:如果您有一定基础,且热爱探索钻研,可以在此代码基础上二次开发,进行修改、扩展,创造出属于自己的独特应用。 欢迎下载使用优质资源!欢迎借鉴使用,并欢迎学习交流,共同探索编程的无穷魅力! 基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip 基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip 基于业务逻辑生成特征变量python实现源码+数据集+超详细注释.zip
提供的源码资源涵盖了安卓应用、小程序、Python应用和Java应用等多个领域,每个领域都包含了丰富的实例和项目。这些源码都是基于各自平台的最新技术和标准编写,确保了在对应环境下能够无缝运行。同时,源码中配备了详细的注释和文档,帮助用户快速理解代码结构和实现逻辑。 适用人群: 这些源码资源特别适合大学生群体。无论你是计算机相关专业的学生,还是对其他领域编程感兴趣的学生,这些资源都能为你提供宝贵的学习和实践机会。通过学习和运行这些源码,你可以掌握各平台开发的基础知识,提升编程能力和项目实战经验。 使用场景及目标: 在学习阶段,你可以利用这些源码资源进行课程实践、课外项目或毕业设计。通过分析和运行源码,你将深入了解各平台开发的技术细节和最佳实践,逐步培养起自己的项目开发和问题解决能力。此外,在求职或创业过程中,具备跨平台开发能力的大学生将更具竞争力。 其他说明: 为了确保源码资源的可运行性和易用性,特别注意了以下几点:首先,每份源码都提供了详细的运行环境和依赖说明,确保用户能够轻松搭建起开发环境;其次,源码中的注释和文档都非常完善,方便用户快速上手和理解代码;最后,我会定期更新这些源码资源,以适应各平台技术的最新发展和市场需求。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值