Hi all,
In my quest to further understand the mechanics of Bitcoin, I ran into a asymmetric key question.
The Bitcoin wiki simply states that for creating private/public keys, Bitcoin applies the Elliptic Curve Digital Signature Algorithm or ECDSA (
https://en.bitcoin.it/wiki/Elliptic_Curve_Digital_Signature_Algorithm). In the Bitcoin developer guide it reads that Bitcoin uses the Elliptic Curve Digital Signature Algorithm (ECDSA) with the secp256k1 curve (
https://bitcoin.org/en/developer-guide#transactions).
However, in this scientific article (
http://link.springer.com/chapter/10.1007%2F978-3-319-12400-1_35#page-1) it reads that Bitcoin uses the Elliptic Curve DSA over the NIST P-256 curve.
This overview of curves
http://safecurves.cr.yp.to/ indicates that the two curves above are not considered safe.
When I Google for bitcoin ecdsa "p-256" site:github.com and bitcoin ecdsa "secp256" site:github.com, both return results. The code itself doesn't provide an answer, to me (sorry, lousy coder here).
So, my questions are:
1. Which ECDSA curve is used in Bitcoin to generate a private key? Where does it read in the code?
2. Why are both curves mentioned on Bitcoin's Github?
3. If either is used, is that a smart thing to do, considering that both are not considered safe? Wouldn't it be better to use a 'safe' curve?
4. Would it be possible to use both curves amongst multiple users, depending on a user's preferences?
5. Extending that question, if someone found a major flaw in the ECDSA algorithm currently used, would it be possible to switch to another ECDSA algorithm? (no worries, I didn't find a major flaw :-) )
Thanks for reading.
Fevir