Bitcoin Forum
June 28, 2024, 05:05:33 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to send coin to address from hot-wallet address in Bitcoin 0.18.0 release  (Read 184 times)
long.pham.fts211286 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
May 13, 2019, 05:01:25 AM
 #1

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!
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
May 13, 2019, 05:32:18 AM
 #2

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"...

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
long.pham.fts211286 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
May 13, 2019, 07:41:34 AM
 #3

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
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
May 13, 2019, 10:20:35 AM
 #4

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

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
May 13, 2019, 02:14:49 PM
 #5

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).

long.pham.fts211286 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
May 13, 2019, 04:53:04 PM
 #6

Thanks a lot you guys! I am gonna try with your suggestions

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!