user112127: I'm using bitcoin-core v23.0.
It seems to support watch-only wallets by setting disable_private_keys=true during wallet creation.
$ bitcoin-cli -regtest createwallet "test" true
{
  "name": "test",
  "warning": ""
}

But when I try to import an address into it, the command fails:
$ bitcoin-cli -regtest -rpcwallet=test importaddress "bcrt1qpsw3ts4v3srzxqk7f797sxhn22xhwcc3cdq0xe"
error code: -4
error message:
This type of wallet does not support this command

The importpubkey command fails, too
$ bitcoin-cli -regtest -rpcwallet=test importpubkey "035310a2af27b41544204c544b6df18a3a7cc217498d740fb9d1212c3af9fd8010"
error code: -4
error message:
This type of wallet does not support this command

So how to add a watch-only address to bitcoin-core?
And is it possible to derive HD addresses using a watch-only wallet? (I know it's possible because Coinkite can do it)

user208: If you're using Bitcoin Core 23.0, and created a new wallet using that, it is by default a descriptor wallet. These are a new generation of wallets which use Output Descriptors to determine which keys/scripts/addresses "belong" to the wallet, as opposed to legacy wallets which use a much less well-defined process to determine this.
Several RPCs, like the importaddress, importpubkey, and importmulti are disabled for descriptor wallets, for the simple reason that the behavior they have for legacy wallets cannot be exactly replicated for descriptor wallets. This is a good thing - it was extremely complicated to reason about what that behavior is.
If you want to import something into a descriptor wallet, you need the importdescriptors RPC instead. This single RPC subsumes the functionality of
all legacy import commands in a single RPC, by using the Output Descriptor language to specify what to import. That includes the ability to import single addresses (using addr([ADDR]) descriptors), or ranges of HD key-derived scripts (e.g. wpkh([XPUB]/0/1/2/*) would import all P2WPKH addresses derived from xpub [XPUB], with derivation path m/0/1/2/0, m/0/1/2/1, m/0/1/2/2, ...).
The documentation on developer.bitcoin.org seems outdated. The Bitcoin Core 23.0 RPC documentation (accessible through the help RPC command) does say:

Note: This command is only compatible with legacy wallets. Use "importdescriptors" with "addr(X)" for descriptor wallets.


112127: <p>I'm using bitcoin-core v23.0.</p>
<p>It seems to support watch-only wallets by setting <a href="https://developer.bitcoin.org/reference/rpc/createwallet.html#argument-2-disable-private-keys" rel="nofollow noreferrer"><code>disable_private_keys=true</code></a> during wallet creation.</p>
<pre><code>$ bitcoin-cli -regtest createwallet &quot;test&quot; true
{
  &quot;name&quot;: &quot;test&quot;,
  &quot;warning&quot;: &quot;&quot;
}
</code></pre>
<p>But when I try to <a href="https://developer.bitcoin.org/reference/rpc/importaddress.html" rel="nofollow noreferrer">import</a> an address into it, the command fails:</p>
<pre><code>$ bitcoin-cli -regtest -rpcwallet=test importaddress &quot;bcrt1qpsw3ts4v3srzxqk7f797sxhn22xhwcc3cdq0xe&quot;
error code: -4
error message:
This type of wallet does not support this command
</code></pre>
<p>The <a href="https://developer.bitcoin.org/reference/rpc/importpubkey.html" rel="nofollow noreferrer"><code>importpubkey</code></a> command fails, too</p>
<pre><code>$ bitcoin-cli -regtest -rpcwallet=test importpubkey &quot;035310a2af27b41544204c544b6df18a3a7cc217498d740fb9d1212c3af9fd8010&quot;
error code: -4
error message:
This type of wallet does not support this command
</code></pre>
<p>So <strong>how to add a watch-only address to bitcoin-core?</strong></p>
<p>And is it possible to derive HD addresses using a watch-only wallet? (I know it's possible because Coinkite can do it)</p>
 208: <p>If you're using Bitcoin Core 23.0, and created a new wallet using that, it is by default a <strong>descriptor wallet</strong>. These are a new generation of wallets which use <a href="https://bitcoin.stackexchange.com/a/99541/208">Output Descriptors</a> to determine which keys/scripts/addresses &quot;belong&quot; to the wallet, as opposed to legacy wallets which use a much less well-defined process to determine this.</p>
<p>Several RPCs, like the <code>importaddress</code>, <code>importpubkey</code>, and <code>importmulti</code> are disabled for descriptor wallets, for the simple reason that the behavior they have for legacy wallets cannot be exactly replicated for descriptor wallets. This is a good thing - it was extremely complicated to reason about what that behavior is.</p>
<p>If you want to import something into a descriptor wallet, you need the <code>importdescriptors</code> RPC instead. This single RPC subsumes the functionality of
all legacy import commands in a single RPC, by using the <a href="https://github.com/bitcoin/bitcoin/blob/v23.0/doc/descriptors.md" rel="nofollow noreferrer">Output Descriptor language</a> to specify what to import. That includes the ability to import single addresses (using <code>addr([ADDR])</code> descriptors), or ranges of HD key-derived scripts (e.g. <code>wpkh([XPUB]/0/1/2/*)</code> would import all P2WPKH addresses derived from xpub <code>[XPUB]</code>, with derivation path <code>m/0/1/2/0</code>, <code>m/0/1/2/1</code>, <code>m/0/1/2/2</code>, ...).</p>
<p>The documentation on <a href="https://developer.bitcoin.org/reference/rpc/importaddress.html" rel="nofollow noreferrer">developer.bitcoin.org</a> seems outdated. The Bitcoin Core 23.0 RPC documentation (accessible through the <code>help</code> RPC command) does say:</p>
<blockquote>
<p>Note: This command is only compatible with legacy wallets. Use &quot;importdescriptors&quot; with &quot;addr(X)&quot; for descriptor wallets.</p>
</blockquote>
