Spartan-ECDSA:最快的浏览器内 ZK secp256k1 ECDSA

1. 引言

前序博客:

Personae Labs开源的:

为当前最快的ZK ECDSA(sep256k1)。
Spartan-ECDSA证明ECDSA group membership的速度 要比 之前Personae Labs开源Efficient ZK ECDSA 快10倍。

Proving membership to a group of ECDSA public keys的性能情况为:

Benchmark#
Constraints8,076
Proving time in browser4s
Proving time in Node.js2s
Verification time in browser1s
Verification time in Node.js300ms
Proof size16kb
  • Measured on a M1 MacBook Pro with 80Mbps internet speed.
  • Both proving and verification time in browser includes the time to download the circuit.

Spartan-ECDSA的核心技术为:

  • 1)Secp256k1曲线+Secq256k1曲线(Secp256k1曲线的scalar域 为 Secq256k1曲线的基域):因ECDSA验签过程中不仅包含 F p \mathbb{F}_p Fp域内的运算,还包含 F q \mathbb{F}_q Fq域内的运算。
  • 2)Spartan证明系统:使用了基于Secq256k1曲线的Spartan分支。
  • 3)Circom:Circom用于定义arithmetic circuit。采用了基于Secp256k1基域(即Secq256k1 scalar域)的Circom分支来进行算术化。
  • 4)Nova-Scotia:为Circom R1CS编译器。fork了一个分支来将Circom circuits编译为Spartan可处理的二进制格式,并对Nova-Scotia做了小调整以兼容Secq256k1。

Personae Labs团队未来将进一步:

  • 1)对Keccak加速
  • 2)使链上验证成为可能:如可利用递归证明,降低单个证明的验证开销。

参考资料

[1] Twitter Introducing spartan-ecdsa
[2] ebfull hackmd Wait, what are these isomorphic elliptic curves doing on the secp256k1/secq256k1 cycle?
[3] Personae Labs 2023年2月博客 Introducing Spartan-ecdsa

附录:Secp256k1/Secq256k1曲线cycle

Secp256k1椭圆曲线 y 2 = x 3 + 7 y^2=x^3+7 y2=x3+7 defined over F p \mathbb{F}_p Fp with order q q q,而Secq256k1椭圆曲线 y 2 = x 3 + 7 y^2=x^3+7 y2=x3+7 defined over F q \mathbb{F}_q Fq with order p p p,二者形成了2-cycle curve,相应的SageMath脚本验证为:

p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f
q = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141

# Secp256k1

P = GF(p)
aP = P(0x0000000000000000000000000000000000000000000000000000000000000000)
bP = P(0x0000000000000000000000000000000000000000000000000000000000000007)
Secp256k1 = EllipticCurve(P, (aP, bP))
Secp256k1.set_order(q)

# Secq256k1

Q = GF(q)
aQ = P(0x0000000000000000000000000000000000000000000000000000000000000000)
bQ = P(0x0000000000000000000000000000000000000000000000000000000000000007)
Secq256k1 = EllipticCurve(Q, (aQ, bQ))
Secq256k1.set_order(p)

print(
"Secp256k1 group order == Secq256k1 base field order:",
Secp256k1.order() == Secq256k1.base_field().cardinality()
)

print(
"Secp256k1 base field order == Secq256k1 group order:",
Secp256k1.base_field().cardinality() == Secq256k1.order()
)
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值