1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2025-01-11 08:10:54 +00:00

Edited ch04_keys.adoc with Atlas code editor

This commit is contained in:
clenser 2023-10-19 19:57:26 +00:00
parent 4879ca2eac
commit 21c4c3af44

View File

@ -88,7 +88,7 @@ signatures.
==== Private Keys ==== Private Keys
A A
private ((("public key cryptography", "private keys", "generating", id="pub-key-private-generate")))((("private keys", "generating", id="private-key-generate")))key is simply a number, picked at random. Control private ((("private keys", "generating", id="private-key-generate")))key is simply a number, picked at random. Control
over the private key is the root of user control over all funds over the private key is the root of user control over all funds
associated with the corresponding Bitcoin public key. The private key is associated with the corresponding Bitcoin public key. The private key is
used to create signatures that are used to spend bitcoins by proving used to create signatures that are used to spend bitcoins by proving
@ -152,7 +152,7 @@ bits):
==== ====
The size of Bitcoin's private key space, (2^256^) is an unfathomably The size of Bitcoin's private key space, (2^256^) is an unfathomably
large number. It is approximately 10^77^ in decimal. For comparison, the large number. It is approximately 10^77^ in decimal. For comparison, the
visible universe is estimated to((("public key cryptography", "private keys", "generating", startref="pub-key-private-generate")))((("private keys", "generating", startref="private-key-generate"))) contain 10^80^ atoms. visible universe is estimated to((("private keys", "generating", startref="private-key-generate"))) contain 10^80^ atoms.
==== ====
[[elliptic_curve]] [[elliptic_curve]]
@ -286,7 +286,7 @@ that k is sometimes confusingly called an "exponent" in ((("public key cryptogra
[[public_key_derivation]] [[public_key_derivation]]
==== Public Keys ==== Public Keys
The ((("public key cryptography", "public keys", "generating", id="pub-key-public-generate")))((("public keys", "generating", id="public-key-generate")))((("elliptic curve multiplication", id="elliptic-multiply")))public key is calculated from The ((("public keys", "generating", id="public-key-generate")))((("elliptic curve multiplication", id="elliptic-multiply")))public key is calculated from
the private key using elliptic curve multiplication, which is the private key using elliptic curve multiplication, which is
irreversible: _K_ = _k_ * _G_, where _k_ is the private key, _G_ is a irreversible: _K_ = _k_ * _G_, where _k_ is the private key, _G_ is a
constant point called the _generator point_, and _K_ is the resulting constant point called the _generator point_, and _K_ is the resulting
@ -373,7 +373,7 @@ geometric operation on the curve.
==== ====
Many Bitcoin implementations use Many Bitcoin implementations use
the https://oreil.ly/wD60m[libsecp256k1 crytographic the https://oreil.ly/wD60m[libsecp256k1 crytographic
library] to do the elliptic curve((("public key cryptography", "public keys", "generating", startref="pub-key-public-generate")))((("public keys", "generating", startref="public-key-generate")))((("elliptic curve multiplication", startref="elliptic-multiply"))) math. library] to do the elliptic curve((("public keys", "generating", startref="public-key-generate")))((("elliptic curve multiplication", startref="elliptic-multiply"))) math.
==== ====
[[ecc_illustrated]] [[ecc_illustrated]]
@ -1423,7 +1423,7 @@ support for new Bitcoin features as soon as they become ((("public key cryptogra
[[priv_formats]] [[priv_formats]]
==== Private Key Formats ==== Private Key Formats
The ((("private keys", "formats", id="private-key-format")))((("public key cryptography", "private keys", "formats", id="pub-key-private-format")))private key The ((("private keys", "formats", id="private-key-format")))private key
can be represented in a number of different formats, all of which can be represented in a number of different formats, all of which
correspond to the same 256-bit number. <<table_4-2>> shows several common correspond to the same 256-bit number. <<table_4-2>> shows several common
formats used to represent private keys. Different formats are used in formats used to represent private keys. Different formats are used in
@ -1517,12 +1517,12 @@ See <<hd_wallets>> for more information.
All of these representations are different ways of showing the same All of these representations are different ways of showing the same
number, the same private key. They look different, but any one format number, the same private key. They look different, but any one format
can easily be converted to any other((("private keys", "formats", startref="private-key-format")))((("public key cryptography", "private keys", "formats", startref="pub-key-private-format"))) format. can easily be converted to any other((("private keys", "formats", startref="private-key-format"))) format.
[[comp_priv]] [[comp_priv]]
==== Compressed Private Keys ==== Compressed Private Keys
The commonly((("private keys", "compressed", id="private-key-compress")))((("public key cryptography", "private keys", "compressed", id="pub-key-private-compress")))((("compressed private keys", id="compress-private-key"))) used term "compressed private key" is a misnomer, because when a private The commonly((("private keys", "compressed", id="private-key-compress")))((("compressed private keys", id="compress-private-key"))) used term "compressed private key" is a misnomer, because when a private
key is exported as WIF-compressed it is actually one byte _longer_ than key is exported as WIF-compressed it is actually one byte _longer_ than
an "uncompressed" private key. That is because the private key has an an "uncompressed" private key. That is because the private key has an
added one-byte suffix (shown as 01 in hex in <<table_4-4>>), which added one-byte suffix (shown as 01 in hex in <<table_4-4>>), which
@ -1598,7 +1598,7 @@ is modified, with the addition of a one-byte suffix +01+ to the private
key. The resulting base58check-encoded private key is called a key. The resulting base58check-encoded private key is called a
"compressed WIF" and starts with the letter _K_ or _L_, instead of "compressed WIF" and starts with the letter _K_ or _L_, instead of
starting with "5" as is the case with WIF-encoded (uncompressed) keys starting with "5" as is the case with WIF-encoded (uncompressed) keys
from((("private keys", "compressed", startref="private-key-compress")))((("public key cryptography", "private keys", "compressed", startref="pub-key-private-compress")))((("compressed private keys", startref="compress-private-key"))) older wallets. from((("private keys", "compressed", startref="private-key-compress")))((("compressed private keys", startref="compress-private-key"))) older wallets.
=== Advanced Keys and Addresses === Advanced Keys and Addresses