Bitcoin Forum
September 20, 2018, 09:25:01 PM *
News: ♦♦ Bitcoin Core users must update to 0.16.3 [Torrent]. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Bitcoin CLI How does one send from a specific address to another.  (Read 97 times)
tendemo
Newbie
*
Offline Offline

Activity: 55
Merit: 0



View Profile
January 21, 2018, 07:49:57 PM
 #1

Hi I have a node with a couple of addresses , how do I send bitcoins from a specific Address "A" to another one "B" ? For instance Im able to get balances of specific addresses on my node using "./bitcoin-cli getbalance A" How can I do same to send coins using the same CLI from and an Address "A" to another Address "B". Thanks
1537478701
Hero Member
*
Offline Offline

Posts: 1537478701

View Profile Personal Message (Offline)

Ignore
1537478701
Reply with quote  #2

1537478701
Report to moderator
You can see the statistics of your reports to moderators on the "Report to moderator" pages.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1537478701
Hero Member
*
Offline Offline

Posts: 1537478701

View Profile Personal Message (Offline)

Ignore
1537478701
Reply with quote  #2

1537478701
Report to moderator
1537478701
Hero Member
*
Offline Offline

Posts: 1537478701

View Profile Personal Message (Offline)

Ignore
1537478701
Reply with quote  #2

1537478701
Report to moderator
1537478701
Hero Member
*
Offline Offline

Posts: 1537478701

View Profile Personal Message (Offline)

Ignore
1537478701
Reply with quote  #2

1537478701
Report to moderator
eternalgloom
Legendary
*
Online Online

Activity: 1344
Merit: 1076


Crypto-Games.net: Multiple coins, multiple games


View Profile WWW
January 22, 2018, 12:34:18 PM
 #2

I think you can do so by using 'sendtoaddress'.
Here's a list of all available commands: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list (this one is more up to date, but less structured: https://bitcoin.org/en/developer-reference#sendtoaddress)

Note that I'm not a developer myself, so I might be completely wrong here.


▄▄▄████████▄▄▄
▄██████████████████▄
▄██████████████████████▄
██████████████████████████
████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
██████████████████████████████
████████████████████████████
██████████████████████████
▀██████████████████████▀
▀██████████████████▀
▀▀▀████████▀▀▀
   ███████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
██████████
███████
BTC  ◉PLAY  ◉XMR  ◉DOGE  ◉BCH  ◉STRAT  ◉ETH  ◉GAS  ◉LTC  ◉DASH  ◉PPC
     ▄▄██████████████▄▄
  ▄██████████████████████▄        █████
▄██████████████████████████▄      █████
████ ▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄ ████     ▄██▀
████ █████ ██████ █████ ████    ▄██▀
████ █████ ██████ █████ ████    ██▀
████ █████ ██████ █████ ████    ██
████ ▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀ ████ ▄██████▄
████████████████████████████ ████████
███████▀            ▀███████ ▀██████▀
█████▀                ▀█████
▀██████████████████████████▀
  ▀▀████████████████████▀▀ 
✔️DICE           
✔️BLACKJACK
✔️PLINKO
✔️VIDEO POKER
✔️ROULETTE     
✔️LOTTO
pebwindkraft
Full Member
***
Offline Offline

Activity: 246
Merit: 202


View Profile
January 22, 2018, 12:47:32 PM
Merited by achow101 (2)
 #3

Have any of your new addresses, and search for an UTXO with the old address ("listunspent"), that can be used, and note down this address, the tx ID and vout (and maybe adjust the value). These are the steps I used last recently (even with a P2SH address):

Code:
bitcoin-cli -regtest listunspent
NEWADDR=mmdox1ww...
UTXO_TXID=d260e120647360... (64 chars)
UTXO_VOUT=0
VALUE=49.9997
RAW_TX=$( bitcoin-cli -regtest createrawtransaction '''[{"txid":"'$UTXO_TXID'","vout":'$UTXO_VOUT'}]''' '''{"'$NEWADDR'":'$VALUE'}''' )
bitcoin-cli -regtest decoderawtransaction $RAW_TX
SIGNED_TX=$( bitcoin-cli -regtest signrawtransaction $RAW_TX | awk -F '\"' '{ print $4 }' )
bitcoin-cli -regtest decoderawtransaction $SIGNED_TX
UTXO_TXID=$( bitcoin-cli -regtest sendrawtransaction $SIGNED_TX )
bitcoin-cli -regtest getrawmempool
bitcoin-cli -regtest generate 1

# verify new address has funds:
Code:
bitcoin-cli -regtest validateaddress "$NEWADDR"
bitcoin-cli -regtest getreceivedbyaddress "$NEWADDR"

This will create a transaction from one address to another. While this is ok on testnet/regtest network, it wouldn't make too much sense in production, as this is a regular bitcoin tx, and it involves fees.
alexeyneu
Member
**
Offline Offline

Activity: 74
Merit: 10


View Profile
January 28, 2018, 02:17:58 PM
 #4

Code:
bitcoin-cli setaccount 1GBykdD628RbYPr3MUhANiWchoCcE52eW2 myfirstaccount

bitcoin-cli sendfrom myfirstaccount 1AYJyqQHCixxxxxxffevxxxxQosCWqn1bT 0.15
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!