Sending non-all UTXO quantity when making a Tx in BDK (Bitcoin Improvement Package)


I am utilizing BDK to create a transaction utilizing bdk-cli interface, researching learn how to ship a Tx I pulled the assistance for the create_tx command. It is not clear learn how to create a Tx while you need to ship lower than the full (-a, --send_all choice) of funds from the chosen UTXO, it is usually not clear learn how to cope with the change. Does anybody know learn how to do it, if potential? Thanks for the assistance.

> bdk-cli pockets create_tx -h
bdk-cli-wallet-create_tx 0.4.0
Creates a brand new unsigned transaction

USAGE:
    bdk-cli pockets --descriptor <DESCRIPTOR> create_tx [FLAGS] [OPTIONS] --to <ADDRESS:SAT>...

FLAGS:
    -r, --enable_rbf        Allows Change-By-Price (BIP125)
    -h, --help              Prints assist info
        --offline_signer    Make a PSBT that may be signed by offline signers and {hardware} wallets. Forces the addition
                            of `non_witness_utxo` and extra particulars to let the signer establish the change output
    -a, --send_all          Sends all of the funds (or all the chosen utxos). Requires just one recipients of worth 0
    -V, --version           Prints model info

OPTIONS:
        --to <ADDRESS:SAT>...                      Provides a recipient to the transaction
        --unspendable <CANT_SPEND_TXID:VOUT>...    Marks a utxo as unspendable
        --external_policy <EXT_POLICY>
            Selects which coverage must be used to fulfill the exterior descriptor

        --internal_policy <INT_POLICY>
            Selects which coverage must be used to fulfill the interior descriptor

        --utxos <MUST_SPEND_TXID:VOUT>...          Selects which utxos *should* be spent
    -f, --fee_rate <SATS_VBYTE>                    Price price to make use of in sat/vbyte

Leave a Reply

Your email address will not be published.