ECDSA Explained
ECDSA Explained
in Bitcoin
ECDSA (‘Elliptical Curve Digital Signature Algorithm’) is the
cryptography behind private and public keys used in Bitcoin. It
consists of combining the math behind finite fields and elliptic
curves to create one way equations, meaning you can choose
your private key (some number) and easily calculate your public
key (some other number). However, I can’t take my public key
(or anybody else’s for that matter) and easily calculate their
private key. In fact, for Bitcoin it would take trillions of
computers trillions of years of continuous guessing of different
private keys to figure out which one creates a given public key.
Finite Fields:
Elliptic Curve:
P+Q+R=0
so,
P + Q = -R
What about the case where P is tangent to the curve, such that
there are only two intersecting points.
When you combine finite fields and elliptic curves you get the
magic of cryptography. The equation for an elliptic curve
transforms to the following:
11P = R
P + 10P = R
P + 2(5P) = R
P + 2(P + 4P) = R
P + 2(P + 2(2P)) = R
P + 2(P + (2F)) = R
P + 2(P + C) = R
P + 2(D) = R
P+E=R
Add point P and point E to get R! So you can see how point
addition and point doubling allows us to calculate scalar
multiplication for xP = R.
Elliptic curves over finite fields have the same property. We can
continually add P on to itself creating scalar multiplication.
We can see that P = (3,6) and it takes 5Ps to get back to the
same point (3,6). That means P = (3,6) and so does 6P, 11P,
16P…etc. Check out this awesome calculator and visual tool
from Andrea Corbellini to verify and to try other examples.
Once you choose your private key and multiply it by the base
point P, you get a new point (x,y) in the finite field/elliptic
curve. This is your public key. It is computationally easy to use
your private key and multiply it by the base point to get the
public key, but it is computationally difficult to start with the
public key and work backwards to calculate the private key. The
equation is a one way street.