Elliptic Curves - Bitcoin & Haskell
In this series of posts I’m solving the exercises of Programming Bitcoin in Haskell, I’m learning Bitcoin and Haskell in one go. To describe a point in the elliptic curve, we need four data points. \((x, y)\) are the coordinates themselves, additionally we need the constants \((a, b)\) that define the elliptic curve given by the equation \(y^2 = x^3 + ax +b\). Finally, there is the special case of the point at infinity, which does not really fit in the previous constrain. In other languages I would just describe with an invalid or null value, in Python for example I would use the None value in both \((x, y)\) coordinates, yet in Haskell it can be beautifully defined as an element of the type. That is certainly a killer feature of the language, and I expect to be using it more often.