AntonKueltz / fastecdsa

Python library for fast elliptic curve crypto
https://pypi.python.org/pypi/fastecdsa
The Unlicense
270 stars 78 forks source link

how do I calculate recover_id from signature #86

Closed yxy closed 2 years ago

yxy commented 2 years ago

I want to get the pubkey recover id from signature, but I couldn't found any method to do it, anyone knowns how to do it ?

thanks advance

ref: https://github.com/starkbank/ecdsa-python/blob/209eab454f1e071c5893cc6cbdb8aaa0c1a85801/ellipticcurve/ecdsa.py#L23

AntonKueltz commented 2 years ago

I believe recovery id is a bitcoin / cryptocurrency specific (based on this source), in which case it is out of scope for this library. It seems that requires changing the sign interface from returning (int, int) to returning (Point, int) (in other words, making r a point rather than an integer) which I can fairly confidently say would be a breaking change and also not compliant with the most common / accepted ECDSA spec(s).