<p>The entire JSON string needs to be surrounded by single quotes so that the console knows to pass the whole thing to the JSON parser.</p>
<p>Your command should be:</p>
<pre><code>importdescriptors '[{&quot;desc&quot;:&quot;pkh([0e40c862/44h/1h/0h]tpubDCaMqQiGwzuDcCigY2213yHeJqiQEeFKHPJ8KJdWdh6F6hcKjQmDNU4tdwVNQ7PUpSJfs8subNajEs27YpS5cyfet7LQSTsgCTsvqx3ted4/0/*)#8r64ejp4&quot;,&quot;timestamp&quot;:1694822561,&quot;internal&quot;:false}]'
</code></pre>

CC BY-SA 4.0
2024-01-01T17:21:34.713Z
2024-01-01T17:21:34.713Z
Ava Chow
<p>I have been trying to setup a watch-only wallet on Bitcoin Core using the <code>importdescriptors</code> command. To put this into context, I'm trying to use the watch-only wallet on my online machine to create PSBT then sign transactions on a different machine offline.</p>
<p>No matter how I type the command I always get <code>&quot;Error: Error parsing JSON:&quot;</code>.</p>
<p>The command I typed is this one on testnet:</p>
<pre><code>importdescriptors [{&quot;desc&quot;:&quot;pkh([0e40c862/44h/1h/0h]tpubDCaMqQiGwzuDcCigY2213yHeJqiQEeFKHPJ8KJdWdh6F6hcKjQmDNU4tdwVNQ7PUpSJfs8subNajEs27YpS5cyfet7LQSTsgCTsvqx3ted4/0/*)#8r64ejp4&quot;,&quot;timestamp&quot;:1694822561,&quot;internal&quot;:false}]
</code></pre>
<p>From another post I noticed that was fixed by removing all spaces in the commands but that hasn't worked for me unfortunately. I’m using this command in bitcoin-qt console on ubuntu linux.</p>
<p>Any help appreciated, thanks!</p>

<bitcoin-core><json-rpc><output-script-descriptors><watch-only>
Importdescriptors not working (JSON parsing error)
MostlypeacefulBitcoin
# Importdescriptors not working (JSON parsing error)

(Asked by: username_0 on 2024-01-01)

I have been trying to setup a watch-only wallet on Bitcoin Core using the importdescriptors command. To put this into context, I'm trying to use the watch-only wallet on my online machine to create PSBT then sign transactions on a different machine offline.
No matter how I type the command I always get "Error: Error parsing JSON:".
The command I typed is this one on testnet:
importdescriptors [{"desc":"pkh([0e40c862/44h/1h/0h]tpubDCaMqQiGwzuDcCigY2213yHeJqiQEeFKHPJ8KJdWdh6F6hcKjQmDNU4tdwVNQ7PUpSJfs8subNajEs27YpS5cyfet7LQSTsgCTsvqx3ted4/0/*)#8r64ejp4","timestamp":1694822561,"internal":false}]

From another post I noticed that was fixed by removing all spaces in the commands but that hasn't worked for me unfortunately. I’m using this command in bitcoin-qt console on ubuntu linux.
Any help appreciated, thanks!

**Tags:** bitcoin-core, json-rpc, output-script-descriptors, watch-only


---

## 1 answers

### Answer by username_1 on 2024-01-01. Score: 4

The entire JSON string needs to be surrounded by single quotes so that the console knows to pass the whole thing to the JSON parser.
Your command should be:
importdescriptors '[{"desc":"pkh([0e40c862/44h/1h/0h]tpubDCaMqQiGwzuDcCigY2213yHeJqiQEeFKHPJ8KJdWdh6F6hcKjQmDNU4tdwVNQ7PUpSJfs8subNajEs27YpS5cyfet7LQSTsgCTsvqx3ted4/0/*)#8r64ejp4","timestamp":1694822561,"internal":false}]'


---

