From 807b19fad5fbf6df31426dc4ab926d875bd484af Mon Sep 17 00:00:00 2001 From: yancy ribbens Date: Sat, 30 Mar 2019 13:57:15 +0100 Subject: [PATCH] Remove subscript tag from code block --- 01_0_Introducing_Bitcoin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/01_0_Introducing_Bitcoin.md b/01_0_Introducing_Bitcoin.md index f2ebdce..8c48302 100644 --- a/01_0_Introducing_Bitcoin.md +++ b/01_0_Introducing_Bitcoin.md @@ -68,13 +68,13 @@ ECC stands for elliptic-curve cryptography. It's a specific branch of public-key ECC does not receive much attention in this tutorial. That's because this tutorial is all about integrating with Bitcoin Core and Lightning servers, which have already taken care of the cryptography for you. In fact, this tutorial's intention is that you don't have to worry about cryptography at all, because that's something that you _really_ want experts to deal with. -**_What is an Elliptic Curve?_** An elliptic curve is a geometric curve that takes the form `y2 = x3 + ax + b`. A specific elliptic curve is chosen by selecting specific values of `a` and `b`. The curve must then be carefully examined to determine if it works well for cryptography. For example, the secp256k1 curve used by Bitcoin is defined as `a=0` and `b=7`. +**_What is an Elliptic Curve?_** An elliptic curve is a geometric curve that takes the form `y``2` = `x``3`` + ax + b`. A specific elliptic curve is chosen by selecting specific values of `a` and `b`. The curve must then be carefully examined to determine if it works well for cryptography. For example, the secp256k1 curve used by Bitcoin is defined as `a=0` and `b=7`. Any line that intersects an elliptic curve will do so at either 1 or 3 points ... and that's the basis of elliptic-curve cryptopgrahy. **_What are Finite Fields?_** A finite field is a finite set of numbers, where all addition, subtraction, multiplication, and division is defined so that it results in other numbers also in the same finite field. One simple way to create a finite field is through the use of a modulo function. -**_How is an Elliptic Curve Defined Over a Finite Field?_** An ellipitic curve defined over a finite field has all of the points on its curve drawn from a specific finite field. This takes the form: `y2 % field-size = (x3 + ax + b) % field-size` The finite field used for secp256k1 is `2256 - 232 - 29 - 28 - 27 - 26 - 24 - 1`. +**_How is an Elliptic Curve Defined Over a Finite Field?_** An ellipitic curve defined over a finite field has all of the points on its curve drawn from a specific finite field. This takes the form: `y``2` `% field-size = (x``3`` + ax + b) % field-size` The finite field used for secp256k1 is `2``256`` - 2``32`` - 2``9`` - 2``8`` - 2``7`` - 2``6`` - 2``4`` - ``1``. **_How Are Elliptic Curves Used in Cryptography?_** In elliptic-curve cryptography, a user selects a very large (256-bit) number as his private key. He then adds a set base point on the curve to itself that many times. (In secp256k1, the base point is `G = 04 79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B 16F81798 483ADA77 26A3C465 5DA4FBFC 0E1108A8 FD17B448 A6855419 9C47D08F FB10D4B8`, which prefixes the two parts of the tuple with an `04` to say that the data point is in uncompressed form. If you prefer a straight geometric definition, it's the point "0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798,0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8") The resultant number is the public key. Various mathematical formula can then be used to prove ownership of the public key, given the private key. As with any cryptographic function, this one is a trap door: it's easy to go from private key to public key and largely impossible to go from public key to private key.