Skip to content

Commit

Permalink
such: updated usage for public child keys
Browse files Browse the repository at this point in the history
doc: updated derive_child_keys and example in tools.md
  • Loading branch information
edtubbs committed Nov 4, 2024
1 parent aa63155 commit ad3ef8d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion doc/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Below is a list of all the commands and the flags that they require. As a remind
| p2pkh | -k | -t | Generates a p2pkh address derived from the public key specified. Include the testnet flag if it was generated from testnet. |
| bip32_extended_master_key | None | -t | Generate an extended master private key from a secp256k1 context for either mainnet or testnet. |
| bip32maintotest | -p | None | Convert a mainnet private key into an equivalent testnet key. |
| derive_child_keys | -p, -m | -t | Generates a child key derived from the specified private key using the specified derivation path.
| derive_child_keys | -p, -m | -t | Generates a child key derived from the specified public or private key using the specified derivation path.
| generate_mnemonic | None | -e, -y, -w, -b | Generates a 24-word english seed phrase randomly or from optional hex entropy. |
| list_encryption_keys_in_tpm | None | None | List the encryption keys in the TPM. |
| decrypt_master_key | -y | -j | Decrypt the master key with the TPM or SW. |
Expand Down Expand Up @@ -135,6 +135,16 @@ Below are some examples on how to use the `such` tool in practice.
> child index: -2147483647
> p2pkh address: DFqonEEA56VE8zEGvhXNgjiPT3PaPFNQQu

##### Derive public child key (second child key at level 2 in this case, non-hardened)

./such -c derive_child_keys -m m/1 -p dgub8sdBNNzYwKo1KKQcQoJXMDwEg3fgX52aY2aSuSGMXepn71kMtZoN7BVwWp7JT582EDT8djTpCMx7Nd62nJ8u8xNmszEXrmsHWf6XQccjiLg
> ext key: dgub8q9VuPpS4NijK4e7Cc7WaKGD6QHjUB3YkJi83imYVvBRGjrKwPcNFjNcmNt2UnEuhFmKhcmo8aRQABUhq55H3ackUBGj3nJDTMpcP6ALoiN
> extended pubkey: dgub8q9VuPpS4NijK4e7Cc7WaKGD6QHjUB3YkJi83imYVvBRGjrKwPcNFjNcmNt2UnEuhFmKhcmo8aRQABUhq55H3ackUBGj3nJDTMpcP6ALoiN
> pubkey hex: 02cbfea5f5cf7d28b9111e92f05356a39a64f19247e539b428ef91e70a6900ae71
> depth: 2
> child index: 1
> p2pkh address: D7M52mS3ZTrPXgRmfjpV5pPSG2E2TsfZAi

#### Generate a random BIP39 seed phrase
#### See "Seed phrases" in address.md, for additional guidance

Expand Down
2 changes: 1 addition & 1 deletion src/cli/such.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ static void print_usage()
printf("mnemonic_to_key (requires -n <seed_phrase> or -y <file_num>, -j (use_tpm), -o <account_int>, -g <change_level>, -i <address_index> and -a, all optional),\n");
printf("mnemonic_to_addresses (requires -n <seed_phrase> or -y <file_num>, -j (use_tpm), -o <account_int>, -g <change_level>, -i <address_index> and -a, all optional),\n");
printf("print_keys (requires -p <private key hex>),\n");
printf("derive_child_keys (requires -m <custom path> -p <private key>),\n");
printf("derive_child_keys (requires -m <custom path> -p <public or private key>),\n");
printf("sign (-x <raw hex tx> -s <script pubkey> -i <input index> -h <sighash type> -p <private key>),\n");
printf("comp2der (-s <compact signature>),\n");
printf("bip32maintotest (-p <extended hd master key>),\n");
Expand Down

0 comments on commit ad3ef8d

Please sign in to comment.