可验证延迟函数(VDF)

可验证延迟函数(Verifiable Delay Function, VDF):
VDF 这个概念最初由斯坦福大学密码学教授 Dan Boneh 等人在2018年论文《Verifiable Delay Functions》中给出。该篇文章于 2018 年发表在密码学*会议之一的 CRYPTO 上。

目前的VDF算法复杂度较高,离实用仍有差距。

https://github.com/Chia-Network/vdf-competition/中有对VDF的实现进行了竞赛。

[研究]可验证延迟函数(VDF)(一)一文搞懂VDF中有很详细的介绍。

https://github.com/cambrian/accumulator/blob/master/src/group/class.rs中有对https://github.com/Chia-Network/vdf-competition/blob/master/classgroups.pdf的class group 做实现。

VDF是串行运算算法,执行时间可预知,且无法通过并行来加速。通过VDF生成的证明可被快速verify。
目前知名的不可并行的串行运算为:对未知order的group进行repeated squaring。
The unknown order requirement is due to the divisibility of the order of a finite group by the order of any element in the group; if the group order is known then the repeated squaring operation could be reduced modulo the order of the group, shortcutting the computation.

在VDF中:

  • 若使用RSA group,则需要trusted setup,并保证生成后的有毒垃圾被即时清理,否则VDF的sequentiality requirement将broken。
  • 若使用class group of binary quadratic form将不需要trusted setup。因为其order为一个负素数判别式dd,当d3 mod 4|d|\equiv 3\ mod\ 4时,is believed to be difficult to compute when jdj is sufficiently large, making the order of the class group effectively unknown. Therefore, a suitable discriminant ——and its associated class group —— can be chosen without the need for a trusted setup, which is a major advantage for using class groups in applications requiring groups of unknown order.

1. Binary quadratic form

f(x,y)=ax2+bxy+cy2f(x,y)=ax^2+bxy+cy^2, where a,b,cRa,b,c\in R and a!=0,b!=0,c!=0a!=0, b!=0,c!=0
f=(a,b,c)f=(a,b,c)可称为a form。
f=(a,b,c)f=(a,b,c), where a,b,cZa,b,c\in Z and a!=0,b!=0,c!=0a!=0, b!=0,c!=0,则 f 称为integral form。
conf(f)=gcd(a,b,c)conf(f)=gcd(a,b,c)称为content of a form。
conf(f)=1conf(f)=1,则form f称为primitive。
discriminant of form f为:Δ(f)=b24ac\Delta(f)=b^2-4ac
a<ba-a<b\leq a,则form f=(a,b,c)f=(a,b,c)称为normal。

可验证延迟函数(VDF)

1.1 Normalization操作

Normalization操作(当a<ba-a<b\leq a时,需要进行此操作, Normalization操作不会影响discriminant值,既b24acb^2-4ac保持不变。):
η(f)=η(a,b,c)=(a,b+2ra,ar2+br+c)\eta(f)=\eta(a,b,c)=(a,b+2ra,ar^2+br+c),其中r=ab2ar=\left \lfloor \frac{a-b}{2a} \right \rfloor
fnorm=(a,b,c)=η(a,b,c)f_{norm}=(a',b',c')=\eta(a,b,c)f=(a,b,c)f=(a,b,c),则fnormff_{norm}\sim f两者等价:
U=(1r01)U=\begin{pmatrix} 1&r \\ 0&1 \end{pmatrix}(fU)(x,y)=fnorm(fU)(x,y)=f_{norm}
可验证延迟函数(VDF)

1.3 Reduced form

在Chia VDF中频繁地reduce f(a,b,c)f(a,b,c)非常重要,可保证在做平方运算时,a,b,c的值不会增长过大。
f=(a,b,c)f=(a,b,c)已为normal,且a<ca<c或者当a=cb0a=c时,b\geq0,则称 f 为Reduced form。
可验证延迟函数(VDF)
可验证延迟函数(VDF)

1.3 Reduction操作

在reduction操作之前应先进行normalization操作。
Reduction操作为(当a>ca>c时或a=c and b<0a=c\ and\ b<0,需要进行此操作, Reduction操作不会影响discriminant值,既b24acb^2-4ac保持不变。):
对于f=(a,b,c)f=(a,b,c),有reduction操作ρ(f)=ρ(a,b,c)=(c,b+2sc,cs2bs+a)\rho(f)=\rho(a,b,c)=(c,-b+2sc,cs^2-bs+a),其中r=c+b2cr=\left \lfloor \frac{c+b}{2c} \right \rfloor

ρ(a,b,c)η(c,b,a)\rho(a,b,c)\sim \eta(c,-b,a)两者等价。
fred=(a,b,c)=ρ(a,b,c)f_{red}=(a',b',c')=\rho(a,b,c),则f=(a,b,c)fredf=(a,b,c)\sim f_{red}两者等价,其中的U=(011r)U=\begin{pmatrix} 0&-1 \\ 1&r \end{pmatrix}(fU)(x,y)=fred(fU)(x,y)=f_{red}
可验证延迟函数(VDF)
如上图所示,reduction算法会循环执行步骤2,以保证最终获得reduced form。执行步骤2的次数为:
可验证延迟函数(VDF)

可验证延迟函数(VDF)

1.4 composition计算

可验证延迟函数(VDF)

1.4.1 squaring算法

可验证延迟函数(VDF)

1.4.2 linear congruence算法

可验证延迟函数(VDF)

2. Matrix表示a form

M(f)=(ab/2b/2c)M(f)=\begin{pmatrix} a&b/2 \\ b/2&c \end{pmatrix},其中det(M(f))=acb24det(M(f))=ac-\frac{b^2}{4}
X=(xy)X=\begin{pmatrix} x&y \end{pmatrix},则有:
f(x,y)=ax2+bxy+cy2=X M(f) XT=(xy)(ab/2b/2c)(xy)f(x,y)=ax^2+bxy+cy^2=X\ M(f)\ X^T =\begin{pmatrix} x&y \end{pmatrix}\begin{pmatrix} a&b/2 \\ b/2&c \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix}

如上有:
Δ(f)=4det(M(f))=b24ac\Delta(f)=-4*det(M(f))=b^2-4ac

可验证延迟函数(VDF)

参考资料:
[1] [研究]可验证延迟函数(VDF)(一)一文搞懂VDF
[2] https://github.com/Chia-Network/vdf-competition/
[3] 2018年论文《Verifiable Delay Functions