RPC Command Reference

Bitcoin console/RPC command list (v0.8.6)

addmultisigaddress <nrequired> <‘[“key”,”key”]’> [account]
Add a nrequired-to-sign multisignature address to the wallet. Each key is a Bitcoin address or hex-encoded public key. If [account] is specified, assign address to [account].
addnode <node> <add|remove|onetry>
Attempts add or remove <node> from the addnode list or try a connection to <node> once.
backupwallet <destination>
Safely copies wallet.dat to destination, which can be a directory or a path with filename.
createmultisig <nrequired> <‘[“key”,”key”]’>
Creates a multi-signature address and returns a json object
with keys:
address : bitcoin address
redeemScript : hex-encoded redemption script
createrawtransaction [{“txid”:txid,”vout”:n},…] {address:amount,…}
Create a transaction spending given inputs (array of objects containing transaction id and output number), sending to given address(es).
Returns hex-encoded raw transaction.
Note that the transaction’s inputs are not signed, and it is not stored in the wallet or transmitted to the network.
decoderawtransaction <hex string>
Return a JSON object representing the serialized, hex-encoded transaction.
dumpprivkey <bitcoinaddress>
Reveals the private key corresponding to <bitcoinaddress>.
encryptwallet <passphrase>
Encrypts the wallet with <passphrase>.
getaccount <bitcoinaddress>
Returns the account associated with the given address.
getaccountaddress <account>
Returns the current Bitcoin address for receiving payments to this account.
getaddednodeinfo <dns> [node]
Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here).
If dns is false, only a list of added nodes will be provided, otherwise connected information will also be available.
getaddressesbyaccount <account>
Returns the list of addresses for the given account.
getbalance [account] [minconf=1]
If [account] is not specified, returns the server’s total available balance.
If [account] is specified, returns the balance in the account.
getblock <hash>
Returns details of a block with given block-hash.
getblockcount
Returns the number of blocks in the longest block chain.
getblockhash <index>
Returns hash of block in best-block-chain at <index>.
getblocktemplate [params]
Returns data needed to construct a block to work on:
“version” : block version
“previousblockhash” : hash of current highest block
“transactions” : contents of non-coinbase transactions that should be included in the next block
“coinbaseaux” : data that should be included in coinbase
“coinbasevalue” : maximum allowable input to coinbase transaction, including the generation award and transaction fees
“target” : hash target
“mintime” : minimum timestamp appropriate for next block
“curtime” : current timestamp
“mutable” : list of ways the block template may be changed
“noncerange” : range of valid nonces
“sigoplimit” : limit of sigops in blocks
“sizelimit” : limit of block size
“bits” : compressed target of next block
“height” : height of the next block
See https://en.bitcoin.it/wiki/BIP_0022 for full specification.
getconnectioncount
Returns the number of connections to other nodes.
getdifficulty
Returns the proof-of-work difficulty as a multiple of the minimum difficulty.
getgenerate
Returns true or false.
gethashespersec
Returns a recent hashes per second performance measurement while generating.
getinfo
Returns an object containing various state info.
getmininginfo
Returns an object containing mining-related information.
getnewaddress [account]
Returns a new Bitcoin address for receiving payments. If [account] is specified (recommended), it is added to the address book so payments received with the address will be credited to [account].
getpeerinfo
Returns data about each connected network node.
getrawmempool
Returns all transaction ids in memory pool.
getrawtransaction <txid> [verbose=0]
If verbose=0, returns a string that is serialized, hex-encoded data for <txid>. If verbose is non-zero, returns an Object with information about <txid>.
getreceivedbyaccount <account> [minconf=1]
Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.
getreceivedbyaddress <bitcoinaddress> [minconf=1]
Returns the total amount received by <bitcoinaddress> in transactions with at least [minconf] confirmations.
gettransaction <txid>
Get detailed information about in-wallet transaction <txid>
gettxout <txid> <n> [includemempool=true]
Returns details about an unspent transaction output.
gettxoutsetinfo
Returns statistics about the unspent transaction output set.
getwork [data]
If [data] is not specified, returns formatted hash data to work on:
“midstate” : precomputed hash state after hashing the first half of the data (DEPRECATED)
“data” : block data
“hash1” : formatted hash buffer for second hash (DEPRECATED)
“target” : little endian hash target
If [data] is specified, tries to solve the block and returns true if it was successful.
importprivkey <bitcoinprivkey> [label] [rescan=true]
Adds a private key (as returned by dumpprivkey) to your wallet.
keypoolrefill
Fills the keypool.
listaccounts [minconf=1]
Returns Object that has account names as keys, account balances as values.
listaddressgroupings
Lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions.
listlockunspent
Returns list of temporarily unspendable outputs.
listreceivedbyaccount [minconf=1] [includeempty=false]
[minconf] is the minimum number of confirmations before payments are included.
[includeempty] whether to include accounts that haven’t received any payments.
Returns an array of objects containing:
“account” : the account of the receiving addresses
“amount” : total amount received by addresses with this account
“confirmations” : number of confirmations of the most recent transaction included
listreceivedbyaddress [minconf=1] [includeempty=false]
[minconf] is the minimum number of confirmations before payments are included.
[includeempty] whether to include addresses that haven’t received any payments.
Returns an array of objects containing:
“address” : receiving address
“account” : the account of the receiving address
“amount” : total amount received by the address
“confirmations” : number of confirmations of the most recent transaction included
listsinceblock [blockhash] [target-confirmations]
Get all transactions in blocks since block [blockhash], or all transactions if omitted
listtransactions [account] [count=10] [from=0]
Returns up to [count] most recent transactions skipping the first [from] transactions for account [account].
listunspent [minconf=1] [maxconf=9999999] [“address”,…]
Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations.
Optionally filtered to only include txouts paid to specified addresses.
Results are an array of Objects, each of which has:
{txid, vout, scriptPubKey, amount, confirmations}
lockunspent unlock? [array-of-Objects]
Updates list of temporarily unspendable outputs.
move <fromaccount> <toaccount> <amount> [minconf=1] [comment]
Move from one account in your wallet to another.
sendfrom <fromaccount> <tobitcoinaddress> <amount> [minconf=1] [comment] [comment-to]
<amount> is a real and is rounded to the nearest 0.00000001
sendmany <fromaccount> {address:amount,…} [minconf=1] [comment]
amounts are double-precision floating point numbers
sendrawtransaction <hex string>
Submits raw transaction (serialized, hex-encoded) to local node and network.
sendtoaddress <bitcoinaddress> <amount> [comment] [comment-to]
<amount> is a real and is rounded to the nearest 0.00000001
setaccount <bitcoinaddress> <account>
Sets the account associated with the given address.
setgenerate <generate> [genproclimit]
<generate> is true or false to turn generation on or off.
Generation is limited to [genproclimit] processors, -1 is unlimited.
settxfee <amount>
<amount> is a real and is rounded to the nearest 0.00000001
signmessage <bitcoinaddress> <message>
Sign a message with the private key of an address
signrawtransaction <hex string> [{“txid”:txid,”vout”:n,”scriptPubKey”:hex,”redeemScript”:hex},…] [<privatekey1>,…] [sighashtype=”ALL”]
Sign inputs for raw transaction (serialized, hex-encoded).
Second optional argument (may be null) is an array of previous transaction outputs that
this transaction depends on but may not yet be in the block chain.
Third optional argument (may be null) is an array of base58-encoded private
keys that, if given, will be the only keys used to sign the transaction.
Fourth optional argument is a string that is one of six values; ALL, NONE, SINGLE or
ALL|ANYONECANPAY, NONE|ANYONECANPAY, SINGLE|ANYONECANPAY.
Returns json object with keys:
hex : raw transaction with signature(s) (hex-encoded string)
complete : 1 if transaction has a complete set of signature (0 if not)
stop
Stop Bitcoin server.
submitblock <hex data> [optional-params-obj]
[optional-params-obj] parameter is currently ignored.
Attempts to submit new block to network.
See https://en.bitcoin.it/wiki/BIP_0022 for full specification.
validateaddress <bitcoinaddress>
Return information about <bitcoinaddress>.
verifymessage <bitcoinaddress> <signature> <message>
Verify a signed message