### Convert EC private key to WIF (uncompressed, Bitcoin Wiki example) Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-ec-to-wif Demonstrates converting an EC private key to WIF format for the uncompressed public key, using a key from a Bitcoin Wiki example. ```sh $ bx ec-to-wif -u 0c28fca386c7a227600b2fe50b7cae11ec86d3bf1fbe471be89827e19d72aa1d ``` -------------------------------- ### Example: Connecting to an Obelisk Server (Unsupported) Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-watch-address Demonstrates attempting to watch an address, which may result in an error if the server connection is unsupported. ```sh $ bx watch-address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa ``` ```text Bad stream ``` -------------------------------- ### Example Public Key Generation Output Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/How-to-Create-a-Multisig-Address Illustrates the output of generating a seed, private key, and public key. Note that the seed and private key are sensitive and should be handled securely. ```text 6b3f9712911f3262fe72de340f0cbb8d (seed #1) 9d695afea1c3ab99e11248e4b74e698332b11f5c5c051e6e80da61aa19ae7c89 (private key #1) 02b66fcb1064d827094685264aaa90d0126861688932eafbd1d1a4ba149de3308b (public key #1) ``` ```text ca5167e564d813d6011ce02679a2c252 (seed #2) 68ebab45a918444d7e088c49bda76d7df89b9ea6ba5ddeb1aab5945391828b83 (private key #2) 025cab5e31095551582630f168280a38eb3a62b0b3e230b20f8807fc5463ccca3c (public key #2) ``` ```text d4ec97842cf63764ed261ea80f221a69 (seed #3) d1a7069b6057195545d4d9048887dd22be97f16bf463c201b76f8bb05ed423ee (private key #3) 021098babedb3408e9ac2984adcf2a8e4c48e56a785065893f76d0fa0ff507f010 (public key #3) ``` -------------------------------- ### Create Encrypted Private Key with Different Passphrase and Seed Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-ek-new Demonstrates creating an encrypted private key with a different passphrase and the same seed as the previous example. ```sh $ bx ek-new passphraseryQXuRZZQ3Jw5rAT7m6MzxkGSSRmysq3Ayj9vuEHEnbVPJSmRQ2xYFKDKjGYrq baadf00dbaadf00dbaadf00dbaadf00dbaadf00dbaadf00d ``` ```text 6PnUht3dP5Jdcp1B7NGqkEoBw5Ja2wWEeQMDRHqLNrBG4Rqo59eVfMd98B ``` -------------------------------- ### Derive Public Key from WIF (Example 2) Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-wif-to-public Derives an uncompressed EC public key from a WIF private key, referencing a Bitcoin Wiki example. ```sh $ bx wif-to-public 5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ ``` ```text 04d0de0aaeaefad02b8bdc8a01a1b8b11c696bd3d66a2c5f10780d95b7df42645cd85228a6fb29940e858e7e55842ae2bd115d1ed7cc0e82d934e929c97648cb0a ``` -------------------------------- ### Generate Bitcoin Address from Entropy Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/Home This example demonstrates how to generate a new Bitcoin address by piping user entropy through several BX commands: `ec-new` for key generation, `ec-to-public` for deriving the public key, and `ec-to-address` for formatting the address. ```shell $ echo [user entropy] | bx ec-new | bx ec-to-public | bx ec-to-address 13ua8RRSxLpL5WL5cKUDepUCvJZgGWuKh7 ``` -------------------------------- ### Get help for a specific BX command Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/Help-Integration Use the `--help` option on any command or the `help ` syntax to display detailed help for that command, including its description and parameterization. ```sh $ bx address-decode --help $ bx help address-decode ``` -------------------------------- ### Build Payment Address using ec-to-public and base58check-encode Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/Command-Equivalence Achieves the same payment address as the previous example, but uses the more general `base58check-encode` command instead of `address-encode`. ```shell $ bx ec-new 9bb08de6bcc361df764c1edd9cc93059 | bx ec-to-public | bx bitcoin160 | bx base58check-encode ``` -------------------------------- ### Get help for the help command itself Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/Help-Integration The `help` command also supports the `--help` option to display its own usage information. ```sh $ bx help --help ``` -------------------------------- ### Derive Public Key from WIF (Example 1) Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-wif-to-public Derives a compressed EC public key from a given WIF private key. ```sh $ bx wif-to-public L21LJEeJwK35wby1BeTjwWssrhrgQE2MZrpTm2zbMC677czAHHu3 ``` ```text 0247140d2811498679fe9a0467a75ac7aa581476c102d27377bc0232635af8ad36 ``` -------------------------------- ### Derive Public Key using Piped Commands Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-hd-to-public Demonstrates deriving an extended public key by piping output from 'bx hd-new' to 'bx hd-to-public'. This example shows a common workflow for generating and then deriving keys. ```sh $ echo [user entropy] | bx hd-new | bx hd-to-public ``` ```text 53dc6e013ee4de6c858adb4ef75eb772 xprv9s21ZrQH143K4BXnA5VBs3HYVS9mkTjbXFfDepC5f6yAtU38MYmUUq7www2BjDWqZWR7EXtToXEphCWCxiQ6SwrpwcaUH7uDp2VGD47Hna7 xpub661MyMwAqRbcGfcFG72CEBEH3TzG9vTStUapTCbhDSW9mGNGu65j2dSRoDg3Uy79LHe9wFqFbhjM7UitQu5gAvkPnHtAWRLFzDRTM2t3C43 ``` -------------------------------- ### Generate a 256-bit pseudorandom seed Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/Random-Numbers Example of using the `bx seed` command with the `-b 256` option to generate a 256-bit pseudorandom seed. ```sh $ bx seed -b 256 ``` ```sh e4d28a5972ce0785477f39f58e424c5ef643b26894c50f8e024601f87736b8fe ``` -------------------------------- ### Create Encrypted Public Key (Example 2) Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-ek-public Generates an encrypted public key with a different passphrase token and the same seed. This demonstrates the uniqueness of the output based on the token. ```sh $ bx ek-public passphraseryQXuRZZQ3Jw5rAT7m6MzxkGSSRmysq3Ayj9vuEHEnbVPJSmRQ2xYFKDKjGYrq baadf00dbaadf00dbaadf00dbaadf00dbaadf00dbaadf00d ``` ```text cfrm38VUVm4ZGXku7wWGiLfAJNoeDHConFb9CugfTnR1SQC1jf3uwyKULmCMk4SUhsXasMyPcA9 ``` -------------------------------- ### Token Generation with Unused Salt Bits Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-token-new Demonstrates that unused bits in a long salt do not affect the token generation when lot and sequence are specified. The result is the same as the previous example. ```sh $ bx token-new -l 7 -s 42 "my passphrase" f6af40a01b79c95fef5e397eca05e27d7a3d1c35b01108db ``` ```text f6af40a01b79c95fef5e397eca05e27d7a3d1c35b01108db passphraseeJe8PsbqqTpXKHHL5CupNg3hf396MFAHUeFf1k74zFs2pqxM9ARwjKLh4Px1sB ``` -------------------------------- ### Connect to Obelisk Server (Unsupported) Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-watch-stealth Demonstrates an attempt to connect to an Obelisk server using the watch-stealth command with a stealth prefix. This example shows an unsupported connection scenario resulting in an error. ```sh $ bx watch-stealth 01010101 ``` ```text Bad stream ``` -------------------------------- ### Convert HD Key from STDIN using Piped Commands Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-hd-to-ec Demonstrates converting an HD key generated by 'bx hd-new' to an EC key by piping the output to 'bx hd-to-ec'. This example shows both private and public key outputs. ```sh $ echo [user entropy] | bx hd-new | bx hd-to-ec ``` -------------------------------- ### Create Encrypted Public Key (Example 1) Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-ek-public Generates an encrypted public key using a specific passphrase token and a 192-bit Base16 seed. The output is a compressed public key. ```sh $ bx ek-public passphrasecpXbDpHuo8F7yuZqR49koDA9uQojPijjjZaxsar7Woo9pfHJbeWF3VMU9EPBqJ baadf00dbaadf00dbaadf00dbaadf00dbaadf00dbaadf00d ``` ```text cfrm38VXASNzNjsak8pLc3ZtyPnBNDxAAbB18KMMCSjf8ZhW3FVTeuw2r9J3tyAUNyhfM7VMZuP ``` -------------------------------- ### Install Configuration Data Conditionally Source: https://github.com/libbitcoin/libbitcoin-explorer/blob/master/builds/cmake/CMakeLists.txt Installs configuration data if the console build is enabled. ```cmake if (with-console) install( FILES "../../data/bx.cfg" DESTINATION etc/libbitcoin ) endif() ``` -------------------------------- ### Install Include Directory Source: https://github.com/libbitcoin/libbitcoin-explorer/blob/master/builds/cmake/CMakeLists.txt Installs the bitcoin include directory to the system's include path. ```cmake install( DIRECTORY "../../include/bitcoin" DESTINATION include ) ``` -------------------------------- ### Derive Child Key via Piped Commands Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-hd-private Demonstrates deriving a child HD private key by piping output from `hd-new` to `hd-private`. This example shows generating entropy, creating a new HD key, and then deriving a child key. ```sh $ echo [user entropy] | hd-new | bx hd-private ``` ```sh 875d946b5db47508d67756250f63dd6d xprv9s21ZrQH143K2odHtyepinTKCiDf8eBUv5fTHtwDHef5VwX79HyVkut91SFpMUvRHF9f2jwkoQ1Z4kpsrpfvS8ZX4QKCcoZoMeXmLWfPKvB xprv9vHdLyX7nuCbJGV6xHSSi6MxqibjVeiKRF4Z7P2fPKZgpFvmU1oM9mXJqAXCpsHS7FX2Z2fmSTigfeW32bGAQvkLtgQRqgHJPWSptU1gyo6 ``` -------------------------------- ### List all available bx commands Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-help Execute the 'bx help' command without any arguments to display a comprehensive list of all supported commands in Libbitcoin Explorer. ```sh $ bx help ``` -------------------------------- ### Install Bash Completion Data Conditionally Source: https://github.com/libbitcoin/libbitcoin-explorer/blob/master/builds/cmake/CMakeLists.txt Installs bash completion data if the bash-completion directory is defined. ```cmake if (bash-completiondir) install( FILES "../../data/bx" DESTINATION etc/libbitcoin ) endif() ``` -------------------------------- ### Broadcast Transaction Example Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-send-tx Example of broadcasting a transaction using the bx send-tx command with a base16 encoded transaction. The output confirms the transaction was sent. ```sh $ bx send-tx 0100000001b3807042c92f449bbf79b33ca59d7dfec7f4cc71096704a9c526dddf496ee0970100000069463044022039a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c202204fcc407ce9b6f719ee7d009aeb8d8d21423f400a5b871394ca32e00c26b348dd2103c40cbd64c9c608df2c9730f49b0888c4db1c436e8b2b74aead6c6afbd10428c0ffffffff01905f0100000000001976a91418c0bd8d1818f1bf99cb1df2269c645318ef7b7388ac00000000 ``` ```text Sent transaction at 2014-Oct-20 00:51:55. ``` -------------------------------- ### bx token-new Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-token-new Displays the help information for the bx token-new command, outlining its usage, options, and arguments. ```sh $ bx token-new --help ``` -------------------------------- ### Convert WIF to EC Private Key (Bitcoin Wiki Example) Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-wif-to-ec Converts a WIF private key to its EC private key hexadecimal representation, using a WIF key from the Bitcoin Wiki example. ```sh $ bx wif-to-ec 5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ ``` -------------------------------- ### Display Help for fetch-tx-index Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-fetch-tx-index Shows the usage, options, and arguments for the fetch-tx-index command. This is useful for understanding the command's capabilities and how to use it. ```sh $ bx fetch-tx-index --help ``` -------------------------------- ### Show bx ec-to-wif help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-ec-to-wif Displays the help information for the bx ec-to-wif command, outlining its usage, options, and arguments. ```sh $ bx ec-to-wif --help ``` -------------------------------- ### Private Key Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/Payment-Address-Deconstruction The starting point for address generation is a private ECDSA key. ```plaintext 18e14a7b6a307f426a94f8114701e7c8e774e7f9a47e2c2035db29a206321725 ``` -------------------------------- ### Incorrect Dictionary Example Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-mnemonic-to-seed Shows the error when mnemonic words do not match the specified dictionary language. ```sh $ bx mnemonic-to-seed --language ja rival hurdle address inspire tenant almost turkey safe asset step lab boy ``` -------------------------------- ### Display btc-to-satoshi command help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-btc-to-satoshi Shows the help message for the btc-to-satoshi command, detailing its usage, options, and arguments. ```sh $ bx btc-to-satoshi --help ``` -------------------------------- ### Invalid Mnemonic Example Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-mnemonic-to-seed Demonstrates the error message when an invalid number of words is provided for a mnemonic seed. ```sh $ bx mnemonic-to-seed two words ``` -------------------------------- ### bx input-set Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-input-set Displays the help information for the bx input-set command, outlining its usage, options, and arguments. ```sh $ bx input-set --help ``` -------------------------------- ### Example Multisig Address Output Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/How-to-Create-a-Multisig-Address The resulting script hash address for the '2 of 3' multisignature configuration. ```text 3A6oGpJ5MzABAj9PofXKjcpTJCgYrdGBNJ ``` -------------------------------- ### Display fetch-header help information Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-fetch-header Shows the usage instructions and available options for the fetch-header command. This is useful for understanding the command's capabilities and parameters. ```sh $ bx fetch-header --help ``` -------------------------------- ### Show bx ek-to-ec help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-ek-to-ec Displays help information for the bx ek-to-ec command, including usage, options, and arguments. ```sh $ bx ek-to-ec --help ``` -------------------------------- ### Fetch Balance Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-fetch-balance Displays the help message for the fetch-balance command, outlining its usage, options, and arguments. ```sh $ bx fetch-balance --help ``` -------------------------------- ### bx fetch-utxo Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-fetch-utxo Displays the help message for the bx fetch-utxo command, outlining its usage, options, and arguments. ```bash $ bx fetch-utxo --help ``` -------------------------------- ### Fetch Blockchain Height Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/How-to-Spend-Bitcoin Use bx fetch-height to get the current height of the Bitcoin blockchain. This is useful for calculating transaction confirmations. ```shell $ bx fetch-height ``` -------------------------------- ### Build Payment Address using sha256, ripemd160, wrap-encode, and base58-encode Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/Command-Equivalence Demonstrates building a payment address by replacing the `bitcoin160` command with its constituent `sha256` and `ripemd160` commands, followed by general encoding steps. ```shell $ bx ec-new 9bb08de6bcc361df764c1edd9cc93059 | bx ec-to-public | bx sha256 | bx ripemd160 | bx wrap-encode | bx base58-encode ``` -------------------------------- ### Decode Base16 Script to Tokens Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-script-decode Decodes a given Base16 encoded script into human-readable tokens. This example uses a specific script provided as an argument. ```sh $ bx script-decode 76A91489ABCDEFABBAABBAABBAABBAABBAABBAABBAABBA88AC ``` -------------------------------- ### bx ek-to-address Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-ek-to-address Displays the help information for the ek-to-address command, outlining its usage, options, and arguments. ```sh $ bx ek-to-address --help ``` -------------------------------- ### Decode stealth address with maximum length filter Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-stealth-decode Decodes a stealth address that includes a maximum length filter. This example demonstrates how the filter is represented in the output. ```sh $ bx stealth-decode 12TFFcDyvpZd4Zy1GAS7sp7Xz9sgRabovgf8xfD4EMGxenJw8ivsa3bBj8TzjR ``` ```text stealth_address { encoded 12TFFcDyvpZd4Zy1GAS7sp7Xz9sgRabovgf8xfD4EMGxenJw8ivsa3bBj8TzjR filter 11111111110000000000111111111100 scan_public_key 031bab84e687e36514eeaf5a017c30d32c1f59dd4ea6629da7970ca374513dd006 signatures 1 spends { public_key 031bab84e687e36514eeaf5a017c30d32c1f59dd4ea6629da7970ca374513dd006 } version 0 } ``` -------------------------------- ### Display help for satoshi-to-btc Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-satoshi-to-btc Shows the help message for the satoshi-to-btc command, detailing its usage, options, and arguments. ```sh $ bx satoshi-to-btc --help ``` -------------------------------- ### Piping Commands for Address Generation Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-ec-to-address Demonstrates a pipeline of commands where user entropy is used to generate a new key, then converted to a public key, and finally to a payment address. ```sh $ echo [user entropy] | bx ec-new | bx ec-to-public | bx ec-to-address ``` -------------------------------- ### Fetch Block by Height and Hash Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-fetch-block Fetches a block by its height and hash. Note that the height is ignored when both parameters are provided. This example demonstrates fetching the genesis block. ```shell $ bx fetch-block -t 1 -s 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f ``` ```text block { bits 486604799 hash 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f merkle_root 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b nonce 2083236893 previous_block_hash 0000000000000000000000000000000000000000000000000000000000000000 time_stamp 1231006505 version 1 transactions { transaction { hash 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b inputs { input { address_hash 5b19778555f776292926b8dd581e1b9d2ab7cbbb previous_output { hash 0000000000000000000000000000000000000000000000000000000000000000 index 4294967295 } script "[ffff001d] [04] [5468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73]" sequence 4294967295 } } lock_time 0 outputs { output { address_hash 62e907b15cbf27d5425399ebf6f0fb50ebb88f18 script "[04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f] checksig" value 5000000000 } } version 1 } } } ``` -------------------------------- ### Set Bash Completion Directory Cache Variable Source: https://github.com/libbitcoin/libbitcoin-explorer/blob/master/builds/cmake/CMakeLists.txt Defines a cache boolean variable for installing bash completion support, with an option to specify the directory. Defaults to 'no'. ```cmake set( bash-completiondir "no" CACHE BOOL "Install bash completion support, optionally specifying the directory. This option may require elevated permissions." ) ``` -------------------------------- ### bx ec-to-ek Command Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-ec-to-ek Displays the help information for the `bx ec-to-ek` command, outlining its usage, options, and arguments. ```sh $ bx ec-to-ek --help ``` -------------------------------- ### Fetch Block Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-fetch-block Displays help information for the bx fetch-block command, outlining its usage, options, and requirements. ```sh $ bx fetch-block --help ``` -------------------------------- ### bx tx-encode Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-tx-encode Displays the help information for the tx-encode command, outlining its usage and options. ```sh $ bx tx-encode --help ``` -------------------------------- ### Create Mnemonic Seed from Piped Entropy Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-mnemonic-new Generates a BIP39 mnemonic seed by piping entropy from standard input to bx mnemonic-new. This example uses a 128-bit seed. ```sh $ echo [user entropy] | bx mnemonic-new ``` -------------------------------- ### Display Help for bx ek-new Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-ek-new Shows the usage information and available options for the bx ek-new command. ```sh $ bx ek-new --help ``` -------------------------------- ### Transaction History Data Structure Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/Wright-Decoded Example of the data structure returned by 'bx fetch-history', showing a list of transfers with received details like hash, height, and value. ```ini transfers { transfer { received { hash 5d607ae88c2caf1329e758ccb1eb8a359f6df434ee84e03b9e14cea300a85f97 height 409857 index 0 } value 66600 } transfer { received { hash 20fb69a94413637cb50f65e473f91d2599a04d5a0bf9bf6a5e9e843df2710ea4 height 228208 index 0 } value 30000 } transfer { received { hash 1554a02d4eb1c7a73e3736922ed99530e360784e709896c42e5756e65b2da341 height 220151 index 2 } value 1 } transfer { received { hash 828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe height 248 index 1 } value 1800000000 } transfer { received { hash 12b5633bad1f9c167d523ad1aa1947b2732a865bf5414eab2f9e5ae5d5c191ba height 183 index 1 } value 2800000000 } transfer { received { hash 591e91f809d716912ca1d4a9295e70c3e78bab077683f79350f101da64588073 height 182 index 1 } value 2900000000 } transfer { received { hash a16f3ce4dd5deb92d98ef5cf8afeaf0775ebca408f708b2146c4fb42b41e14be height 181 index 1 } value 3000000000 } transfer { received { hash f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16 height 170 index 1 } value 4000000000 } transfer { received { hash 0437cd7f8525ceed2324359c2d0ba26006d92d856a9c20fa0241106ee5a597c9 height 9 index 0 } value 5000000000 } } ``` -------------------------------- ### Display Help for bx fetch-history Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-fetch-history Shows the usage instructions and available options for the fetch-history command. ```sh $ bx fetch-history --help ``` -------------------------------- ### List all BX commands Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/Help-Integration Invoking BX without a command or explicitly with `help` lists all available commands to standard output. ```sh $ bx $ bx help ``` -------------------------------- ### Decode an unsigned transaction with a script output Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-tx-decode This example decodes a Base16 encoded unsigned transaction with a single input, specifying index 1 and sequence 7, and a script output. ```sh $ bx tx-decode 0100000001b3807042c92f449bbf79b33ca59d7dfec7f4cc71096704a9c526dddf496ee09701000000000700000001f4010000000000001976a91418c0bd8d1818f1bf99cb1df2269c645318ef7b7388ac00000000 ``` ```text transaction { hash bfe73280b111a7dae1714b1efe869c0d0c854dd9d1c3ba51fa439e7fb4d0e63c inputs { input { previous_output { hash 97e06e49dfdd26c5a904670971ccf4c7fe7d9da53cb379bf9b442fc9427080b3 index 1 } script "" sequence 7 } } lock_time 0 outputs { output { address 13Ft7SkreJY9D823NPm4t6D1cBqLYTJtAe script "dup hash160 [18c0bd8d1818f1bf99cb1df2269c645318ef7b73] equalverify checksig" value 500 } } version 1 } ``` -------------------------------- ### Display bx settings from a specific config file Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-settings Loads and displays settings from a specified configuration file, such as 'bx-testnet.cfg'. This presumes the existence of the specified configuration file. ```sh $ bx settings -c bx-testnet.cfg ``` ```js settings { network { channel_handshake_seconds 30 connect_retries 0 connect_timeout_seconds 5 debug_file debug.log error_file error.log hosts_file hosts.cache identifier 118034699 seeds testnet-seed.alexykot.me:18333,testnet-seed.bitcoin.petertodd.org:18333,testnet-seed.bluematt.me:18333,testnet-seed.bitcoin.schildbach.de:18333 } server { client_private_key 0000000000000000000000000000000000000000 connect_retries 0 connect_timeout_seconds 5 server_public_key 0000000000000000000000000000000000000000 socks_proxy [::ffff:0:0] url tcp://testnet.libbitcoin.net:19091 } wallet { hd_public_version 70617039 hd_secret_version 70615956 pay_to_public_key_hash_version 111 pay_to_script_hash_version 196 transaction_version 1 wif_version 239 } } ``` -------------------------------- ### Example: Monitor Donations to Satoshi Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-watch-address Monitors a specific Bitcoin address for incoming transactions. A confirmation message is displayed upon successful subscription, followed by real-time transaction notifications. ```sh $ bx watch-address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa ``` ```text Watching address: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa... ``` -------------------------------- ### Fetch Stealth Transactions (Obelisk Server - Unsupported) Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-fetch-stealth Example of attempting to fetch stealth transactions using an Obelisk server, which is unsupported in newer versions of bx. This is expected to time out. ```sh $ bx fetch-stealth 101010 ``` ```text timed out ``` -------------------------------- ### Generate Address from Piped Commands Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-address-encode Demonstrates a pipeline of commands to generate a private key, derive its public key, convert to RIPEMD160, and finally encode it as a payment address. ```sh $ echo [user entropy] | bx ec-new | bx ec-to-public | bx bitcoin160 | bx address-encode ``` -------------------------------- ### bx ec-to-address Command Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-ec-to-address Displays the help information for the ec-to-address command, outlining its usage, options, and arguments. ```sh $ bx ec-to-address --help ``` -------------------------------- ### bx electrum-to-seed Command Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-electrum-to-seed Displays the help information for the bx electrum-to-seed command, outlining its usage, options, and arguments. ```sh $ bx electrum-to-seed --help ``` -------------------------------- ### Decode stealth address with filter and one of two signatures Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-stealth-decode Decodes a stealth address that includes a filter and requires one of two signatures. This example shows the combined representation of these features. ```sh $ bx stealth-decode 16frt2rsvRjxyyqExjiRAkmm6g8NPRnFURWCZosVnPrSYBK9sM8j74PPGDd2MtiZuSPoLzVTgQ1P5k9Xm2ExkMhFqVTQfZ8jFEqkNomZ ``` ```text stealth_address { encoded 16frt2rsvRjxyyqExjiRAkmm6g8NPRnFURWCZosVnPrSYBK9sM8j74PPGDd2MtiZuSPoLzVTgQ1P5k9Xm2ExkMhFqVTQfZ8jFEqkNomZ filter 000000001010 scan_public_key 031bab84e687e36514eeaf5a017c30d32c1f59dd4ea6629da7970ca374513dd006 signatures 1 spends { public_key 031bab84e687e36514eeaf5a017c30d32c1f59dd4ea6629da7970ca374513dd006 public_key 024c6988f8e64242a1b8f33513f5f27b9e135ad0a11433fc590816ff92a353a969 } version 0 } ``` -------------------------------- ### bx hd-new Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-hd-new Displays the help message for the bx hd-new command, outlining its usage, options, and arguments. ```sh $ bx hd-new --help ``` -------------------------------- ### List all available bx commands (shortcut) Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-help The 'bx' command can be used as a shortcut to list all available commands, similar to 'bx help'. ```sh $ bx ``` -------------------------------- ### Decode an unsigned transaction with a payment address output Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-tx-decode This example decodes a Base16 encoded unsigned transaction with a single input and a payment address output. The output is in the default 'info' format. ```sh $ bx tx-decode 0100000001b3807042c92f449bbf79b33ca59d7dfec7f4cc71096704a9c526dddf496ee0970000000000ffffffff01c8af0000000000001976a91458b7a60f11a904feef35a639b6048de8dd4d9f1c88ac00000000 ``` ```text transaction { hash f9be6abf60342de5606421c7deaaf2d3f7133490db5242e8507e05926b16d090 inputs { input { previous_output { hash 97e06e49dfdd26c5a904670971ccf4c7fe7d9da53cb379bf9b442fc9427080b3 index 0 } script "" sequence 4294967295 } } lock_time 0 outputs { output { address 1966U1pjj15tLxPXZ19U48c99EJDkdXeqb script "dup hash160 [58b7a60f11a904feef35a639b6048de8dd4d9f1c] equalverify checksig" value 45000 } } version 1 } ``` -------------------------------- ### Fetch Transaction Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-fetch-tx Displays help information for the bx fetch-tx command, outlining its usage, options, and arguments. ```sh $ bx fetch-tx --help ``` -------------------------------- ### bx cert-new Command Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-cert-new Displays the help information for the bx cert-new command, including usage, options, and a description of its purpose. ```sh $ bx cert-new --help ``` -------------------------------- ### SHA256 Hash from Piped Base16 Encode Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-sha256 Performs a SHA256 hash on data that is first Base16 encoded and then piped into the sha256 command. This example uses FIPS 180-2 SHA-256 Vector A. ```sh $ bx base16-encode abc | bx sha256 ``` -------------------------------- ### Convert Public Key to Bitcoin Address (Old Command) Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/Background Demonstrates the old 'addr' command syntax for converting a public key to a Bitcoin address. This command has been replaced. ```shell $ bx addr 03649860a9787e92db4b5371017e38ae36503f3007dc98498ef5f6cd7cfc4bfa4e ``` -------------------------------- ### Piping Public Key to Address Conversion Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-ec-to-address Converts an EC public key (obtained via 'bx ec-to-public') to a payment address. This example shows both the uncompressed public key and the resulting address. ```sh $ bx ec-to-public -u 18e14a7b6a307f426a94f8114701e7c8e774e7f9a47e2c2035db29a206321725 | bx ec-to-address ``` -------------------------------- ### Transaction Details Data Structure Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/Wright-Decoded Example of the data structure returned by 'bx fetch-tx', detailing transaction hash, inputs, outputs, lock time, and version. This is crucial for analyzing individual transactions. ```ini transaction { hash 0437cd7f8525ceed2324359c2d0ba26006d92d856a9c20fa0241106ee5a597c9 inputs { input { previous_output { hash 0000000000000000000000000000000000000000000000000000000000000000 index 4294967295 } script "[04ffff001d0134]" sequence 4294967295 } } lock_time 0 outputs { output { address 12cbQLTFMXRnSzktFkuoG3eHoMeFtpTu3S script "[0411db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5cb2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3] checksig" value 5000000000 } } version 1 } ``` -------------------------------- ### Show help for script-to-address Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-script-to-address Displays the usage information and available options for the script-to-address command. ```sh $ bx script-to-address --help ``` -------------------------------- ### Decode stealth address with one of two signatures required Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-stealth-decode Decodes a stealth address where only one of the two provided signatures is required. This example illustrates the 'signatures' field indicating the number of required signatures. ```sh $ bx stealth-decode 1Ht5EmHdUNVvRyMdJCwTZdBowDnbNJu8kaaZbkn4D4p7HTrppupQzETxVMdguNviAyEFj7e7mqKkqTncNeLdAv81Mm8jf978insV8 ``` ```text stealth_address { encoded 1Ht5EmHdUNVvRyMdJCwTZdBowDnbNJu8kaaZbkn4D4p7HTrppupQzETxVMdguNviAyEFj7e7mqKkqTncNeLdAv81Mm8jf978insV8 filter "" scan_public_key 031bab84e687e36514eeaf5a017c30d32c1f59dd4ea6629da7970ca374513dd006 signatures 1 spends { public_key 031bab84e687e36514eeaf5a017c30d32c1f59dd4ea6629da7970ca374513dd006 public_key 024c6988f8e64242a1b8f33513f5f27b9e135ad0a11433fc590816ff92a353a969 } version 0 } ``` -------------------------------- ### bx hd-to-ec Help Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-hd-to-ec Displays help information for the bx hd-to-ec command, including usage, options, and arguments. ```sh $ bx hd-to-ec --help ``` -------------------------------- ### Decode an unsigned transaction with stealth address output Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-tx-decode This example decodes a Base16 encoded unsigned transaction with a single input, specifying index 1 and sequence 7. It includes a stealth address output. ```sh $ bx tx-decode 0100000001b3807042c92f449bbf79b33ca59d7dfec7f4cc71096704a9c526dddf496ee0970100000000070000000200000000000000003a6a3814576f496f20b0befe21f39f765e81543ebd1790ec4a03d1b5a1c2e912749d90d0fd7b16322749e301a2b0dbfe278509011564590412b2772a000000000000001976a914cc04492c12d0ddeb4cf88cfccb0d6d78d0fcd39d88ac00000000 ``` ```text transaction { hash 4a013715c2ef8ddeae2792eea4751565acd1ad5ed27542d45f2ebe571f4899e9 inputs { input { previous_output { hash 97e06e49dfdd26c5a904670971ccf4c7fe7d9da53cb379bf9b442fc9427080b3 index 1 } script "" sequence 7 } } lock_time 0 outputs { output { script "return [14576f496f20b0befe21f39f765e81543ebd1790ec4a03d1b5a1c2e912749d90d0fd7b16322749e301a2b0dbfe278509011564590412b277]" stealth { bit_field 10011110101110111000001010101110 ephemeral_public_key_hash 909d7412e9c2a1b5d1034aec9017bd3e54815e769ff321febeb0206f496f5714 } value 0 } output { address 1KbjyvFBRc2p6dKpTfDAFdT5DqmVLGX3B4 script "dup hash160 [cc04492c12d0ddeb4cf88cfccb0d6d78d0fcd39d] equalverify checksig" value 42 } } version 1 } ``` -------------------------------- ### Fetch Stealth Transactions in JSON Format with Height Filter Source: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-fetch-stealth Retrieves stealth transaction metadata in JSON format, filtering transactions from a minimum block height. This example uses a short prefix '01'. ```sh $ bx fetch-stealth -f json -t 325500 01 ``` ```json { "stealth": [ { "ephemeral_public_key": "022ec7cd1d0697e746c4044a4582db99ac85e9158ebd2c0fb2a797759ca418dd8d", "paid_address": "1GqSZbEXDQ98aDKhja33cAXRdT9Z8RhRuZ", "transaction_hash": "4e36b6ff5630631489ff40a18fe764051898ad032eb2e0a3af4c12c1e03475cc" }, { "ephemeral_public_key": "03db09f00b2d6d939cdb7b8969d767671723183a926a3e6abd0ac3b1fa3e28bf75", "paid_address": "1Pjjg36UjWXJM3BrGLoDFLRLkb6F4E62t9", "transaction_hash": "73df6ec5211117fcee27bd1abe3039e23bca542df83abace0ad6bc9f7e274f57" }, { "ephemeral_public_key": "0314e7655b91e34efb125de270879f0f14b9cfbddad7d35ba5bde07350ebe62e28", "paid_address": "1CWcNPRn4zbjrYfwrUTwFwyWqii8aiZqhg", "transaction_hash": "700c6d0a25533c47875d184d3dec3f46c695d8f9001cb3bf995d7ec7cb7b6ada" }, { "ephemeral_public_key": "03e4805f75dfb336a20ba97d8b82d061f7234f41158f599b7c0f8e15ed44cf463d", "paid_address": "1BZYACk26cWwiqdCc2g51kjw6SnttKv1Z7", "transaction_hash": "b7fb2407b96b69e464c34519e5ef5f468959b03c0080cda0eba7a6c4ca1681c9" } ] } ```