bitcoin-cli Wallet Commands

This section describes wallet related 'bitcoin-cli' commands.

If you want to learn the structure of your Bitcoin wallet, you can play with the "bitcoin-cli" wallet commands as shown below.

1. Get summary information of my wallet. The balance should be 0 BTC.

C:\>\local\bitcoin-0.15.1\bin\bitcoin-cli -testnet getwalletinfo
{
  "walletname": "wallet.dat",
  "walletversion": 139900,
  "balance": 0.00000000,
  "unconfirmed_balance": 0.00000000,
  "immature_balance": 0.00000000,
  "txcount": 0,
  "keypoololdest": 1518315169,
  "keypoolsize": 1000,
  "keypoolsize_hd_internal": 1000,
  "paytxfee": 0.00000000,
  "hdmasterkeyid": "dab..................................d28"
}

2. Get a new address for my wallet so I can give it to my friend to send me Bitcoin funds.

C:\>\local\bitcoin-0.15.1\bin\bitcoin-cli -testnet getnewaddress

mp6mKbgWE25PyyX63zJ8SRibrKugHMkJDE

3. Get the private key that associated with this address. But I am not going to display the private key here, since it is the only proof of ownership of the address.

C:\>\local\bitcoin-0.15.1\bin\bitcoin-cli -testnet 
   dumpprivkey mp6mKbgWE25PyyX63zJ8SRibrKugHMkJDE
   
cSr..............................................Q7U

4. Get another address for my wallet so I can give it to another friend to send me Bitcoin funds.

C:\>\local\bitcoin-0.15.1\bin\bitcoin-cli -testnet getnewaddress

mrThGN62W4noVhUvWUqHXesaMLB79NCEbW

C:\>\local\bitcoin-0.15.1\bin\bitcoin-cli -testnet 
   dumpprivkey mrThGN62W4noVhUvWUqHXesaMLB79NCEbW
   
cUu..............................................Ri1

It is recommended that you should use one address to receive one payment only. So each new payment, you can call the "bitcoin-cli getnewaddress" command to get a new address.

Table of Contents

 About This Book

 Introduction of Bitcoin

 Bitcoin Blockchain

 Bitcoin Wallet

Bitcoin Core

 Bitcoin Core Programs

 Bitcoin Core Daemon

 Bitcoin Core CLI

 Bitcoin Core CLI Commands

 Access Bitcoin Test Network "-testnet"

 bitcoin-cli Network Commands

 "bitcoin-cli getclock" Command

 bitcoin-cli Transaction Commands

bitcoin-cli Wallet Commands

 "bitcoin-cli encryptwallet" - Set Wallet Password

 "bitcoin-cli walletpassphrase" - Unlock Wallet

 "bitcoin-cli backupwallet" - Backup Wallet

 Bitcoin Transaction

 Bitcoin-Qt - Bitcoin Core GUI

 Bitcoin Mining

 Bitcoin Consensus Rules

 Bitcoin Block Data Structure

 Bitcoin Transaction Data Structure

 Bitcoin Blockchain APIs

 Copay - Bitcoin Wallet

 Archived Tutorials

 References

 Full Version in PDF/EPUB