Merge bitcoin/bitcoin#36855: rpc: Deprecate watchonly wallet no-op named options
What changed, and why it matters
This change is a routine cleanup, not a security fix. Bitcoin Core is formally starting a deprecation cycle for several old wallet RPC options (includeWatching, include_watching, include_watchonly) that already did nothing ('no-op'). Unless a user starts the node with a special compatibility flag, passing those options now returns a clear error instead of being silently ignored. It does not introduce a vulnerability.
No security action required. Operators using these named options should migrate to current wallet behavior or start bitcoind with -deprecatedrpc=watchonly during the deprecation window.
Security signals we found
No memory safety, cryptographic, or authorization changes
Behavior change is a stricter RPC input check, not a relaxation
Options being deprecated are documented as no-op and have no effect on transaction funding logic
No CVE, advisory, or vendor security disclosure referenced
Evidence from the diff
The merge commit adds CheckDeprecatedWatchonlyOption() and calls it from fundrawtransaction, walletcreatefundedpsbt, send, sendall, and simulaterawtransaction. These options have been no-ops since an earlier commit (1337c72198a7d32935431d64e9e58c12f9003abc, referenced in the PR description). The patch makes passing them throw RPC_METHOD_DEPRECATED unless -deprecatedrpc=watchonly is enabled. It also updates tests and release notes and fixes a documentation typo.
Changed components
src/wallet/rpc/spend.cppsrc/wallet/rpc/util.cppsrc/wallet/rpc/util.hsrc/wallet/rpc/wallet.cppdoc/release-notes-watchonly.mdtest/functional/rpc_deprecated.pytest/functional/wallet_simulaterawtx.pyInspect captured patch +52 / −6
### doc/managing-wallets.md
@@ -33,7 +33,7 @@ Wallet encryption may prevent unauthorized access. However, this significantly i
Wallet encryption may also not protect against more sophisticated attacks. An attacker can, for example, obtain the password by installing a keylogger on the user's machine.
-Encrypting an existing wallet is deprecated and not recommended, if encryption is desired, creating a new wallet that is encrypted from creation is recommended. This is accompolished by invoking the `createwallet` RPC with a passphrase argument, for example:
+Encrypting an existing wallet is deprecated and not recommended, if encryption is desired, creating a new wallet that is encrypted from creation is recommended. This is accomplished by invoking the `createwallet` RPC with a passphrase argument, for example:
```
$ bitcoin-cli -named createwallet wallet_name="phillip" passphrase="dontlosethispassphrase"
### doc/release-notes-watchonly.md
@@ -0,0 +1,8 @@
+Updated RPCs
+------------
+
+The no-op `includeWatching`, `include_watching`, and `include_watchonly`
+named options of `fundrawtransaction`, `walletcreatefundedpsbt`,
+`send`, `sendall`, and `simulaterawtransaction` are deprecated. They can only
+be passed when the RPC server is started with `-deprecatedrpc=watchonly` and
+will be removed in the next release. (#36855)
### src/wallet/rpc/spend.cpp
@@ -505,8 +505,8 @@ CreatedTransactionResult FundTransaction(CWallet& wallet, const CMutableTransact
{"changePosition", UniValueType(UniValue::VNUM)},
{"change_position", UniValueType(UniValue::VNUM)},
{"change_type", UniValueType(UniValue::VSTR)},
- {"includeWatching", UniValueType(UniValue::VBOOL)},
- {"include_watching", UniValueType(UniValue::VBOOL)},
+ {"includeWatching", UniValueType(UniValue::VBOOL)}, // deprecated
+ {"include_watching", UniValueType(UniValue::VBOOL)}, // deprecated
{"inputs", UniValueType(UniValue::VARR)},
{"lockUnspents", UniValueType(UniValue::VBOOL)},
{"lock_unspents", UniValueType(UniValue::VBOOL)},
@@ -525,7 +525,10 @@ CreatedTransactionResult FundTransaction(CWallet& wallet, const CMutableTransact
{"input_weights", UniValueType(UniValue::VARR)},
{"max_tx_weight", UniValueType(UniValue::VNUM)},
},
- true, true);
+ /*fAllowNull=*/true, /*fStrict=*/true);
+
+ CheckDeprecatedWatchonlyOption(wallet, options, "includeWatching");
+ CheckDeprecatedWatchonlyOption(wallet, options, "include_watching");
if (options.exists("add_inputs")) {
coinControl.m_allow_other_inputs = options["add_inputs"].get_bool();
@@ -1400,7 +1403,7 @@ RPCMethod sendall()
{
{"add_to_wallet", UniValueType(UniValue::VBOOL)},
{"fee_rate", UniValueType()},
- {"include_watching", UniValueType(UniValue::VBOOL)},
+ {"include_watching", UniValueType(UniValue::VBOOL)}, // deprecated
{"inputs", UniValueType(UniValue::VARR)},
{"locktime", UniValueType(UniValue::VNUM)},
{"lock_unspents", UniValueType(UniValue::VBOOL)},
@@ -1415,6 +1418,7 @@ RPCMethod sendall()
{"solving_data", UniValueType(UniValue::VOBJ)},
},
/*fAllowNull=*/true, /*fStrict=*/true);
+ CheckDeprecatedWatchonlyOption(*pwallet, options, "include_watching");
InterpretFeeEstimationInstructions(/*conf_target=*/request.params[1], /*estimate_mode=*/request.params[2], /*fee_rate=*/request.params[3], options);
### src/wallet/rpc/util.cpp
@@ -30,6 +30,16 @@ bool GetAvoidReuseFlag(const CWallet& wallet, const UniValue& param) {
return avoid_reuse;
}
+void CheckDeprecatedWatchonlyOption(const CWallet& wallet, const UniValue& options, const std::string& option_name)
+{
+ if (!options.exists(option_name)) return;
+ if (wallet.chain().rpcEnableDeprecated("watchonly")) return;
+ throw JSONRPCError(
+ RPC_METHOD_DEPRECATED,
+ "DEPRECATION WARNING: The `" + option_name + "` option, passed as a named argument or in the options object, is no longer used and will be removed in the next release. "
+ "To continue passing this deprecated no-op option, start the RPC server with `-deprecatedrpc=watchonly`.");
+}
+
std::string EnsureUniqueWalletName(const JSONRPCRequest& request, std::optional<std::string_view> wallet_name)
{
if (auto endpoint_wallet{GetWalletNameFromJSONRPCRequest(request)}) {
### src/wallet/rpc/util.h
@@ -49,6 +49,8 @@ void EnsureWalletIsUnlocked(const CWallet&);
WalletContext& EnsureWalletContext(const std::any& context);
bool GetAvoidReuseFlag(const CWallet& wallet, const UniValue& param);
+/// Reject deprecated watchonly options unless explicitly enabled. The options have no effect.
+void CheckDeprecatedWatchonlyOption(const CWallet& wallet, const UniValue& options, const std::string& option_name);
std::string LabelFromValue(const UniValue& value);
//! Fetch parent descriptors of this scriptPubKey.
void PushParentDescriptors(const CWallet& wallet, const CScript& script_pubkey, UniValue& entry);
### src/wallet/rpc/wallet.cpp
@@ -530,6 +530,8 @@ RPCMethod simulaterawtransaction()
if (!rpc_wallet) return UniValue::VNULL;
const CWallet& wallet = *rpc_wallet;
+ CheckDeprecatedWatchonlyOption(wallet, request.params[1], "include_watchonly");
+
LOCK(wallet.cs_wallet);
const auto& txs = request.params[0].get_array();
### test/functional/rpc_deprecated.py
@@ -33,6 +33,24 @@ def run_test(self):
self.nodes[0].createwallet("wtest")
wallet = self.nodes[0].get_wallet_rpc("wtest") # Keep this setup, even if unused
+ self.log.info("Test watchonly option deprecation")
+ address = wallet.getnewaddress()
+ rawtx = self.nodes[0].createrawtransaction([], [{address: 1}])
+ def named_null(val):
+ # TestNodeCLI omits None. Pass "null" to bitcoin-cli instead.
+ return "null" if self.options.usecli and val is None else val
+
+ deprecated_rpcs_watchonly = (
+ lambda val: wallet.fundrawtransaction(rawtx, {"includeWatching": val}),
+ lambda val: wallet.walletcreatefundedpsbt([], [{address: 1}], options={"includeWatching": val}),
+ lambda val: wallet.send([{address: 1}], include_watching=named_null(val)),
+ lambda val: wallet.sendall([address], include_watching=named_null(val)),
+ lambda val: wallet.simulaterawtransaction([rawtx], include_watchonly=named_null(val)),
+ )
+ for val in (True, False, None): # also check deprecation for None
+ for rpc in deprecated_rpcs_watchonly:
+ assert_raises_rpc_error(-32, "deprecated no-op option", rpc, val)
+
self.log.info("Test confTarget option deprecation")
for rpc in (wallet.bumpfee, wallet.psbtbumpfee):
assert_raises_rpc_error(-32, "start the RPC server with the `-deprecatedrpc=confTarget`", rpc, "0" * 64, {"confTarget": 1})
### test/functional/wallet_importprunedfunds.py
@@ -26,7 +26,6 @@ def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
self.noban_tx_relay = True # faster tx relay
- self.extra_args = [["-deprecatedrpc=removeprunedfunds"]] * 2
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
### test/functional/wallet_simulaterawtx.py
@@ -18,6 +18,7 @@ class SimulateTxTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
+ self.extra_args = [["-deprecatedrpc=watchonly"]]
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
@@ -54,6 +55,8 @@ def run_test(self):
# w0 should be unaffected, w2 should see +5 for tx1
assert_equal(w0.simulaterawtransaction([tx1])["balance_change"], 0.0)
assert_equal(w2.simulaterawtransaction([tx1])["balance_change"], 5.0)
+ for include_watchonly in (False, True): # deprecation dummy test
+ assert_equal(w2.simulaterawtransaction([tx1], include_watchonly=include_watchonly)["balance_change"], 5.0)
# w1 should see +5 balance for tx1
assert_equal(w1.simulaterawtransaction([tx1])["balance_change"], 5.0)Why this scored 21/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.