Websockets are the preferred transport for btcd RPC and are used by applications
such as [btcwallet](https://github.com/btcsuite/btcwallet) for inter-process
communication with btcd. The websocket connection endpoint for btcd is
`wss://your_ip_or_domain:8334/ws`.
In addition to the [standard API](#Methods), an [extension API](#WSExtMethods)
has been developed that is exclusive to clients using Websockets. In its current
state, this API attempts to cover features found missing in the standard API
during the development of btcwallet.
While the [standard API](#Methods) is stable, the
[Websocket extension API](#WSExtMethods) should be considered a work in
progress, incomplete, and susceptible to changes (both additions and removals).
The original bitcoind/bitcoin-qt JSON-RPC API documentation is available at [https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list)
|11|[getchaintips](#getchaintips)|Y|Returns information about all known tips in the block tree, including the main chain as well as orphaned branches.|
|12|[getconnectioncount](#getconnectioncount)|N|Returns the number of active connections to other peers.|
|13|[getdifficulty](#getdifficulty)|Y|Returns the proof-of-work difficulty as a multiple of the minimum difficulty.|
|14|[getgenerate](#getgenerate)|N|Return if the server is set to generate coins (mine) or not.|
|15|[gethashespersec](#gethashespersec)|N|Returns a recent hashes per second performance measurement while generating coins (mining).|
|16|[getinfo](#getinfo)|Y|Returns a JSON object containing various state info.|
|17|[getmempoolinfo](#getmempoolinfo)|N|Returns a JSON object containing mempool-related information.|
|18|[getmininginfo](#getmininginfo)|N|Returns a JSON object containing mining-related information.|
|19|[getnettotals](#getnettotals)|Y|Returns a JSON object containing network traffic statistics.|
|20|[getnetworkhashps](#getnetworkhashps)|Y|Returns the estimated network hashes per second for the block heights provided by the parameters.|
|21|[getpeerinfo](#getpeerinfo)|N|Returns information about each connected network peer as an array of json objects.|
|22|[getrawmempool](#getrawmempool)|Y|Returns an array of hashes for all of the transactions currently in the memory pool.|
|23|[getrawtransaction](#getrawtransaction)|Y|Returns information about a transaction given its hash.|
|24|[help](#help)|Y|Returns a list of all commands or help for a specified command.|
|25|[ping](#ping)|N|Queues a ping to be sent to each connected peer.|
|26|[sendrawtransaction](#sendrawtransaction)|Y|Submits the serialized, hex-encoded transaction to the local peer and relays it to the network.<br/><fontcolor="orange">btcd does not yet implement the `allowhighfees` parameter, so it has no effect</font>|
|27|[setgenerate](#setgenerate) |N|Set the server to generate coins (mine) or not.<br/>NOTE: Since btcd does not have the wallet integrated to provide payment addresses, btcd must be configured via the `--miningaddr` option to provide which payment addresses to pay created blocks to for this RPC to function.|
|28|[stop](#stop)|N|Shutdown btcd.|
|29|[submitblock](#submitblock)|Y|Attempts to submit a new serialized, hex-encoded block to the network.|
|30|[validateaddress](#validateaddress)|Y|Verifies the given address is valid. NOTE: Since btcd does not have a wallet integrated, btcd will only return whether the address is valid or not.|
|31|[verifychain](#verifychain)|N|Verifies the block chain database.|
|Parameters|1. peer (string, required) - ip address and port of the peer to operate on<br/>2. command (string, required) - `add` to add a persistent peer, `remove` to remove a persistent peer, or `onetry` to try a single connection to a peer|
|Description|Attempts to add or remove a persistent peer.|
|Parameters|1. transaction inputs (JSON array, required) - json array of json objects<br/>`[`<br/> `{`<br/> `"txid": "hash", (string, required) the hash of the input transaction`<br/> `"vout": n (numeric, required) the specific output of the input transaction to redeem`<br/> `}, ...`<br/>`]`<br/>2. addresses and amounts (JSON object, required) - json object with addresses as keys and amounts as values<br/>`{`<br/> `"address": n.nnn (numeric, required) the address to send to as the key and the amount in BTC as the value`<br/> `, ...`<br/>`}`<br/>3. locktime (int64, optional, default=0) - specifies the transaction locktime. If non-zero, the inputs will also have their locktimes activated. |
|Description|Returns a new transaction spending the provided inputs and sending to the provided addresses.<br/>The transaction inputs are not signed in the created transaction.<br/>The `signrawtransaction` RPC command provided by wallet must be used to sign the resulting transaction.|
|Returns|`"transaction" (string) hex-encoded bytes of the serialized transaction`|
|Example Return|`010000000118c057d3bfd3024628e9a6b18c105e4bb035053d1a378fce08856b7ade89dae6010000`<br/>`0000ffffffff0199efee02000000001976a9141cb013db35ecccc156fdfd81d03a11c51998f99388`<br/>`ac00000000`<br/><fontcolor="orange">**Newlines added for display purposes. The actual return does not contain newlines.**</font>|
[Return to Overview](#MethodOverview)<br/>
***
<aname="decoderawtransaction"/>
| | |
|---|---|
|Method|decoderawtransaction|
|Parameters|1. data (string, required) - serialized, hex-encoded transaction|
|Description|Returns a JSON object representing the provided serialized, hex-encoded transaction.|
|Returns|`{ (json object)`<br/> `"txid": "hash", (string) the hash of the transaction`<br/> `"version": n, (numeric) the transaction version`<br/> `"locktime": n, (numeric) the transaction lock time`<br/> `"vin": [ (array of json objects) the transaction inputs as json objects`<br/> <fontcolor="orange">For coinbase transactions:</font><br/> `{ (json object)`<br/> `"coinbase": "data", (string) the hex-encoded bytes of the signature script`<br/> `"sequence": n, (numeric) the script sequence number`<br/> `}`<br/> <fontcolor="orange">For non-coinbase transactions:</font><br/> `{ (json object)`<br/> `"txid": "hash", (string) the hash of the origin transaction`<br/> `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`<br/> `"scriptSig": { (json object) the signature script used to redeem the origin transaction`<br/> `"asm": "asm", (string) disassembly of the script`<br/> `"hex": "data", (string) hex-encoded bytes of the script`<br/> `}`<br/> `"sequence": n, (numeric) the script sequence number`<br/> `}, ...`<br/> `]`<br/> `"vout": [ (array of json objects) the transaction outputs as json objects`<br/> `{ (json object)`<br/> `"value": n, (numeric) the value in BTC`<br/> `"n": n, (numeric) the index of this transaction output`<br/> `"scriptPubKey": { (json object) the public key script used to pay coins`<br/> `"asm": "asm", (string) disassembly of the script`<br/> `"hex": "data", (string) hex-encoded bytes of the script`<br/> `"reqSigs": n, (numeric) the number of required signatures`<br/> `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`<br/> `"addresses": [ (json array of string) the bitcoin addresses associated with this output`<br/> `"bitcoinaddress", (string) the bitcoin address`<br/> `...`<br/> `]`<br/> `}`<br/> `}, ...`<br/> `]`<br/>`}`|
|Description|Returns a JSON object with information about the provided hex-encoded script.|
|Returns|`{ (json object)`<br/> `"asm": "asm", (string) disassembly of the script`<br/> `"reqSigs": n, (numeric) the number of required signatures`<br/> `"type": "scripttype", (string) the type of the script (e.g. 'pubkeyhash')`<br/> `"addresses": [ (json array of string) the bitcoin addresses associated with this script`<br/> `"bitcoinaddress", (string) the bitcoin address`<br/> `...`<br/> `]`<br/> `"p2sh": "scripthash", (string) the script hash for use in pay-to-script-hash transactions`<br/>`}`|
|Parameters|1. dns (boolean, required) - specifies whether the returned data is a JSON object including DNS and connection information, or just a list of added peers<br/>2. node (string, optional) - only return information about this specific peer instead of all added peers.|
|Description|Returns information about manually added (persistent) peers.|
|Returns (dns=false)|`["ip:port", ...]`|
|Returns (dns=true)|`[ (json array of objects)`<br/> `{ (json object)`<br/> `"addednode": "ip_or_domain", (string) the ip address or domain of the added peer`<br/> `"connected": true or false, (boolean) whether or not the peer is currently connected`<br/> `"addresses": [ (json array or objects) DNS lookup and connection information about the peer`<br/> `{ (json object)`<br/> `"address": "ip", (string) the ip address for this DNS entry`<br/> `"connected": "inbound/outbound/false" (string) the connection 'direction' (if connected)`<br/> `}, ...`<br/> `]`<br/> `}, ...`<br/>`]`|
|Parameters|1. block hash (string, required) - the hash of the block<br/>2. verbosity (int, optional, default=1) - Specifies whether the block data should be returned as a hex-encoded string (0), as parsed data with a slice of TXIDs (1), or as parsed data with parsed transaction data (2).
|Returns (verbosity=0)|`"data" (string) hex-encoded bytes of the serialized block`|
|Returns (verbosity=1)|`{ (json object)`<br/> `"hash": "blockhash", (string) the hash of the block (same as provided)`<br/> `"confirmations": n, (numeric) the number of confirmations`<br/> `"strippedsize", n (numeric) the size of the block without witness data`<br/> `"size": n, (numeric) the size of the block`<br/> `"weight": n, (numeric) value of the weight metric`<br/> `"height": n, (numeric) the height of the block in the block chain`<br/> `"version": n, (numeric) the block version`<br/> `"merkleroot": "hash", (string) root hash of the merkle tree`<br/> `"tx": [ (json array of string) the transaction hashes`<br/> `"transactionhash", (string) hash of the parent transaction`<br/> `...`<br/> `]`<br/> `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`<br/> `"nonce": n, (numeric) the block nonce`<br/> `"bits", n, (numeric) the bits which represent the block difficulty`<br/> `difficulty: n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`<br/> `"previousblockhash": "hash", (string) the hash of the previous block`<br/> `"nextblockhash": "hash", (string) the hash of the next block (only if there is one)`<br/>`}`|
|Returns (verbosity=2)|`{ (json object)`<br/> `"hash": "blockhash", (string) the hash of the block (same as provided)`<br/> `"confirmations": n, (numeric) the number of confirmations`<br/> `"strippedsize", n (numeric) the size of the block without witness data`<br/> `"size": n, (numeric) the size of the block`<br/> `"weight": n, (numeric) value of the weight metric`<br/> `"height": n, (numeric) the height of the block in the block chain`<br/> `"version": n, (numeric) the block version`<br/> `"merkleroot": "hash", (string) root hash of the merkle tree`<br/> `"rawtx": [ (array of json objects) the transactions as json objects`<br/> `(see getrawtransaction json object details)`<br/> `]`<br/> `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`<br/> `"nonce": n, (numeric) the block nonce`<br/> `"bits", n, (numeric) the bits which represent the block difficulty`<br/> `difficulty: n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`<br/> `"previousblockhash": "hash", (string) the hash of the previous block`<br/> `"nextblockhash": "hash", (string) the hash of the next block`<br/>`}`|
|Example Return (verbosity=0)|`"010000000000000000000000000000000000000000000000000000000000000000000000`<br/>`3ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49`<br/>`ffff001d1dac2b7c01010000000100000000000000000000000000000000000000000000`<br/>`00000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f`<br/>`4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f`<br/>`6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104`<br/>`678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f`<br/>`4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"`<br/><fontcolor="orange">**Newlines added for display purposes. The actual return does not contain newlines.**</font>|
|Parameters|1. block hash (string, required) - the hash of the block<br/>2. verbose (boolean, optional, default=true) - specifies the block header is returned as a JSON object instead of a hex-encoded string|
|Description|Returns hex-encoded bytes of the serialized block header.|
|Returns (verbose=false)|`"data" (string) hex-encoded bytes of the serialized block`|
|Returns (verbose=true)|`{ (json object)`<br/> `"hash": "blockhash", (string) the hash of the block (same as provided)`<br/> `"confirmations": n, (numeric) the number of confirmations`<br/> `"height": n, (numeric) the height of the block in the block chain`<br/> `"version": n, (numeric) the block version`<br/> `"merkleroot": "hash", (string) root hash of the merkle tree`<br/> `"time": n, (numeric) the block time in seconds since 1 Jan 1970 GMT`<br/> `"nonce": n, (numeric) the block nonce`<br/> `"bits": n, (numeric) the bits which represent the block difficulty`<br/> `"difficulty": n.nn, (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty`<br/> `"previousblockhash": "hash", (string) the hash of the previous block`<br/> `"nextblockhash": "hash", (string) the hash of the next block (only if there is one)`<br/>`}`|
|Example Return (verbose=false)|`"0200000035ab154183570282ce9afc0b494c9fc6a3cfea05aa8c1add2ecc564900000000`<br/>`38ba3d78e4500a5a7570dbe61960398add4410d278b21cd9708e6d9743f374d544fc0552`<br/>`27f1001c29c1ea3b"`<br/><fontcolor="orange">**Newlines added for display purposes. The actual return does not contain newlines.**</font>|
|Description|Returns information about all known tips in the block tree, including the main chain as well as orphaned branches|
|Returns|`(A json object array)`<br/>`height`: `(numeric)` The height of the chain tip.<br/>`hash`: `(string)` The block hash of the chain tip.<br/>`branchlen`: `(numeric)` Returns zero for main chain. Otherwise is the length of branch connecting the tip to the main chain.<br/>`status`: `(string)` Status of the chain. Returns "active" for the main chain.`|
|Description|Returns the number of active connections to other peers|
|Returns|numeric|
|Example Return|`8`|
[Return to Overview](#MethodOverview)<br/>
***
<aname="getdifficulty"/>
| | |
|---|---|
|Method|getdifficulty|
|Parameters|None|
|Description|Returns the proof-of-work difficulty as a multiple of the minimum difficulty.|
|Returns|numeric|
|Example Return|`1180923195.260000`|
[Return to Overview](#MethodOverview)<br/>
***
<aname="getgenerate"/>
| | |
|---|---|
|Method|getgenerate|
|Parameters|None|
|Description|Return if the server is set to generate coins (mine) or not.|
|Returns|`false` (boolean)|
[Return to Overview](#MethodOverview)<br/>
***
<aname="gethashespersec"/>
| | |
|---|---|
|Method|gethashespersec|
|Parameters|None|
|Description|Returns a recent hashes per second performance measurement while generating coins (mining).|
|Returns|`0` (numeric)|
[Return to Overview](#MethodOverview)<br/>
***
<aname="getinfo"/>
| | |
|---|---|
|Method|getinfo|
|Parameters|None|
|Description|Returns a JSON object containing various state info.|
|Notes|NOTE: Since btcd does NOT contain wallet functionality, wallet-related fields are not returned. See getinfo in btcwallet for a version which includes that information.|
|Returns|`{ (json object)`<br/> `"version": n, (numeric) the version of the server`<br/> `"protocolversion": n, (numeric) the latest supported protocol version`<br/> `"blocks": n, (numeric) the number of blocks processed`<br/> `"timeoffset": n, (numeric) the time offset`<br/> `"connections": n, (numeric) the number of connected peers`<br/> `"proxy": "host:port", (string) the proxy used by the server`<br/> `"difficulty": n.nn, (numeric) the current target difficulty`<br/> `"testnet": true or false, (boolean) whether or not server is using testnet`<br/> `"relayfee": n.nn, (numeric) the minimum relay fee for non-free transactions in BTC/KB`<br/>`}`|
|Description|Returns a JSON object containing mempool-related information.|
|Returns|`{ (json object)`<br/> `"bytes": n, (numeric) size in bytes of the mempool`<br/> `"size": n, (numeric) number of transactions in the mempool`<br/>`}`|
Example Return|`{`<br/> `"bytes": 310768,`<br/> `"size": 157,`<br/>`}`|
|Returns|`{ (json object)`<br/> `"blocks": n, (numeric) latest best block`<br/> `"currentblocksize": n, (numeric) size of the latest best block`<br/> `"currentblockweight": n, (numeric) weight of the latest best block`<br/> `"currentblocktx": n, (numeric) number of transactions in the latest best block`<br/> `"difficulty": n.nn, (numeric) current target difficulty`<br/> `"errors": "errors", (string) any current errors`<br/> `"generate": true or false, (boolean) whether or not server is set to generate coins`<br/> `"genproclimit": n, (numeric) number of processors to use for coin generation (-1 when disabled)`<br/> `"hashespersec": n, (numeric) recent hashes per second performance measurement while generating coins`<br/> `"networkhashps": n, (numeric) estimated network hashes per second for the most recent blocks`<br/> `"pooledtx": n, (numeric) number of transactions in the memory pool`<br/> `"testnet": true or false, (boolean) whether or not server is using testnet`<br/>`}`|
|Description|Returns a JSON object containing network traffic statistics.|
|Returns|`{`<br/> `"totalbytesrecv": n, (numeric) total bytes received`<br/> `"totalbytessent": n, (numeric) total bytes sent`<br/> `"timemillis": n (numeric) number of milliseconds since 1 Jan 1970 GMT`<br/>`}`|
|Parameters|1. blocks (numeric, optional, default=120) - The number of blocks, or -1 for blocks since last difficulty change<br/>2. height (numeric, optional, default=-1) - Perform estimate ending with this height or -1 for current best chain block height|
|Description|Returns the estimated network hashes per second for the block heights provided by the parameters.|
|Returns|numeric|
|Example Return|`6573971939`|
[Return to Overview](#MethodOverview)<br/>
***
<aname="getpeerinfo"/>
| | |
|---|---|
|Method|getpeerinfo|
|Parameters|None|
|Description|Returns data about each connected network peer as an array of json objects.|
|Returns|`[`<br/> `{`<br/> `"addr": "host:port", (string) the ip address and port of the peer`<br/> `"services": "00000001", (string) the services supported by the peer`<br/> `"lastrecv": n, (numeric) time the last message was received in seconds since 1 Jan 1970 GMT`<br/> `"lastsend": n, (numeric) time the last message was sent in seconds since 1 Jan 1970 GMT`<br/> `"bytessent": n, (numeric) total bytes sent`<br/> `"bytesrecv": n, (numeric) total bytes received`<br/> `"conntime": n, (numeric) time the connection was made in seconds since 1 Jan 1970 GMT`<br/> `"pingtime": n, (numeric) number of microseconds the last ping took`<br/> `"pingwait": n, (numeric) number of microseconds a queued ping has been waiting for a response`<br/> `"version": n, (numeric) the protocol version of the peer`<br/> `"subver": "useragent", (string) the user agent of the peer`<br/> `"inbound": true_or_false, (boolean) whether or not the peer is an inbound connection`<br/> `"startingheight": n, (numeric) the latest block height the peer knew about when the connection was established`<br/> `"currentheight": n, (numeric) the latest block height the peer is known to have relayed since connected`<br/> `"syncnode": true_or_false, (boolean) whether or not the peer is the sync peer`<br/> `}, ...`<br/>`]`|
|Parameters|1. transaction hash (string, required) - the hash of the transaction<br/>2. verbose (int, optional, default=0) - specifies the transaction is returned as a JSON object instead of hex-encoded string|
|Description|Returns information about a transaction given its hash.|
|Returns (verbose=0)|`"data" (string) hex-encoded bytes of the serialized transaction`|
|Returns (verbose=1)|`{ (json object)`<br/> `"hex": "data", (string) hex-encoded transaction`<br/> `"txid": "hash", (string) the hash of the transaction`<br/> `"version": n, (numeric) the transaction version`<br/> `"locktime": n, (numeric) the transaction lock time`<br/> `"vin": [ (array of json objects) the transaction inputs as json objects`<br/> <fontcolor="orange">For coinbase transactions:</font><br/> `{ (json object)`<br/> `"coinbase": "data", (string) the hex-encoded bytes of the signature script`<br/> `"sequence": n, (numeric) the script sequence number`<br/> `"txinwitness": “data", (string) the witness stack for the input`<br/> `}`<br/> <fontcolor="orange">For non-coinbase transactions:</font><br/> `{ (json object)`<br/> `"txid": "hash", (string) the hash of the origin transaction`<br/> `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`<br/> `"scriptSig": { (json object) the signature script used to redeem the origin transaction`<br/> `"asm": "asm", (string) disassembly of the script`<br/> `"hex": "data", (string) hex-encoded bytes of the script`<br/> `}`<br/> `"sequence": n, (numeric) the script sequence number`<br/> `"txinwitness": “data", (string) the witness stack for the input`<br/> `}, ...`<br/> `]`<br/> `"vout": [ (array of json objects) the transaction outputs as json objects`<br/> `{ (json object)`<br/> `"value": n, (numeric) the value in BTC`<br/> `"n": n, (numeric) the index of this transaction output`<br/> `"scriptPubKey": { (json object) the public key script used to pay coins`<br/> `"asm": "asm", (string) disassembly of the script`<br/> `"hex": "data", (string) hex-encoded bytes of the script`<br/> `"reqSigs": n, (numeric) the number of required signatures`<br/> `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`<br/> `"addresses": [ (json array of string) the bitcoin addresses associated with this output`<br/> `"bitcoinaddress", (string) the bitcoin address`<br/> `...`<br/> `]`<br/> `}`<br/> `}, ...`<br/> `]`<br/>`}`|
|Example Return (verbose=0)|`"010000000104be666c7053ef26c6110597dad1c1e81b5e6be53d17a8b9d0b34772054bac60000000`<br/>`008c493046022100cb42f8df44eca83dd0a727988dcde9384953e830b1f8004d57485e2ede1b9c8f`<br/>`022100fbce8d84fcf2839127605818ac6c3e7a1531ebc69277c504599289fb1e9058df0141045a33`<br/>`76eeb85e494330b03c1791619d53327441002832f4bd618fd9efa9e644d242d5e1145cb9c2f71965`<br/>`656e276633d4ff1a6db5e7153a0a9042745178ebe0f5ffffffff0280841e00000000001976a91406`<br/>`f1b6703d3f56427bfcfd372f952d50d04b64bd88ac4dd52700000000001976a9146b63f291c295ee`<br/>`abd9aee6be193ab2d019e7ea7088ac00000000`<br/><fontcolor="orange">**Newlines added for display purposes. The actual return does not contain newlines.**</font>|
|Parameters|1. command (string, optional) - the command to get help for|
|Description|Returns a list of all commands or help for a specified command.<br/>When no `command` parameter is specified, a list of avaialable commands is returned<br/>When `command` is a valid method, the help text for that method is returned.|
|Returns|string|
|Example Return|getblockcount<br/>Returns a numeric for the number of blocks in the longest block chain.|
[Return to Overview](#MethodOverview)<br/>
***
<aname="ping"/>
| | |
|---|---|
|Method|ping|
|Parameters|None|
|Description|Queues a ping to be sent to each connected peer.<br/>Ping times are provided by [getpeerinfo](#getpeerinfo) via the `pingtime` and `pingwait` fields.|
|Description|Returns an array of hashes for all of the transactions currently in the memory pool.<br/>The `verbose` flag specifies that each transaction is returned as a JSON object.|
|Notes|<fontcolor="orange">Since btcd does not perform any mining, the priority related fields `startingpriority` and `currentpriority` that are available when the `verbose` flag is set are always 0.</font>|
|Returns (verbose=false)|`[ (json array of string)`<br/> `"transactionhash", (string) hash of the transaction`<br/> `...`<br/>`]`|
|Returns (verbose=true)|`{ (json object)`<br/> `"transactionhash": { (json object)`<br/> `"size": n, (numeric) transaction size in bytes`<br/> `"vsize": n, (numeric) transaction virtual size`<br/> `"weight": n, (numeric) The transaction's weight (between vsize*4-3 and vsize*4)`<br/> `"fee" : n, (numeric) transaction fee in bitcoins`<br/> `"time": n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT`<br/> `"height": n, (numeric) block height when transaction entered the pool`<br/> `"startingpriority": n, (numeric) priority when transaction entered the pool`<br/> `"currentpriority": n, (numeric) current priority`<br/> `"depends": [ (json array) unconfirmed transactions used as inputs for this transaction`<br/> `"transactionhash", (string) hash of the parent transaction`<br/> `...`<br/> `]`<br/> `}, ...`<br/>`}`|
|Parameters|1. generate (boolean, required) - `true` to enable generation, `false` to disable it<br/>2. genproclimit (numeric, optional) - the number of processors (cores) to limit generation to or `-1` for default|
|Description|Set the server to generate coins (mine) or not.|
|Notes|NOTE: Since btcd does not have the wallet integrated to provide payment addresses, btcd must be configured via the `--miningaddr` option to provide which payment addresses to pay created blocks to for this RPC to function.|
|Returns|Nothing|
[Return to Overview](#MethodOverview)<br/>
***
<aname="sendrawtransaction"/>
| | |
|---|---|
|Method|sendrawtransaction|
|Parameters|1. signedhex (string, required) serialized, hex-encoded signed transaction<br/>2. allowhighfees (boolean, optional, default=false) whether or not to allow insanely high fees|
|Description|Submits the serialized, hex-encoded transaction to the local peer and relays it to the network.|
|Notes|<fontcolor="orange">btcd does not yet implement the `allowhighfees` parameter, so it has no effect</font>|
|Returns|`"hash" (string) the hash of the transaction`|
|Parameters|1. data (string, required) serialized, hex-encoded block<br/>2. params (json object, optional, default=nil) this parameter is currently ignored|
|Description|Attempts to submit a new serialized, hex-encoded block to the network.|
|Returns|`{ (json object)`<br/> `"isvalid": true or false, (bool) whether or not the address is valid.`<br/> `"address": "bitcoinaddress", (string) the bitcoin address validated.`<br/>}|
[Return to Overview](#MethodOverview)<br/>
***
<aname="verifychain"/>
| | |
|---|---|
|Method|verifychain|
|Parameters|1. checklevel (numeric, optional, default=3) - how in-depth the verification is (0=least amount of checks, higher levels are clamped to the highest supported level)<br/>2. numblocks (numeric, optional, default=288) - the number of blocks starting from the end of the chain to verify|
|Description|Verifies the block chain database.<br/>The actual checks performed by the `checklevel` parameter is implementation specific. For btcd this is:<br/>`checklevel=0` - Look up each block and ensure it can be loaded from the database.<br/>`checklevel=1` - Perform basic context-free sanity checks on each block.|
|Notes|<fontcolor="orange">Btcd currently only supports `checklevel` 0 and 1, but the default is still 3 for compatibility. Per the information in the Parameters section above, higher levels are automatically clamped to the highest supported level, so this means the default is effectively 1 for btcd.</font>|
The following is an overview of the RPC methods which are implemented by btcd, but not the original bitcoind client. Click the method name for further details such as parameter and return information.
|#|Method|Safe for limited user?|Description|
|---|------|----------|-----------|
|1|[debuglevel](#debuglevel)|N|Dynamically changes the debug logging level.|
|2|[getbestblock](#getbestblock)|Y|Get block height and hash of best block in the main chain.|None|
|3|[getcurrentnet](#getcurrentnet)|Y|Get bitcoin network btcd is running on.|None|
|4|[searchrawtransactions](#searchrawtransactions)|Y|Query for transactions related to a particular address.|None|
|5|[node](#node)|N|Attempts to add or remove a peer. |None|
|6|[generate](#generate)|N|When in simnet or regtest mode, generate a set number of blocks. |None|
|Description|Dynamically changes the debug logging level.<br/>The levelspec can either a debug level or of the form `<subsystem>=<level>,<subsystem2>=<level2>,...`<br/>The valid debug levels are `trace`, `debug`, `info`, `warn`, `error`, and `critical`.<br/>The valid subsystems are `AMGR`, `ADXR`, `BCDB`, `BMGR`, `BTCD`, `CHAN`, `DISC`, `PEER`, `RPCS`, `SCRP`, `SRVR`, and `TXMP`.<br/>Additionally, the special keyword `show` can be used to get a list of the available subsystems.|
|Description|Get block height and hash of best block in the main chain.|
|Returns|`{ (json object)`<br/> `"hash": "data", (string) the hex-encoded bytes of the best block hash`<br/> `"height": n (numeric) the block height of the best block`<br/>`}`|
[Return to Overview](#ExtMethodOverview)<br/>
***
<aname="getcurrentnet"/>
| | |
|---|---|
|Method|getcurrentnet|
|Parameters|None|
|Description|Get bitcoin network btcd is running on.|
|Parameters|1. address (string, required) - bitcoin address <br/> 2. verbose (int, optional, default=true) - specifies the transaction is returned as a JSON object instead of hex-encoded string <br/>3. skip (int, optional, default=0) - the number of leading transactions to leave out of the final response <br/> 4. count (int, optional, default=100) - the maximum number of transactions to return <br/> 5. vinextra (int, optional, default=0) - Specify that extra data from previous output will be returned in vin <br/> 6. reverse (boolean, optional, default=false) - Specifies that the transactions should be returned in reverse chronological order|
|Description|Returns raw data for transactions involving the passed address. Returned transactions are pulled from both the database, and transactions currently in the mempool. Transactions pulled from the mempool will have the `"confirmations"` field set to 0. Usage of this RPC requires the optional `--addrindex` flag to be activated, otherwise all responses will simply return with an error stating the address index has not yet been built up. Similarly, until the address index has caught up with the current best height, all requests will return an error response in order to avoid serving stale data.|
|Returns (verbose=0)|`[ (json array of strings)` <br/> `"serializedtx", ... hex-encoded bytes of the serialized transaction`<br/>`]` |
|Returns (verbose=1)|`[ (array of json objects)` <br/> `{ (json object)`<br/> `"hex": "data", (string) hex-encoded transaction`<br/> `"txid": "hash", (string) the hash of the transaction`<br/> `"version": n, (numeric) the transaction version`<br/> `"locktime": n, (numeric) the transaction lock time`<br/> `"vin": [ (array of json objects) the transaction inputs as json objects`<br/> <fontcolor="orange">For coinbase transactions:</font><br/> `{ (json object)`<br/> `"coinbase": "data", (string) the hex-encoded bytes of the signature script`<br/> `"txinwitness": “data", (string) the witness stack for the input`<br/> `"sequence": n, (numeric) the script sequence number`<br/> `}`<br/> <fontcolor="orange">For non-coinbase transactions:</font><br/> `{ (json object)`<br/> `"txid": "hash", (string) the hash of the origin transaction`<br/> `"vout": n, (numeric) the index of the output being redeemed from the origin transaction`<br/> `"scriptSig": { (json object) the signature script used to redeem the origin transaction`<br/> `"asm": "asm", (string) disassembly of the script`<br/> `"hex": "data", (string) hex-encoded bytes of the script`<br/> `}`<br/> `"prevOut": { (json object) Data from the origin transaction output with index vout.`<br/> `"addresses": ["value",...], (array of string) previous output addresses`<br/> `"value": n.nnn, (numeric) previous output value`<br/> `}`<br/> `"txinwitness": “data", (string) the witness stack for the input`<br/> `"sequence": n, (numeric) the script sequence number`<br/> `}, ...`<br/> `]`<br/> `"vout": [ (array of json objects) the transaction outputs as json objects`<br/> `{ (json object)`<br/> `"value": n, (numeric) the value in BTC`<br/> `"n": n, (numeric) the index of this transaction output`<br/> `"scriptPubKey": { (json object) the public key script used to pay coins`<br/> `"asm": "asm", (string) disassembly of the script`<br/> `"hex": "data", (string) hex-encoded bytes of the script`<br/> `"reqSigs": n, (numeric) the number of required signatures`<br/> `"type": "scripttype" (string) the type of the script (e.g. 'pubkeyhash')`<br/> `"addresses": [ (json array of string) the bitcoin addresses associated with this output`<br/> `"address", (string) the bitcoin address`<br/> `...`<br/> `]`<br/> `}`<br/> `}, ...`<br/> `]`<br/> `"blockhash":"hash" Hash of the block the transaction is part of.`<br/> `"confirmations":n, Number of numeric confirmations of block.`<br/> `"time":t, Transaction time in seconds since the epoch.` <br/> `"blocktime":t, Block time in seconds since the epoch.`<br/>`},...`<br/>`]`|
|Parameters|1. command (string, required) - `connect` to add a peer (defaults to temporary), `remove` to remove a persistent peer, or `disconnect` to remove all matching non-persistent peers <br/> 2. peer (string, required) - ip address and port, or ID of the peer to operate on<br/> 3. connection type (string, optional) - `perm` indicates the peer should be added as a permanent peer, `temp` indicates a connection should only be attempted once. |
|Description|Attempts to add or remove a peer.|
|Returns|Nothing|
[Return to Overview](#MethodOverview)<br/>
***
<aname="generate"/>
| | |
|---|---|
|Method|generate|
|Parameters|1. numblocks (int, required) - The number of blocks to generate |
|Description|When in simnet or regtest mode, generates `numblocks` blocks. If blocks arrive from elsewhere, they are built upon but don't count toward the number of blocks to generate. Only generated blocks are returned. This RPC call will exit with an error if the server is already CPU mining, and will prevent the server from CPU mining for another command while it runs. |
|Returns|`[ (json array of strings)` <br/> `"blockhash", ... hash of the generated block`<br/>`]` |
|Description|Returns the version of the JSON-RPC API built into this release of btcd.|
|Returns|`{ (json object)`<br/> `"btcdjsonrpcapi": {`<br/> `"versionstring": "x.y.z", (string) the version of the JSON-RPC API`<br/> `"major": x, (numeric) the major version of the JSON-RPC API`<br/> `"minor": y, (numeric) the minor version of the JSON-RPC API`<br/> `"patch": z, (numeric) the patch version of the JSON-RPC API`<br/> `"prerelease": "", (string) prerelease info for the JSON-RPC API`<br/> `"buildmetadata": "" (string) metadata about the server build`<br/> `}`<br/>`}`|
The following is an overview of the RPC method requests available exclusively to Websocket clients. All of these RPC methods are available to the limited
user. Click the method name for further details such as parameter and return information.
|#|Method|Description|Notifications|
|---|------|-----------|-------------|
|1|[authenticate](#authenticate)|Authenticate the connection against the username and passphrase configured for the RPC server.<br/><fontcolor="orange">NOTE: This is only required if an HTTP Authorization header is not being used.</font>|None|
|2|[notifyblocks](#notifyblocks)|Send notifications when a block is connected or disconnected from the best chain.|[blockconnected](#blockconnected), [blockdisconnected](#blockdisconnected), [filteredblockconnected](#filteredblockconnected), and [filteredblockdisconnected](#filteredblockdisconnected)|
|3|[stopnotifyblocks](#stopnotifyblocks)|Cancel registered notifications for whenever a block is connected or disconnected from the main (best) chain. |None|
|4|[notifyreceived](#notifyreceived)|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br/>Send notifications when a txout spends to an address.|[recvtx](#recvtx) and [redeemingtx](#redeemingtx)|
|5|[stopnotifyreceived](#stopnotifyreceived)|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br/>Cancel registered notifications for when a txout spends to any of the passed addresses.|None|
|6|[notifyspent](#notifyspent)|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br/>Send notification when a txout is spent.|[redeemingtx](#redeemingtx)|
|7|[stopnotifyspent](#stopnotifyspent)|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br/>Cancel registered spending notifications for each passed outpoint.|None|
|8|[rescan](#rescan)|*DEPRECATED, for similar functionality see [rescanblocks](#rescanblocks)*<br/>Rescan block chain for transactions to addresses and spent transaction outpoints.|[recvtx](#recvtx), [redeemingtx](#redeemingtx), [rescanprogress](#rescanprogress), and [rescanfinished](#rescanfinished) |
|9|[notifynewtransactions](#notifynewtransactions)|Send notifications for all new transactions as they are accepted into the mempool.|[txaccepted](#txaccepted) or [txacceptedverbose](#txacceptedverbose)|
|10|[stopnotifynewtransactions](#stopnotifynewtransactions)|Stop sending either a txaccepted or a txacceptedverbose notification when a new transaction is accepted into the mempool.|None|
|12|[loadtxfilter](#loadtxfilter)|Load, add to, or reload a websocket client's transaction filter for mempool transactions, new blocks and rescanblocks.|[relevanttxaccepted](#relevanttxaccepted)|
|Description|Authenticate the connection against the username and password configured for the RPC server.<br/> Invoking any other method before authenticating with this command will close the connection.<br/><fontcolor="orange">NOTE: This is only required if an HTTP Authorization header is not being used.</font>|
|Notifications|[blockconnected](#blockconnected), [blockdisconnected](#blockdisconnected), [filteredblockconnected](#filteredblockconnected), and [filteredblockdisconnected](#filteredblockdisconnected)|
|Description|Request notifications for whenever a block is connected or disconnected from the main (best) chain.<br/>NOTE: If a client subscribes to both block and transaction (recvtx and redeemingtx) notifications, the blockconnected notification will be sent after all transaction notifications have been sent. This allows clients to know when all relevant transactions for a block have been received.|
|Description|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br/>Send a recvtx notification when a transaction added to mempool or appears in a newly-attached block contains a txout pkScript sending to any of the passed addresses. Matching outpoints are automatically registered for redeemingtx notifications.|
|Description|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br/>Cancel registered receive notifications for each passed address.|
|Parameters|1. Outpoints (JSON array, required)<br/> `[ (JSON array)`<br/> `{ (JSON object)`<br/> `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`<br/> `"index":n (numeric) the txout index of the outpoint`<br/> `},`<br/> `...`<br/> `]`|
|Description|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br/>Send a redeemingtx notification when a transaction spending an outpoint appears in mempool (if relayed to this btcd instance) and when such a transaction first appears in a newly-attached block.|
|Parameters|1. Outpoints (JSON array, required)<br/> `[ (JSON array)`<br/> `{ (JSON object)`<br/> `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`<br/> `"index":n (numeric) the txout index of the outpoint`<br/> `},`<br/> `...`<br/> `]`|
|Description|*DEPRECATED, for similar functionality see [loadtxfilter](#loadtxfilter)*<br/>Cancel registered spending notifications for each passed outpoint.|
|Notifications|[recvtx](#recvtx), [redeemingtx](#redeemingtx), [rescanprogress](#rescanprogress), and [rescanfinished](#rescanfinished)|
|Parameters|1. BeginBlock (string, required) block hash to begin rescanning from<br/>2. Addresses (JSON array, required)<br/> `[ (json array of strings)`<br/> `"bitcoinaddress", (string) the bitcoin address`<br/> `...` <br/> `]`<br/>3. Outpoints (JSON array, required)<br/> `[ (JSON array)`<br/> `{ (JSON object)`<br/> `"hash":"data", (string) the hex-encoded bytes of the outpoint hash`<br/> `"index":n (numeric) the txout index of the outpoint`<br/> `},`<br/> `...`<br/> `]`<br/>4. EndBlock (string, optional) hash of final block to rescan|
|Description|*DEPRECATED, for similar functionality see [rescanblocks](#rescanblocks)*<br/>Rescan block chain for transactions to addresses, starting at block BeginBlock and ending at EndBlock. The current known UTXO set for all passed addresses at height BeginBlock should included in the Outpoints argument. If EndBlock is omitted, the rescan continues through the best block in the main chain. Additionally, if no EndBlock is provided, the client is automatically registered for transaction notifications for all rescanned addresses and the final UTXO set. Rescan results are sent as recvtx and redeemingtx notifications. This call returns once the rescan completes.|
|Notifications|[txaccepted](#txaccepted) or [txacceptedverbose](#txacceptedverbose)|
|Parameters|1. verbose (boolean, optional, default=false) - specifies which type of notification to receive. If verbose is true, then the caller receives [txacceptedverbose](#txacceptedverbose), otherwise the caller receives [txaccepted](#txaccepted)|
|Description|Send either a [txaccepted](#txaccepted) or a [txacceptedverbose](#txacceptedverbose) notification when a new transaction is accepted into the mempool.|
|Returns|Nothing|
[Return to Overview](#WSExtMethodOverview)<br/>
***
<aname="stopnotifynewtransactions"/>
| | |
|---|---|
|Method|stopnotifynewtransactions|
|Notifications|None|
|Parameters|None|
|Description|Stop sending either a [txaccepted](#txaccepted) or a [txacceptedverbose](#txacceptedverbose) notification when a new transaction is accepted into the mempool.|
|Description|Return a JSON object with details regarding a websocket client's current connection to the RPC server. This currently only includes the session ID, a random unsigned 64-bit integer that is created for each newly connected client. Session IDs may be used to verify that the current connection was not lost and subsequently reestablished.|
|Returns|`{ (json object)`<br/> `"sessionid": n (numeric) the session ID`<br/>`}`|
|Parameters|1. Reload (boolean, required) - Load a new filter instead of adding data to an existing one<br/>2. Addresses (JSON array, required) - Array of addresses to add to the transaction filter<br/>3. Outpoints (JSON array, required) - Array of outpoints to add to the transaction filter|
|Description|Load, add to, or reload a websocket client's transaction filter for mempool transactions, new blocks and [rescanblocks](#rescanblocks).|
|Parameters|1. Blockhashes (JSON array, required) - List of hashes to rescan. Each next block must be a child of the previous.|
|Description|Rescan blocks for transactions matching the loaded transaction filter.|
|Returns|`[ (JSON array)`<br/> `{ (JSON object)`<br/> `"hash": "data", (string) Hash of the matching block.`<br/> `"transactions": [ (JSON array) List of matching transactions, serialized and hex-encoded.`<br/> `"serializedtx" (string) Serialized and hex-encoded transaction.`<br/> `]`<br/> `}`<br/>`]`|
btcd uses standard JSON-RPC notifications to notify clients of changes, rather than requiring clients to poll btcd for updates. JSON-RPC notifications are a subset of requests, but do not contain an ID. The notification type is categorized by the `method` field and additional details are sent as a JSON array in the `params` field.
The following is an overview of the JSON-RPC notifications used for Websocket connections. Click the method name for further details of the context(s) in which they are sent and their parameters.
|1|[blockconnected](#blockconnected)|*DEPRECATED, for similar functionality see [filteredblockconnected](#filteredblockconnected)*<br/>Block connected to the main chain.|[notifyblocks](#notifyblocks)|
|2|[blockdisconnected](#blockdisconnected)|*DEPRECATED, for similar functionality see [filteredblockdisconnected](#filteredblockdisconnected)*<br/>Block disconnected from the main chain.|[notifyblocks](#notifyblocks)|
|3|[recvtx](#recvtx)|*DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*<br/>Processed a transaction output spending to a wallet address.|[notifyreceived](#notifyreceived) and [rescan](#rescan)|
|4|[redeemingtx](#redeemingtx)|*DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*<br/>Processed a transaction that spends a registered outpoint.|[notifyspent](#notifyspent) and [rescan](#rescan)|
|5|[txaccepted](#txaccepted)|Received a new transaction after requesting simple notifications of all new transactions accepted into the mempool.|[notifynewtransactions](#notifynewtransactions)|
|6|[txacceptedverbose](#txacceptedverbose)|Received a new transaction after requesting verbose notifications of all new transactions accepted into the mempool.|[notifynewtransactions](#notifynewtransactions)|
|7|[rescanprogress](#rescanprogress)|*DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*<br/>A rescan operation that is underway has made progress.|[rescan](#rescan)|
|8|[rescanfinished](#rescanfinished)|*DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*<br/>A rescan operation has completed.|[rescan](#rescan)|
|9|[relevanttxaccepted](#relevanttxaccepted)|A transaction matching the tx filter has been accepted into the mempool.|[loadtxfilter](#loadtxfilter)|
|10|[filteredblockconnected](#filteredblockconnected)|Block connected to the main chain; contains any transactions that match the client's tx filter.|[notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter)|
|11|[filteredblockdisconnected](#filteredblockdisconnected)|Block disconnected from the main chain.|[notifyblocks](#notifyblocks), [loadtxfilter](#loadtxfilter)|
|Parameters|1. BlockHash (string) hex-encoded bytes of the attached block hash<br/>2. BlockHeight (numeric) height of the attached block<br/>3. BlockTime (numeric) unix time of the attached block|
|Description|*DEPRECATED, for similar functionality see [filteredblockconnected](#filteredblockconnected)*<br/>Notifies when a block has been added to the main chain. Notification is sent to all connected clients.|
|Example|Example blockconnected notification for mainnet block 280330 (newlines added for readability):<br/>`{`<br/> `"jsonrpc": "1.0",`<br/> `"method": "blockconnected",`<br/> `"params":`<br/> `[`<br/> `"000000000000000004cbdfe387f4df44b914e464ca79838a8ab777b3214dbffd",`<br/> `280330,`<br/> `1389636265`<br/> `],`<br/> `"id": null`<br/>`}`|
[Return to Overview](#NotificationOverview)<br/>
***
<aname="blockdisconnected"/>
| | |
|---|---|
|Method|blockdisconnected|
|Request|[notifyblocks](#notifyblocks)|
|Parameters|1. BlockHash (string) hex-encoded bytes of the disconnected block hash<br/>2. BlockHeight (numeric) height of the disconnected block<br/>3. BlockTime (numeric) unix time of the disconnected block|
|Description|*DEPRECATED, for similar functionality see [filteredblockdisconnected](#filteredblockdisconnected)*<br/>Notifies when a block has been removed from the main chain. Notification is sent to all connected clients.|
|Example|Example blockdisconnected notification for mainnet block 280330 (newlines added for readability):<br/>`{`<br/> `"jsonrpc": "1.0",`<br/> `"method": "blockdisconnected",`<br/> `"params":`<br/> `[`<br/> `"000000000000000004cbdfe387f4df44b914e464ca79838a8ab777b3214dbffd",`<br/> `280330,`<br/> `1389636265`<br/> `],`<br/> `"id": null`<br/>`}`|
[Return to Overview](#NotificationOverview)<br/>
***
<aname="recvtx"/>
| | |
|---|---|
|Method|recvtx|
|Request|[rescan](#rescan) or [notifyreceived](#notifyreceived)|
|Parameters|1. Transaction (string) full transaction encoded as a hex string<br/>2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined|
|Description|*DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*<br/>Notifies a client when a transaction is processed that contains at least a single output with a pkScript sending to a requested address. If multiple outputs send to requested addresses, a single notification is sent. If a mempool (unmined) transaction is processed, the block details object (second parameter) is excluded.|
|Example|Example recvtx notification for mainnet transaction 61d3696de4c888730cbe06b0ad8ecb6d72d6108e893895aa9bc067bd7eba3fad when processed by mempool (newlines added for readability):<br/>`{`<br/> `"jsonrpc": "1.0",`<br/> `"method": "recvtx",`<br/> `"params":`<br/> `[`<br/> `"010000000114d9ff358894c486b4ae11c2a8cf7851b1df64c53d2e511278eff17c22fb737300000000..."`<br/> `],`<br/> `"id": null`<br/>`}`<br/>The recvtx notification for the same txout, after the transaction was mined into block 276425:<br/>`{`<br/> `"jsonrpc": "1.0",`<br/> `"method": "recvtx",`<br/> `"params":`<br/> `[`<br/> `"010000000114d9ff358894c486b4ae11c2a8cf7851b1df64c53d2e511278eff17c22fb737300000000...",`<br/> `{`<br/> `"height": 276425,`<br/> `"hash": "000000000000000325474bb799b9e591f965ca4461b72cb7012b808db92bb2fc",`<br/> `"index": 684,`<br/> `"time": 1387737310`<br/> `}`<br/> `],`<br/> `"id": null`<br/>`}`|
[Return to Overview](#NotificationOverview)<br/>
***
<aname="redeemingtx"/>
| | |
|---|---|
|Method|redeemingtx|
|Requests|[notifyspent](#notifyspent) and [rescan](#rescan)|
|Parameters|1. Transaction (string) full transaction encoded as a hex string<br/>2. Block details (object, optional) details about a block and the index of the transaction within a block, if the transaction is mined|
|Description|*DEPRECATED, for similar functionality see [relevanttxaccepted](#relevanttxaccepted) and [filteredblockconnected](#filteredblockconnected)*<br/>Notifies a client when an registered outpoint is spent by a transaction accepted to mempool and/or mined into a block.|
|Example|Example redeemingtx notification for mainnet outpoint 61d3696de4c888730cbe06b0ad8ecb6d72d6108e893895aa9bc067bd7eba3fad:0 after being spent by transaction 4ad0c16ac973ff675dec1f3e5f1273f1c45be2a63554343f21b70240a1e43ece (newlines added for readability):<br/>`{`<br/> `"jsonrpc": "1.0",`<br/> `"method": "redeemingtx",`<br/> `"params":`<br/> `[`<br/> `"0100000003ad3fba7ebd67c09baa9538898e10d6726dcb8eadb006be0c7388c8e46d69d3610000000..."`<br/> `],`<br/> `"id": null`<br/>`}`<br/>The redeemingtx notification for the same txout, after the spending transaction was mined into block 279143:<br/>`{`<br/> `"jsonrpc": "1.0",`<br/> `"method": "recvtx",`<br/> `"params":`<br/> `[`<br/> `"0100000003ad3fba7ebd67c09baa9538898e10d6726dcb8eadb006be0c7388c8e46d69d3610000000...",`<br/> `{`<br/> `"height": 279143,`<br/> `"hash": "00000000000000017188b968a371bab95aa43522665353b646e41865abae02a4",`<br/> `"index": 6,`<br/> `"time": 1389115004`<br/> `}`<br/> `],`<br/> `"id": null`<br/>`}`|
|Description|Notifies when a new transaction has been accepted and the client has requested standard transaction details.|
|Example|Example txaccepted notification for mainnet transaction id "16c54c9d02fe570b9d41b518c0daefae81cc05c69bbe842058e84c6ed5826261" (newlines added for readability):<br/>`{`<br/> `"jsonrpc": "1.0",`<br/> `"method": "txaccepted",`<br/> `"params":`<br/> `[`<br/> `"16c54c9d02fe570b9d41b518c0daefae81cc05c69bbe842058e84c6ed5826261",`<br/> `55838384`<br/> `],`<br/> `"id": null`<br/>`}`|
|Parameters|1. Hash (string) hash of the last processed block<br/>2. Height (numeric) height of the last processed block<br/>3. Time (numeric) UNIX time of the last processed block|
|Description|*DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*<br/>Notifies a client with the current progress at periodic intervals when a long-running [rescan](#rescan) is underway.|
|Parameters|1. Hash (string) hash of the last rescanned block<br/>2. Height (numeric) height of the last rescanned block<br/>3. Time (numeric) UNIX time of the last rescanned block |
|Description|*DEPRECATED, notifications not used by [rescanblocks](#rescanblocks)*<br/>Notifies a client that the [rescan](#rescan) has completed and no further notifications will be sent.|
|Parameters|1. BlockHeight (numeric) height of the attached block<br/>2. Header (string) hex-encoded serialized header of the attached block<br/>3. Transactions (JSON array) hex-encoded serialized transactions matching the filter for the client connection loaded with [loadtxfilter](#loadtxfilter)|
|Description|Notifies when a block has been added to the main chain. Notification is sent to all connected clients.|
|Example|Example filteredblockconnected notification for mainnet block 280330 (newlines added for readability):<br/>`{`<br/> `"jsonrpc": "1.0",`<br/> `"method": "filteredblockconnected",`<br/> `"params":`<br/> `[`<br/> `280330,`<br/> `"0200000052d1e8813f697293e41942aa230e7e4fcc44832d78a1372202000000000000006aa...",`<br/> `[`<br/> `"01000000014221abdcca25c8a3b0c044034875dece048c77d567a806f0c2e7e0f5e25a8f100..."`<br/> `]`<br/> `],`<br/> `"id": null`<br/>`}`|