From 918905beb06979419d00489ba6d09266f9441cc9 Mon Sep 17 00:00:00 2001 From: "Andreas M. Antonopoulos" Date: Tue, 3 Mar 2015 11:37:24 -0500 Subject: [PATCH] Errata copy edit changes and formatting fixes --- appdx-bx.asciidoc | 17 +++++-------- ch03.asciidoc | 61 +++++++++++++++++++++++++++++++---------------- ch04.asciidoc | 7 ++++-- ch06.asciidoc | 2 +- 4 files changed, 52 insertions(+), 35 deletions(-) diff --git a/appdx-bx.asciidoc b/appdx-bx.asciidoc index 11fda69b..ade92a39 100644 --- a/appdx-bx.asciidoc +++ b/appdx-bx.asciidoc @@ -1,7 +1,7 @@ [[appdx_bx]] [appendix] -== Available Bitcoin Explorer Commands +== Bitcoin Explorer (bx) Commands ((("Bitcoin Explorer commands","commands in", id="ix_appdx-bx-asciidoc0", range="startofrange"))) @@ -83,18 +83,13 @@ wif-to-ec wif-to-public wrap-decode wrap-encode - -Bitcoin Explorer home page: - -https://github.com/libbitcoin/libbitcoin-explorer - -Bitcoin Explorer user documentation: - -https://github.com/libbitcoin/libbitcoin-explorer/wiki - ---- -Next, we look at some examples of using Bitcoin Explorer commands to experiment with keys and addresses. +For more information see the https://github.com/libbitcoin/libbitcoin-explorer[Bitcoin Explorer home page] and https://github.com/libbitcoin/libbitcoin-explorer/wiki[Bitcoin Explorer user documentation]. + +=== Examples of bx command use + +Let's look at some examples of using Bitcoin Explorer commands to experiment with keys and addresses: Generate a random "seed" value using the((("Bitcoin Explorer","seed command")))((("seed command (bx)"))) +seed+ command, which uses the operating system's random number generator. Pass the seed to the((("Bitcoin Explorer","ec-new command")))((("ec-new command (bx)"))) +ec-new+ command to generate a new private key. We save the standard output into the file _private_key_: diff --git a/ch03.asciidoc b/ch03.asciidoc index fad2460f..99aed9d2 100644 --- a/ch03.asciidoc +++ b/ch03.asciidoc @@ -597,7 +597,8 @@ Commands: +gettransaction+, +getrawtransaction+, +decoderawtransaction+ ---- -$ bitcoin-cli gettransaction 9ca8f969bd3ef5ec2a8685660fdbf7a8bd365524c2e1fc66c309acbae2c14ae3 +$ bitcoin-cli gettransaction 9ca8f969bd3ef5ec2a8685660fdbf7a8bd365524c2e1fc66c309acbae2c14ae3 + ---- [source,json] ---- @@ -627,17 +628,33 @@ The transaction form shown with the command +gettransaction+ is the simplified f ++++ -$ bitcoin-cli getrawtransaction 9ca8f969bd3ef5ec2a8685660fdbf7a8bd365524c2e1fc66c309acbae2c14ae3 0100000001d717279515f88e2f56ce4e8a31e2ae3e9f00ba1d0add648e80c480ea22e0c7d3000000008b483045022100a4ebbeec83225dedead659bbde7da3d026c8b8e12e61a2df0dd0758e227383b302203301768ef878007e9ef7c304f70ffaf1f2c975b192d34c5b9b2ac1bd193dfba2014104793ac8a58ea751f9710e39aad2e296cc14daa44fa59248be58ede65e4c4b884ac5b5b6dede05ba84727e34c8fd3ee1d6929d7a44b6e111d41cc79e05dbfe5ceaffffffff02404b4c00000000001976a91407bdb518fa2e6089fd810235cf1100c9c13d1fd288ac1f312906000000001976a914107b7086b31518935c8d28703d66d09b3623134388ac00000000 +$ bitcoin-cli getrawtransaction 9ca8f969bd3ef5ec2a8685660fdbf7a8bd365524c2e1fc66 +c309acbae2c14ae3 + +0100000001d717279515f88e2f56ce4e8a31e2ae3e9f00ba1d0add648e80c480ea22e0c7d3000000 +008b483045022100a4ebbeec83225dedead659bbde7da3d026c8b8e12e61a2df0dd0758e227383b3 +02203301768ef878007e9ef7c304f70ffaf1f2c975b192d34c5b9b2ac1bd193dfba2014104793ac8 +a58ea751f9710e39aad2e296cc14daa44fa59248be58ede65e4c4b884ac5b5b6dede05ba84727e34 +c8fd3ee1d6929d7a44b6e111d41cc79e05dbfe5ceaffffffff02404b4c00000000001976a91407bd +b518fa2e6089fd810235cf1100c9c13d1fd288ac1f312906000000001976a914107b7086b3151893 +5c8d28703d66d09b3623134388ac00000000 ++++ To decode this hex string, use the +decoderawtransaction+ command. Copy and paste the hex as the first parameter of +decoderawtransaction+ to get the full contents interpreted as a JSON data structure (for formatting reasons the hex string is shortened in the following example): ----- -$ bitcoin-cli decoderawtransaction 0100000001d717...388ac00000000 ----- - +++++ + +$ bitcoin-cli decoderawtransaction 0100000001d717279515f88e2f56ce4e8a31e2ae3e9f00 +ba1d0add648e80c480ea22e0c7d3000000008b483045022100a4ebbeec83225dedead659bbde7da3d +026c8b8e12e61a2df0dd0758e227383b302203301768ef878007e9ef7c304f70ffaf1f2c975b192d3 +4c5b9b2ac1bd193dfba2014104793ac8a58ea751f9710e39aad2e296cc14daa44fa59248be58ede65 +e4c4b884ac5b5b6dede05ba84727e34c8fd3ee1d6929d7a44b6e111d41cc79e05dbfe5ceaffffffff +02404b4c00000000001976a91407bdb518fa2e6089fd810235cf1100c9c13d1fd288ac1f312906000 +000001976a914107b7086b31518935c8d28703d66d09b3623134388ac00000000 + +++++ ++++ @@ -798,7 +815,9 @@ We can also retrieve a block by its block height using the +getblockhash+ comman ++++ -$ bitcoin-cli getblockhash 0000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f +$ bitcoin-cli getblockhash 0 + +000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f ++++ @@ -981,7 +1000,7 @@ $ bitcoin-cli decoderawtransaction 0100000001e34ac1e2baac09c366fce1c2245536bd -$ bitcoin-cli decoderawtransaction0100000001e34ac1e2baac09c366fce1c2245536bda8f7db0f6685862aecf53ebd69f9a89c000000006a47304402203e8a16522da80cef66bacfbc0c800c6d52c4a26d1d86a54e0a1b76d661f020c9022010397f00149f2a8fb2bc5bca52f2d7a7f87e3897a273ef54b277e4af52051a06012103c9700559f690c4a9182faa8bed88ad8a0c563777ac1d3f00fd44ea6c71dc5127ffffffff02a0252600000000001976a914d90d36e98f62968d2bc9bbd68107564a156a9bcf88ac50622500000000001976a91407bdb518fa2e6089fd810235cf1100c9c13d1fd288ac00000000 +$ bitcoin-cli decoderawtransaction 0100000001e34ac1e2baac09c366fce1c2245536bda8f7db0f6685862aecf53ebd69f9a89c000000006a47304402203e8a16522da80cef66bacfbc0c800c6d52c4a26d1d86a54e0a1b76d661f020c9022010397f00149f2a8fb2bc5bca52f2d7a7f87e3897a273ef54b277e4af52051a06012103c9700559f690c4a9182faa8bed88ad8a0c563777ac1d3f00fd44ea6c71dc5127ffffffff02a0252600000000001976a914d90d36e98f62968d2bc9bbd68107564a156a9bcf88ac50622500000000001976a91407bdb518fa2e6089fd810235cf1100c9c13d1fd288ac00000000 ++++ @@ -1064,14 +1083,20 @@ $ bitcoin-cli decoderawtransaction0100000001e34ac1e2baac09c366fce1c2245536bda ++++ -Now, the inputs used in the transaction contain a +scriptSig+, which is a digital signature proving ownership of address +1hvz...+ and removing the encumbrance on the output so that it can be spent. The signature makes this transaction verifiable by any node in the bitcoin network. +Now, the inputs used in the transaction contain a +scriptSig+, which is a digital signature proving ownership of address +1hvz...+ and removing the lock on the output so that it can be spent. The signature makes this transaction verifiable by any node in the bitcoin network. Now it's time to submit the newly created transaction to the network. We do that with the command +sendrawtransaction+, which takes the raw hex string produced by +signrawtransaction+. This is the same string we just decoded: ++++ -$ bitcoin-cli sendrawtransaction -0100000001e34ac1e2baac09c366fce1c2245536bda8f7db0f6685862aecf53ebd69f9a89c000000006a47304402203e8a16522da80cef66bacfbc0c800c6d52c4a26d1d86a54e0a1b76d661f020c9022010397f00149f2a8fb2bc5bca52f2d7a7f87e3897a273ef54b277e4af52051a06012103c9700559f690c4a9182faa8bed88ad8a0c563777ac1d3f00fd44ea6c71dc5127ffffffff02a0252600000000001976a914d90d36e98f62968d2bc9bbd68107564a156a9bcf88ac50622500000000001976a91407bdb518fa2e6089fd810235cf1100c9c13d1fd288ac00000000ae74538baa914f3799081ba78429d5d84f36a0127438e9f721dff584ac17b346 +$ bitcoin-cli sendrawtransaction 0100000001e34ac1e2baac09c366fce1c2245536bda8 +f7db0f6685862aecf53ebd69f9a89c000000006a47304402203e8a16522da80cef66bacfbc0c8 +00c6d52c4a26d1d86a54e0a1b76d661f020c9022010397f00149f2a8fb2bc5bca52f2d7a7f87e +3897a273ef54b277e4af52051a06012103c9700559f690c4a9182faa8bed88ad8a0c563777ac1 +d3f00fd44ea6c71dc5127ffffffff02a0252600000000001976a914d90d36e98f62968d2bc9bb +d68107564a156a9bcf88ac50622500000000001976a91407bdb518fa2e6089fd810235cf1100c +9c13d1fd288ac00000000ae74538baa914f3799081ba78429d5d84f36a0127438e9f721dff584 +ac17b346 ++++ @@ -1153,15 +1178,11 @@ The bx commands offer many of the same capabilities as the bitcoind client comma ===== Installing Bitcoin Explorer -((("Bitcoin Explorer","installing")))To use Bitcoin Explorer, simply download the signed executable for your operating system. Builds are available for mainnet and testnet for Linux, OS X, and Windows. - -https://github.com/libbitcoin/libbitcoin-explorer/wiki/Download +((("Bitcoin Explorer","installing")))To use Bitcoin Explorer, simply https://github.com/libbitcoin/libbitcoin-explorer/wiki/Download[download] the signed executable for your operating system. Builds are available for mainnet and testnet for Linux, OS X, and Windows. Type +bx+ with no parameters to display the list of all available commands (see <>). -Bitcoin Explorer also provides an installer for building from sources on Linux and OS X, as well as Visual Studio projects for Windows. Sources can also be built manually using Autotools. These also install the ((("libbitcoin library","installing")))libbitcoin library dependency. - -https://github.com/libbitcoin/libbitcoin-explorer/wiki/Build +Bitcoin Explorer also provides an installer for https://github.com/libbitcoin/libbitcoin-explorer/wiki/Build[building] from sources on Linux and OS X, as well as Visual Studio projects for Windows. Sources can also be built manually using Autotools. These also install the ((("libbitcoin library","installing")))libbitcoin library dependency. [TIP] ==== @@ -1170,9 +1191,7 @@ Bitcoin Explorer offers many useful commands for encoding and decoding addresses ===== Installing Libbitcoin -((("libbitcoin library","installing")))The libbitcoin library provides an installer for building from sources on Linux and OS X, as well as Visual Studio projects for Windows. Sources can also be built manually using Autotools. - -https://github.com/libbitcoin/libbitcoin/wiki/Build +((("libbitcoin library","installing")))The libbitcoin library provides an installer for https://github.com/libbitcoin/libbitcoin/wiki/Build[building] from sources on Linux and OS X, as well as Visual Studio projects for Windows. Sources can also be built manually using Autotools. [TIP] ==== diff --git a/ch04.asciidoc b/ch04.asciidoc index 5b396c44..b7958089 100644 --- a/ch04.asciidoc +++ b/ch04.asciidoc @@ -929,8 +929,11 @@ In <>, we introduced Eugenia, a children's charity d [[table_4-11]] .The range of vanity addresses starting with "1Kids" |======= -| *From* | 1Kids11111111111111111111111111111 -| *To* | 1Kidszzzzzzzzzzzzzzzzzzzzzzzzzzzzz +| *From* | +1Kids11111111111111111111111111111+ +| | +1Kids11111111111111111111111111112+ +| | +1Kids11111111111111111111111111113+ +| | +...+ +| *To* | +1Kidszzzzzzzzzzzzzzzzzzzzzzzzzzzzz+ |======= Let's look at the pattern "1Kids" as a number and see how frequently we might find this pattern in a bitcoin address (see <>). An average desktop computer PC, without any specialized hardware, can search approximately 100,000 keys per second. diff --git a/ch06.asciidoc b/ch06.asciidoc index 2d8057e1..dbcca190 100644 --- a/ch06.asciidoc +++ b/ch06.asciidoc @@ -63,7 +63,7 @@ image::images/msbt_0603.png["BitcoinNetwork"] The peer node responds with +verack+ to acknowledge and establish a connection, and optionally sends its own +version+ message if it wishes to reciprocate the connection and connect back as a peer. -How does a new node find peers? The first method is to query DNS using a number of ((("nodes","seed")))((("DNS seed")))"DNS seeds," which are DNS servers that provide a list of IP addresses of bitcoin nodes. Some of those DNS seeds provide a static list of IP addresses of stable bitcoin listening nodes. Some of the DNS seeds are custom implementations of BIND (Berkeley Internet Name Daemon) that return a random subset from a list of bitcoin node addresses collected by a crawler or a long-running bitcoin node. The Bitcoin Core client contains the names of five different DNS seeds. The diversity of ownership and diversity of implementation of the different DNS seeds offers a high level or reliability for the initial bootstrapping process. In the Bitcoin Core client, the option to use the DNS seeds is controlled by the option switch +-dnsseed+, which is set to 1, to use the DNS seed, by default. +How does a new node find peers? The first method is to query DNS using a number of ((("nodes","seed")))((("DNS seed")))"DNS seeds," which are DNS servers that provide a list of IP addresses of bitcoin nodes. Some of those DNS seeds provide a static list of IP addresses of stable bitcoin listening nodes. Some of the DNS seeds are custom implementations of BIND (Berkeley Internet Name Daemon) that return a random subset from a list of bitcoin node addresses collected by a crawler or a long-running bitcoin node. The Bitcoin Core client contains the names of five different DNS seeds. The diversity of ownership and diversity of implementation of the different DNS seeds offers a high level or reliability for the initial bootstrapping process. In the Bitcoin Core client, the option to use the DNS seeds is controlled by the option switch +-dnsseed+ (set to 1 by default, to use the DNS seed). Alternatively, a bootstrapping node that knows nothing of the network must be given the IP address of at least one bitcoin node, after which it can establish connections through further introductions. The command-line argument +-seednode+ can be used to connect to one node just for introductions, using it as a seed. After the initial seed node is used to form introductions, the client will disconnect from it and use the newly discovered peers.