Skip to content

Commit 8c6bab6

Browse files
committed
Update RPC docs to Bitcoin Core 0.21
1 parent abe1c25 commit 8c6bab6

File tree

140 files changed

+2680
-1290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+2680
-1290
lines changed

helpers/rpc/TODO.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# RPC helper To do
22

3-
* Add RST
4-
* Add basic renderer
5-
* Try rendered result
6-
* Add unit tests
7-
* Refactor (share between backends, abstract rst page)
3+
* Add command to add deprecation notice and deprecate getbalance, getunconfirmedbalance in 0.19
4+
5+
* Remove markdown support
6+
* Remove renderer
7+
* Remove helper subcommands which rely on markdown files
8+
9+
* Add command to add "see also" and add references, e.g. in importaddress, importmulti, importprivkey, importpubkey, importwallet, rescanblockchain, walletprocesspsbt
810

911
* Fix description
1012
* gettxoutproof (first line cut off before "txids")

helpers/rpc/annotations-bitcoin-0.21.json

+9
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@
186186
"deprecated": "0.18.0",
187187
"removed": "0.19"
188188
},
189+
"generateblock": {
190+
"added": "0.21"
191+
},
189192
"generatetoaddress": {
190193
"added": "0.13.0",
191194
"see_also": {
@@ -586,6 +589,9 @@
586589
]
587590
}
588591
},
592+
"importdescriptors": {
593+
"added": "0.21"
594+
},
589595
"importmulti": {
590596
"added": "0.14.0",
591597
"see_also": {
@@ -743,6 +749,9 @@
743749
]
744750
}
745751
},
752+
"psbtbumpfee": {
753+
"added": "0.21"
754+
},
746755
"removeprunedfunds": {
747756
"added": "0.13.0",
748757
"see_also": {

reference/rpc/abandontransaction.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ Argument #1 - txid
2121

2222
The transaction id
2323

24+
Result
25+
~~~~~~
26+
27+
::
28+
29+
null (json null)
30+
2431
Examples
2532
~~~~~~~~
2633

@@ -33,5 +40,5 @@ Examples
3340

3441
::
3542

36-
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "abandontransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
43+
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "abandontransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
3744

reference/rpc/abortrescan.rst

+16-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@ abortrescan
88

99
Stops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call.
1010

11+
Note: Use "getwalletinfo" to query the scanning progress.
12+
13+
Result
14+
~~~~~~
15+
16+
.. list-table::
17+
:header-rows: 1
18+
19+
* - Name
20+
- Type
21+
- Description
22+
* - true|false
23+
- boolean
24+
- Whether the abort was successful
25+
1126
Examples
1227
~~~~~~~~
1328

@@ -24,5 +39,5 @@ Abort the running wallet rescan::
2439

2540
As a JSON-RPC call::
2641

27-
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "abortrescan", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
42+
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "abortrescan", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
2843

reference/rpc/addmultisigaddress.rst

+8-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ addmultisigaddress
66

77
``addmultisigaddress nrequired ["key",...] ( "label" "address_type" )``
88

9-
Add a nrequired-to-sign multisignature address to the wallet. Requires a new wallet backup.
9+
Add an nrequired-to-sign multisignature address to the wallet. Requires a new wallet backup.
1010

1111
Each key is a Bitcoin address or hex-encoded public key.
1212

@@ -28,7 +28,7 @@ Argument #2 - keys
2828

2929
**Type:** json array, required
3030

31-
A json array of bitcoin addresses or hex-encoded public keys
31+
The bitcoin addresses or hex-encoded public keys
3232

3333
::
3434

@@ -56,9 +56,10 @@ Result
5656

5757
::
5858

59-
{
60-
"address":"multisigaddress", (string) The value of the new multisig address.
61-
"redeemScript":"script" (string) The string value of the hex-encoded redemption script.
59+
{ (json object)
60+
"address" : "str", (string) The value of the new multisig address
61+
"redeemScript" : "hex", (string) The string value of the hex-encoded redemption script
62+
"descriptor" : "str" (string) The descriptor for this multisig
6263
}
6364

6465
Examples
@@ -69,9 +70,9 @@ Examples
6970

7071
Add a multisig address from 2 addresses::
7172

72-
bitcoin-cli addmultisigaddress 2 "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"
73+
bitcoin-cli addmultisigaddress 2 "[\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\",\"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\"]"
7374

7475
As a JSON-RPC call::
7576

76-
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addmultisigaddress", "params": [2, "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
77+
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "addmultisigaddress", "params": [2, "[\"bc1q09vm5lfy0j5reeulh4x5752q25uqqvz34hufdl\",\"bc1q02ad21edsxd23d32dfgqqsz4vv4nmtfzuklhy3\"]"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
7778

reference/rpc/addnode.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ Argument #2 - command
2727

2828
'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once
2929

30+
Result
31+
~~~~~~
32+
33+
::
34+
35+
null (json null)
36+
3037
Examples
3138
~~~~~~~~
3239

@@ -39,5 +46,5 @@ Examples
3946

4047
::
4148

42-
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addnode", "params": ["192.168.0.6:8333", "onetry"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
49+
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "addnode", "params": ["192.168.0.6:8333", "onetry"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
4350

reference/rpc/analyzepsbt.rst

+26-23
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,32 @@ Result
2020

2121
::
2222

23-
{
24-
"inputs" : [ (array of json objects)
25-
{
26-
"has_utxo" : true|false (boolean) Whether a UTXO is provided
27-
"is_final" : true|false (boolean) Whether the input is finalized
28-
"missing" : { (json object, optional) Things that are missing that are required to complete this input
29-
"pubkeys" : [ (array, optional)
30-
"keyid" (string) Public key ID, hash160 of the public key, of a public key whose BIP 32 derivation path is missing
31-
]
32-
"signatures" : [ (array, optional)
33-
"keyid" (string) Public key ID, hash160 of the public key, of a public key whose signature is missing
34-
]
35-
"redeemscript" : "hash" (string, optional) Hash160 of the redeemScript that is missing
36-
"witnessscript" : "hash" (string, optional) SHA256 of the witnessScript that is missing
37-
}
38-
"next" : "role" (string, optional) Role of the next person that this input needs to go to
39-
}
40-
,...
41-
]
42-
"estimated_vsize" : vsize (numeric, optional) Estimated vsize of the final signed transaction
43-
"estimated_feerate" : feerate (numeric, optional) Estimated feerate of the final signed transaction in BTC/kB. Shown only if all UTXO slots in the PSBT have been filled.
44-
"fee" : fee (numeric, optional) The transaction fee paid. Shown only if all UTXO slots in the PSBT have been filled.
45-
"next" : "role" (string) Role of the next person that this psbt needs to go to
23+
{ (json object)
24+
"inputs" : [ (json array)
25+
{ (json object)
26+
"has_utxo" : true|false, (boolean) Whether a UTXO is provided
27+
"is_final" : true|false, (boolean) Whether the input is finalized
28+
"missing" : { (json object, optional) Things that are missing that are required to complete this input
29+
"pubkeys" : [ (json array, optional)
30+
"hex", (string) Public key ID, hash160 of the public key, of a public key whose BIP 32 derivation path is missing
31+
...
32+
],
33+
"signatures" : [ (json array, optional)
34+
"hex", (string) Public key ID, hash160 of the public key, of a public key whose signature is missing
35+
...
36+
],
37+
"redeemscript" : "hex", (string, optional) Hash160 of the redeemScript that is missing
38+
"witnessscript" : "hex" (string, optional) SHA256 of the witnessScript that is missing
39+
},
40+
"next" : "str" (string, optional) Role of the next person that this input needs to go to
41+
},
42+
...
43+
],
44+
"estimated_vsize" : n, (numeric, optional) Estimated vsize of the final signed transaction
45+
"estimated_feerate" : n, (numeric, optional) Estimated feerate of the final signed transaction in BTC/kB. Shown only if all UTXO slots in the PSBT have been filled
46+
"fee" : n, (numeric, optional) The transaction fee paid. Shown only if all UTXO slots in the PSBT have been filled
47+
"next" : "str", (string) Role of the next person that this psbt needs to go to
48+
"error" : "str" (string, optional) Error message (if there is one)
4649
}
4750

4851
Examples

reference/rpc/backupwallet.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ Argument #1 - destination
1515

1616
The destination directory or file
1717

18+
Result
19+
~~~~~~
20+
21+
::
22+
23+
null (json null)
24+
1825
Examples
1926
~~~~~~~~
2027

@@ -27,5 +34,5 @@ Examples
2734

2835
::
2936

30-
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "backupwallet", "params": ["backup.dat"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
37+
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "backupwallet", "params": ["backup.dat"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
3138

reference/rpc/bumpfee.rst

+31-20
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,25 @@ Bumps the fee of an opt-in-RBF transaction T, replacing it with a new transactio
1010

1111
An opt-in RBF transaction with the given txid must be in the wallet.
1212

13-
The command will pay the additional fee by decreasing (or perhaps removing) its change output.
13+
The command will pay the additional fee by reducing change outputs or adding inputs when necessary.
14+
15+
It may add a new change output if one does not already exist.
16+
17+
All inputs in the original transaction will be included in the replacement transaction.
1418

15-
If the change output is not big enough to cover the increased fee, the command will currently fail
16-
instead of adding new inputs to compensate. (A future implementation could improve this.)
1719
The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.
1820

19-
By default, the new fee will be calculated automatically using estimatesmartfee.
21+
By default, the new fee will be calculated automatically using the estimatesmartfee RPC.
2022

2123
The user can specify a confirmation target for estimatesmartfee.
2224

23-
Alternatively, the user can specify totalFee, or use RPC settxfee to set a higher fee rate.
25+
Alternatively, the user can specify a fee rate in sat/vB for the new transaction.
2426

2527
At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee
2628
returned by getnetworkinfo) to enter the node's mempool.
2729

30+
\* WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB. \*
31+
2832
Argument #1 - txid
2933
~~~~~~~~~~~~~~~~~~
3034

@@ -40,34 +44,41 @@ Argument #2 - options
4044
::
4145

4246
{
43-
"confTarget": n, (numeric, optional, default=fallback to wallet's default) Confirmation target (in blocks)
44-
"totalFee": n, (numeric, optional, default=fallback to 'confTarget') Total fee (NOT feerate) to pay, in satoshis.
45-
In rare cases, the actual fee paid might be slightly higher than the specified
46-
totalFee if the tx change output has to be removed because it is too close to
47-
the dust threshold.
47+
"conf_target": n, (numeric, optional, default=wallet -txconfirmtarget) Confirmation target in blocks
48+
49+
"fee_rate": amount, (numeric or string, optional, default=not set, fall back to wallet fee estimation)
50+
Specify a fee rate in sat/vB instead of relying on the built-in fee estimator.
51+
Must be at least 1.000 sat/vB higher than the current transaction fee rate.
52+
WARNING: before version 0.21, fee_rate was in BTC/kvB. As of 0.21, fee_rate is in sat/vB.
53+
4854
"replaceable": bool, (boolean, optional, default=true) Whether the new transaction should still be
4955
marked bip-125 replaceable. If true, the sequence numbers in the transaction will
5056
be left unchanged from the original. If false, any input sequence numbers in the
5157
original transaction that were less than 0xfffffffe will be increased to 0xfffffffe
5258
so the new transaction will not be explicitly bip-125 replaceable (though it may
5359
still be replaceable in practice, for example if it has unconfirmed ancestors which
5460
are replaceable).
55-
"estimate_mode": "str", (string, optional, default=UNSET) The fee estimate mode, must be one of:
56-
"UNSET"
57-
"ECONOMICAL"
58-
"CONSERVATIVE"
61+
62+
"estimate_mode": "str", (string, optional, default=unset) The fee estimate mode, must be one of (case insensitive):
63+
"unset"
64+
"economical"
65+
"conservative"
5966
}
6067

6168
Result
6269
~~~~~~
6370

6471
::
6572

66-
{
67-
"txid": "value", (string) The id of the new transaction
68-
"origfee": n, (numeric) Fee of the replaced transaction
69-
"fee": n, (numeric) Fee of the new transaction
70-
"errors": [ str... ] (json array of strings) Errors encountered during processing (may be empty)
73+
{ (json object)
74+
"psbt" : "str", (string) The base64-encoded unsigned PSBT of the new transaction. Only returned when wallet private keys are disabled. (DEPRECATED)
75+
"txid" : "hex", (string) The id of the new transaction. Only returned when wallet private keys are enabled.
76+
"origfee" : n, (numeric) The fee of the replaced transaction.
77+
"fee" : n, (numeric) The fee of the new transaction.
78+
"errors" : [ (json array) Errors encountered during processing (may be empty).
79+
"str", (string)
80+
...
81+
]
7182
}
7283

7384
Examples
@@ -76,7 +87,7 @@ Examples
7687

7788
.. highlight:: shell
7889

79-
Bump the fee, get the new transaction's txid::
90+
Bump the fee, get the new transaction'stxid::
8091

8192
bitcoin-cli bumpfee <txid>
8293

reference/rpc/clearbanned.rst

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ clearbanned
88

99
Clear all banned IPs.
1010

11+
Result
12+
~~~~~~
13+
14+
::
15+
16+
null (json null)
17+
1118
Examples
1219
~~~~~~~~
1320

@@ -20,5 +27,5 @@ Examples
2027

2128
::
2229

23-
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "clearbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
30+
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "clearbanned", "params": []}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
2431

reference/rpc/combinepsbt.rst

+15-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Argument #1 - txs
1515

1616
**Type:** json array, required
1717

18-
A json array of base64 strings of partially signed transactions
18+
The base64 strings of partially signed transactions
1919

2020
::
2121

@@ -24,6 +24,19 @@ A json array of base64 strings of partially signed transactions
2424
...
2525
]
2626

27+
Result
28+
~~~~~~
29+
30+
.. list-table::
31+
:header-rows: 1
32+
33+
* - Name
34+
- Type
35+
- Description
36+
* - str
37+
- string
38+
- The base64-encoded partially signed transaction
39+
2740
Examples
2841
~~~~~~~~
2942

@@ -32,5 +45,5 @@ Examples
3245

3346
::
3447

35-
bitcoin-cli combinepsbt ["mybase64_1", "mybase64_2", "mybase64_3"]
48+
bitcoin-cli combinepsbt '["mybase64_1", "mybase64_2", "mybase64_3"]'
3649

0 commit comments

Comments
 (0)