1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2025-01-26 15:41:34 +00:00

Made changes to ch04.asciidoc

This commit is contained in:
myarbrough@oreilly.com 2014-11-18 07:25:49 -08:00
parent ceb0f57117
commit d5e0783c68

View File

@ -345,7 +345,7 @@ Address: 1PRTTaJesdNovgne6Ehcdu1fpEdX7913CK
| WIF-compressed | K or L | As above, with added suffix 0x01 before encoding | WIF-compressed | K or L | As above, with added suffix 0x01 before encoding
|======= |=======
<<table_4-3>> shows the private key generated earlier in these three formats. <<table_4-3>> shows the private key generated in these three formats.
[[table_4-3]] [[table_4-3]]
.Example: Same key, different formats .Example: Same key, different formats
@ -357,11 +357,11 @@ Address: 1PRTTaJesdNovgne6Ehcdu1fpEdX7913CK
| WIF-compressed | KxFC1jmwwCoACiCAWZ3eXa96mBM6tb3TYzGmf6YwgdGWZgawvrtJ | WIF-compressed | KxFC1jmwwCoACiCAWZ3eXa96mBM6tb3TYzGmf6YwgdGWZgawvrtJ
|======= |=======
All of the these representations are different ways of showing the same number, the same private key. They look different, but any one format can easily be converted to any other format. All of these representations are different ways of showing the same number, the same private key. They look different, but any one format can easily be converted to any other format.
===== Decode from Base58Check to hex ===== Decode from Base58Check to hex
((("Base58Check encoding","decoding to hex")))((("sx tools","decoding Base58Check to/from hex")))The sx tools package (See <<sx_tools>>) makes it easy to write shell-scripts and command-line((("pipes"))) "pipes" that manipulate bitcoin keys, addresses, and transactions. You can use sx tools to decode the Base58Check format on the command line. ((("Base58Check encoding","decoding to hex")))((("sx tools","decoding Base58Check to/from hex")))The sx tools package (See <<sx_tools>>) makes it easy to write shell scripts and command-line((("pipes"))) "pipes" that manipulate bitcoin keys, addresses, and transactions. You can use sx tools to decode the Base58Check format on the command line.
We use the((("base58check-decode command (sx tools)"))) +base58check-decode+ command: We use the((("base58check-decode command (sx tools)"))) +base58check-decode+ command:
---- ----
@ -436,7 +436,7 @@ K = 03F028892BAD...DC341A
[[comp_priv]] [[comp_priv]]
===== Compressed private keys ===== Compressed private keys
((("compressed private keys")))((("private keys","compressed")))Ironically, the name "compressed private key" is misleading, because when a private key is exported as WIF-compressed it is actually one byte _longer_ than an "uncompressed" private key. That is because it has the added 01 suffix, which signifies it comes from a newer wallet and should only be used to produce compressed public keys. Private keys are not compressed and cannot be compressed. The term "compressed private key" really means "private key from which compressed public keys should be derived," whereas "uncompressed private key" really means "private key from which uncompressed public keys should be derived." You should only refer to the export format as "WIF-compressed" or "WIF" and not refer to the private key as "compressed" to avoid further confusion. ((("compressed private keys")))((("private keys","compressed")))Ironically, the term "compressed private key" is misleading, because when a private key is exported as WIF-compressed it is actually one byte _longer_ than an "uncompressed" private key. That is because it has the added 01 suffix, which signifies it comes from a newer wallet and should only be used to produce compressed public keys. Private keys are not compressed and cannot be compressed. The term "compressed private key" really means "private key from which compressed public keys should be derived," whereas "uncompressed private key" really means "private key from which uncompressed public keys should be derived." You should only refer to the export format as "WIF-compressed" or "WIF" and not refer to the private key as "compressed" to avoid further confusion.
Remember, these formats are _not_ used interchangeably. In a newer wallet that implements compressed public keys, the private keys will only ever be exported as WIF-compressed (with a K or L prefix). If the wallet is an older implementation and does not use compressed public keys, the private keys will only ever be exported as WIF (with a 5 prefix). The goal here is to signal to the wallet importing these private keys whether it must search the blockchain for compressed or uncompressed public keys and addresses. Remember, these formats are _not_ used interchangeably. In a newer wallet that implements compressed public keys, the private keys will only ever be exported as WIF-compressed (with a K or L prefix). If the wallet is an older implementation and does not use compressed public keys, the private keys will only ever be exported as WIF (with a 5 prefix). The goal here is to signal to the wallet importing these private keys whether it must search the blockchain for compressed or uncompressed public keys and addresses.