From 09855de6c92b4543cb513ea9f775e40c96d8f7e3 Mon Sep 17 00:00:00 2001 From: Vishal Menon Date: Sun, 23 May 2021 01:04:42 +0530 Subject: [PATCH] Updated bdk-cli/interface.md for new 0.2.1 spec --- docs/bdk-cli/interface.md | 87 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/docs/bdk-cli/interface.md b/docs/bdk-cli/interface.md index a6edffdd5d..4bb2ed739d 100644 --- a/docs/bdk-cli/interface.md +++ b/docs/bdk-cli/interface.md @@ -24,6 +24,93 @@ export RUST_LOG="bdk=debug" ## Options ```bash +OPTIONS: + -n, --network Sets the network [default: testnet] + +``` + +These are the global options that can be set. They are pretty much like the flags, but they also take a value. + +The `--network` flag can be used to change the network. Right now only `testnet` and `regtest` are supported since the code is very much not production-ready yet. + +## Subcommands + +## key + +A few tools to quickly generate, restore and derive HD keys. + +| Command | Description | +| ------- | ----------- | +| [generate](#generate) | Generates new random seed mnemonic phrase and corresponding master extended key | +| [restore](#restore) | Restore a master extended key from seed backup mnemonic words | +| [derive](#derive) | Derive a child key pair from a master extended key and a derivation path string (eg. "m/84'/1'/0'/0" + or "m/84h/1h/0h/0") | + + +### generate + +```text +OPTIONS: + -p, --password Seed password + -e, --entropy Entropy level based on number of random seed mnemonic words [default: 24] [possible + values: 12, 24] +``` + +Creates a BIP32 HD wallet seed and output BIP39 mnemonic words. Outputs an xprv that can be used with `key derive`. + + +### restore + +```text + +OPTIONS: + -m, --mnemonic Seed mnemonic words, must be quoted (eg. "word1 word2 ...") + -p, --password Seed password + +``` + +Recovers a BIP32 HD wallet seed from BIP39 mnemonic words. Same output as generate. + + +### derive + +```text + +OPTIONS: + -p, --path Path to use to derive extended public key from extended private key + -x, --xprv Extended private key to derive from + + +``` + +Derive child keys from a master extended private key. + +## wallet + +These are the main "functions" of the wallet. Most of them are pretty self explanatory, but we'll go over them quickly anyways. You can get more details about every single command by running `bdk-cli wallet`. + +| Command | Description | +| ------- | ----------- | +| [broadcast](#broadcast) | Broadcasts a transaction to the network. Takes either a raw transaction or a PSBT to extract | +| [bump_fee](#bump_fee) | Bumps the fees of an RBF transaction | +| [combine_psbt](#combine_psbt) | Combines multiple PSBTs into one | +| [create_tx](#create_tx) | Creates a new unsigned tranasaction | +| [extract_psbt](#extract_psbt) | Extracts a raw transaction from a PSBT | +| [finalize_psbt](#finalize_psbt) | Finalizes a psbt | +| [get_balance](#get_balance) | Returns the current wallet balance | +| [get_new_address](#get_new_address) | Generates a new external address | +| [list_transactions](#list_transactions) | Lists all the incoming and outgoing transactions of the wallet +| [list_unspent](#list_unspent) | Lists the available spendable UTXOs | +| [policies](#policies) | Returns the available spending policies for the descriptor | +| [public_descriptor](#public_descriptor) | Returns the public version of the wallet's descriptor(s) | +| [repl](#repl) | Opens an interactive shell | +| [sign](#sign) | Signs and tries to finalize a PSBT | +| [sync](#sync) | Syncs with the chosen Electrum server | + + +### Options + +```text OPTIONS: -c, --change_descriptor Sets the descriptor to use for internal addresses -d, --descriptor Sets the descriptor to use for the external addresses -- 2.49.0