diff --git a/ch00.asciidoc b/ch00.asciidoc index 9ab71e22..48cc4a11 100644 --- a/ch00.asciidoc +++ b/ch00.asciidoc @@ -135,11 +135,11 @@ People can pay for goods and services using bitcoin as the currency. mg Bitcoin transactions, which transfer value from one bitcoin address to another, are recorded in a distributed ledger, called the _blockchain_. In simple terms, think of the ledger as a book with lines like this: ---- -Address 27 gave 2 bitcoin to address 81 -Address 132 gave 1.05 bitcoin to address 22 -25 bitcoin were mined to address 76 -Address 13 gave 0.5 bitcoin to address 52 -Address 52 gave 0.015 bitcoin to address 166 +- Address 27 gave 2 bitcoin to address 81 +- Address 132 gave 1.05 bitcoin to address 22 +- 25 bitcoin were mined to address 76 +- Address 13 gave 0.5 bitcoin to address 52 +- Address 52 gave 0.015 bitcoin to address 166 ---- The ledger is a record of all bitcoin transactions and can be independently verified by every node. diff --git a/ch01.asciidoc b/ch01.asciidoc index 9ddc706b..cbbdc3c8 100644 --- a/ch01.asciidoc +++ b/ch01.asciidoc @@ -39,32 +39,33 @@ Elliptic curve multiplication can be visualized on a curve as drawing a line con .Elliptic Curve Cryptography: Visualizing the addition operator on the points of an elliptic curve image::images/ecc-addition.png["Addition operator on points of an elliptic curve"] -Bitcoin specifically uses the +secp256k1+ elliptic curve which is a standardized curve on a group field of large prime order: +Bitcoin specifically uses the +secp256k1+ elliptic curve: [latexmath] ++++ \begin{equation} {y^2 = (x^3 + 7)} over \mathbb{F}_p +\end{equation} +++++ or +[latexmath] +++++ +\begin{equation} {y^2 \mod p = (x^3 + 7) \mod p} - -where p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F, a very large prime. - \end{equation} ++++ +where +p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F+, a very large prime. + + The +mod p+ indicates that this curve is over a finite field of prime order +p+, also written as F(p). The curve looks like a pattern of dots scattered in two dimensions, which makes it difficult to visualize. However, the math is identical as that of an elliptic curve over the real numbers shown above. [[ecc-over-F37-math]] .Elliptic Curve Cryptography: Visualizing the addition operator on the points of an elliptic curve over F(p) image::images/ecc-over-F37-math.png["Addition operator on points of an elliptic curve over F(p)"] -[TIP] -==== -The bitcoin private key is just a number. A public key can be generated from any private key. Therefore, a public key can be generated from any number, up to 256-bits long. You can pick your keys randomly using a method as simple as dice, pencil and paper. -==== ==== Generating bitcoin keys @@ -72,10 +73,11 @@ The first and most important step in generating keys is to find a secure source [TIP] ==== -The size of bitcoin's private key, 2^256^ is a truly unfathomable number. It is equal to approximately 10^77^ in decimal. The visible universe contains approximately 10^80^ atoms. +The bitcoin private key is just a number. A public key can be generated from any private key. Therefore, a public key can be generated from any number, up to 256-bits long. You can pick your keys randomly using a method as simple as dice, pencil and paper. ==== + [[privkey_gen]] .Private key generation: From random mouse movements to a 256-bit number used as the private key image::images/privkey-gen.png["Private key generation"] @@ -138,7 +140,10 @@ err: <1> Multiplying the priv_key by the generator point of the elliptic curve group, produces the pub_key ==== - +[TIP] +==== +The size of bitcoin's private key, 2^256^ is a truly unfathomable number. It is equal to approximately 10^77^ in decimal. The visible universe contains approximately 10^80^ atoms. +==== === Simple Transactions