Author

Topic: How to send coin to address from hot-wallet address in Bitcoin 0.18.0 release (Read 203 times)

newbie
Activity: 3
Merit: 0
Thanks a lot you guys! I am gonna try with your suggestions

staff
Activity: 3458
Merit: 6793
Just writing some code
The only way to "send from" specific addresses is to use createrawtransaction or createpsbt and make the transactions with the inputs that you want manually. All other commands where you do not select the inputs will have Bitcoin Core do coin selection on all inputs in the wallet, regardless of "input address" (side note, that's not really a thing that actually exists) or label (or account if you are using an older version of Bitcoin Core).
HCP
legendary
Activity: 2086
Merit: 4361
If I use sendtoaddress api, is there any way to know which current label/address it is SPENDING FROM
As far as I can tell, No.

Like I said, I believe you would need to use one (or more) of the commands to get a list of UTXOs, and then use "createrawtransaction" specifying the inputs you wish to use.

Currently, I'm not aware of any other way to use "coin control" from the command line/console (excluding the new PSBT API methods that achieve the same thing as createrawtransaction, but for multisig workflows)

Maybe someone else has a solution? Huh
newbie
Activity: 3
Merit: 0
Thanks for your help!

If I use sendtoaddress api, is there any way to know which current label/address it is SPENDING FROM

Best regards
HCP
legendary
Activity: 2086
Merit: 4361
Use "help sendtoaddress" command on the console (or with bitcoin-cli)... it explains fairly well how to use it with a couple of examples:

Quote
sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount replaceable conf_target "estimate_mode" )

Send an amount to a given address.
Requires wallet passphrase to be set with walletpassphrase call.

Arguments:
1. address                  (string, required) The bitcoin address to send to.
2. amount                   (numeric or string, required) The amount in BTC to send. eg 0.1
3. comment                  (string, optional) A comment used to store what the transaction is for.
                            This is not part of the transaction, just kept in your wallet.
4. comment_to               (string, optional) A comment to store the name of the person or organization
                            to which you're sending the transaction. This is not part of the
                            transaction, just kept in your wallet.
5. subtractfeefromamount    (boolean, optional, default=false) The fee will be deducted from the amount being sent.
                            The recipient will receive less bitcoins than you enter in the amount field.
6. replaceable              (boolean, optional, default=fallback to wallet's default) Allow this transaction to be replaced by a transaction with higher fees via BIP 125
7. conf_target              (numeric, optional, default=fallback to wallet's default) Confirmation target (in blocks)
8. estimate_mode            (string, optional, default=UNSET) The fee estimate mode, must be one of:
                            "UNSET"
                            "ECONOMICAL"
                            "CONSERVATIVE"

Result:
"txid"                  (string) The transaction id.

Examples:
> bitcoin-cli sendtoaddress "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1
> bitcoin-cli sendtoaddress "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 "donation" "seans outpost"
> bitcoin-cli sendtoaddress "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 "" "" true
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendtoaddress", "params": ["1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd", 0.1, "donation", "seans outpost"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

NOTE: this won't allow you to specify specific inputs to use (or addresses to spend FROM)... if you want to do that and can't use the GUI to specify the inputs you want to spend, you'll need to do something like "createrawtransaction"...
newbie
Activity: 3
Merit: 0
Hi ,

Since sendFrom method been deprecated in 0.18.0, I finding an alternative method to send coin to a specific address from my hot wallet address, I saw sendtoaddress method, but did not understand how it work exactly, so could you please to help or any suggestion can help me?

Thanks a lot!
Jump to: