"bitcoin-cli sendtoaddress" - Send Bitcoin

This section describes how to sent Bitcoins to another address test transaction on live.blockcypher.com.

With Bitcoin fund in my wallet, I can now send part of it to someone else to my self in another account/address. To send Bitcoins, you can use the "bitcoin-cli sendtoaddress" command.

Here is what did to send 1.0 BTC to my second account in the same wallet.

1. Get a list of my accounts and their balances:

C:\>\local\bitcoin-0.15.1\bin\bitcoin-cli.exe -testnet listaccounts
{
  "": 0.00000000,
  "Test 1": 0.00000000,
  "Test 2": 0.00000000,
  "Used on coinfaucet.eu": 8.71492098
}

2. Get the address of the "Test 2" account:

C:\>\local\bitcoin-0.15.1\bin\bitcoin-cli.exe -testnet 
   getaddressesbyaccount "Test 2"
[
  "mrThGN62W4noVhUvWUqHXesaMLB79NCEbW",
  "mrohEM3qNy8eHKTveW6WqBaPghEcVfZzpq"
]

3. Send 1.0 BTC to the first address of "Test 2" account:

C:\>\local\bitcoin-0.15.1\bin\bitcoin-cli.exe -testnet 
   sendtoaddress mrThGN62W4noVhUvWUqHXesaMLB79NCEbW 1.0
error code: -13
error message:
Error: Please enter the wallet passphrase with walletpassphrase first.

C:\>\local\bitcoin-0.15.1\bin\bitcoin-cli -testnet
walletpassphrase xxxxxx 60

C:\>\local\bitcoin-0.15.1\bin\bitcoin-cli.exe -testnet 
   sendtoaddress mrThGN62W4noVhUvWUqHXesaMLB79NCEbW 1.0

155657a1688b7f7ede2041190b055aa7b1ef427bbc343e4ef67342866934407e

4. Check account balances.

C:\>\local\bitcoin-0.15.1\bin\bitcoin-cli.exe -testnet listaccounts
{
  "": -1.00000285,
  "Test 1": 0.00000000,
  "Test 2": 1.00000000,
  "Used on coinfaucet.eu": 8.71492098
}

You can see that, a 0.00000285 BTC transaction fee will be charged to my account.

You can also see that "sendtoaddres" command used my default account "" to provide input fund for the transaction. But my default account "" has no Bitcoins. So I am not sure if this transaction will be confirmed or not.

Wait for some time, and check to see how this transaction gets processed as described in the next tutorial.

Last update: 2018.

Table of Contents

 About This Book

 Introduction of Bitcoin

 Bitcoin Blockchain

 Bitcoin Wallet

 Bitcoin Core

Bitcoin Transaction

 What Is Bitcoin Transaction

 Receive Test Bitcoin from testnet.coinfaucet.eu

 View Transaction on live.blockcypher.com

 Receive Bitcoin in My Test Wallet

 View Bitcoin in My Test Wallet

 Bitcoin-Qt New Incoming Transaction Alert

"bitcoin-cli sendtoaddress" - Send Bitcoin

 Confirm Outgoing Transaction

 Trace Back Bitcoin Transaction Outputs

 Bitcoin-Qt - Bitcoin Core GUI

 Bitcoin Mining

 Bitcoin Consensus Rules

 Bitcoin Block Data Structure

 Bitcoin Transaction Data Structure

 blockexplorer.com API

 Copay - Bitcoin Wallet

 References

 PDF Printing Version