succinctlabs / sp1

A performant, 100% open-source, contributor-friendly zkVM.
https://succinctlabs.github.io/sp1
Apache License 2.0
951 stars 297 forks source link

sp1-patches/rust-secp256k1 doesn't support `ecdsa_verify` using SP1 precompiles #1631

Closed KevinYum closed 2 days ago

KevinYum commented 1 week ago

ECDSA recovery (for public key) has adopted SP1 ZKVM precompile instructions https://github.com/sp1-patches/rust-secp256k1/blob/patch-secp256k1-v0.29.0/src/ecdsa/recovery.rs#L210

ECDSA signature verification is still using the native implementation and cost 40x more cycles compared with the ECDSA recovery https://github.com/sp1-patches/rust-secp256k1/blob/patch-secp256k1-v0.29.0/src/ecdsa/mod.rs#L389

For non-evm applications, ECDSA verification can be a more general use case.

ratankaliani commented 1 week ago

Thanks for creating this @KevinYum ! We should have a fix for this soon.