The previous two chapters covered some fundamental math. We learned how finite fields work and what an elliptic curve is. In this chapter, we’re going to combine the two concepts to learn elliptic curve cryptography. Specifically, we’re going to build the primitives needed to sign and verify messages, which is at the heart of what Bitcoin does.
We discussed in Chapter 2 what an elliptic curve looks like visually because we were plotting the curve over real numbers. Specifically, it’s not just integers or even rational numbers, but all real numbers. Pi, sqrt(2), e+7th root of 19, and the like are all real numbers.
This worked because real numbers are also a field. Unlike a finite field, there are an infinite number of real numbers, but otherwise the same properties hold:
If a and b are in the set, a + b and a ⋅ b are in the set.
0 exists and has the property a + 0 = a.
1 exists and has the property a ⋅ 1 = a.
If a is in the set, –a is in the set, which is defined as the value that makes a + (–a) = 0.
If a is in the set and is not 0, a–1 is in the set, which is defined as the value that makes a ⋅ a–1 = 1.
Clearly, all of these are true: normal addition and multiplication apply for the first part, the additive and multiplicative identities 0 and 1 exist, –x is the additive inverse, and 1/x is the multiplicative inverse.
Real numbers are easy to plot on a graph. For example, y2 = x3 + 7 can be plotted like ...