<ol>
<li>Wrong checksum</li>
</ol>
<p>You'll need to use the right checksum. The <code>getdescriptorinfo</code> RPC can tell you the checksum for a descriptor that lacks one (as does the error message you're quoting).</p>
<ol start="2">
<li>Active descriptor must be ranged</li>
</ol>
<p>The point of an <em>active</em> descriptor is that it is used to draw new addresses (e.g. <code>getnewaddress</code>) from. Without ranging (a <code>/*</code> at the end of an xpub expression inside the descriptor), the address that corresponds to it is fixed. As this is the case for you, you cannot make the descriptor active.</p>
<ol start="3">
<li>Success without active</li>
</ol>
<blockquote>
<p>but this doesn't fulfill my requirement of monitoring all balances and transactions related to the descriptor.</p>
</blockquote>
<p>Yes it does. The only effect an active descriptor has vs. an inactive one is that it can be used to generate <em>new</em> future addresses. The ability to monitor transactions is unrelated. You don't need an active descriptor.</p>
<p>If importing the descriptor as inactive doesn't do what you're expecting it to do, there is probably something else wrong with it. It's hard for me to guess what is wrong, as you don't explain what you're trying to do.</p>
<p>Also note: <code>wsh(raw(...))</code> is not possible.</p>

CC BY-SA 4.0
2024-09-06T12:01:56.820Z
2024-09-06T12:34:34.493Z
2024-09-06T12:34:34.493Z
Pieter Wuille
<p>I'm trying to import a Pay-to-Witness-Script-Hash (P2WSH) descriptor into my Bitcoin Core watch-only wallet using the <code>importdescriptors</code> command. My goal is to ensure that the wallet reflects all balances and transactions ever created with that specific locking script. However, I'm running into several issues:</p>
<ol>
<li><p><strong>Checksum Errors:</strong></p>
<ul>
<li>When I include a checksum, I get an error stating:
<pre class="lang-json prettyprint-override"><code>&quot;message&quot;: &quot;Provided checksum 'v6fytvxx' does not match computed checksum '8man75y0'&quot;
</code></pre>
</li>
<li>Without a checksum, I receive:
<pre class="lang-json prettyprint-override"><code>&quot;message&quot;: &quot;Missing checksum&quot;
</code></pre>
</li>
</ul>
</li>
<li><p><strong>Active Descriptor Must Be Ranged:</strong></p>
<ul>
<li>When attempting to mark the descriptor as <code>active</code>, I get:
<pre class="lang-json prettyprint-override"><code>&quot;message&quot;: &quot;Active descriptors must be ranged&quot;
</code></pre>
</li>
</ul>
</li>
<li><p><strong>Success Without Active Flag:</strong></p>
<ul>
<li>The descriptor is imported successfully only when <code>active</code> is set to <code>false</code>, but this doesn't fulfill my requirement of monitoring all balances and transactions related to the descriptor.</li>
</ul>
</li>
</ol>
<p>Here’s an example of one of my import attempts:</p>
<pre class="lang-bash prettyprint-override"><code>importdescriptors '[{
    &quot;desc&quot;: &quot;wsh(raw(630320830cb17521024e24d2aff4e1c51eaf122e0e5a6dfe218f7b3b883d1eb537ce9a7e040b329ca5ac6703b0830cb17521030618b7d1a6747cb13bba78611646a8d08c3683e14a0d2a4483c877561e1416efac68)#v6fytvxx)&quot;,
    &quot;timestamp&quot;: &quot;now&quot;,
    &quot;active&quot;: true,
    &quot;internal&quot;: false,
    &quot;label&quot;: &quot;My WSH Descriptor&quot;
}]'
</code></pre>
<p>I want to understand:</p>
<ol>
<li><strong>How to properly set the descriptor as active</strong> while ensuring it reflects all associated balances and transactions.</li>
<li><strong>What changes are needed</strong> to correctly import the descriptor with all necessary flags?</li>
</ol>
<p>Any guidance or examples would be greatly appreciated!</p>

CC BY-SA 4.0
2024-08-30T19:55:45.610Z
non-standard script in the example provided was successfully funded  and spent from it. Here are the details of the transaction:

Transaction ID: a3e25cac25de40b156ffbb2c53a3a0e78e6a28c33d7bac7a14a6e188b751394d
Hash: 6a0c0782a8a148983480c2478ae12e9601d812a4081572dac51eb4e249fc8d3d  I hope this provides more clarity on my situation. Any insights on how to correctly import this descriptor and set it as active while ensuring it reflects all balances and transactions
Al Nostru
<bitcoin-core><output-script-descriptors><watch-only><p2wsh><checklocktimeverify>
Properly Import P2WSH Descriptors into a Watch-Only Wallet to Reflect All Balances and Transactions
Al Nostru
# Properly Import P2WSH Descriptors into a Watch-Only Wallet to Reflect All Balances and Transactions

(Asked by: username_0 on 2024-08-28)

I'm trying to import a Pay-to-Witness-Script-Hash (P2WSH) descriptor into my Bitcoin Core watch-only wallet using the `importdescriptors` command. My goal is to ensure that the wallet reflects all balances and transactions ever created with that specific locking script. However, I'm running into several issues:

1. **Checksum Errors:**

   * When I include a checksum, I get an error stating:

     ```json
     "message": "Provided checksum 'v6fytvxx' does not match computed checksum '8man75y0'"

     ```
   * Without a checksum, I receive:

     ```json
     "message": "Missing checksum"

     ```
2. **Active Descriptor Must Be Ranged:**

   * When attempting to mark the descriptor as `active`, I get:

     ```json
     "message": "Active descriptors must be ranged"

     ```
3. **Success Without Active Flag:**

   * The descriptor is imported successfully only when `active` is set to `false`, but this doesn't fulfill my requirement of monitoring all balances and transactions related to the descriptor.

Here’s an example of one of my import attempts:

```bash
importdescriptors '[{
    "desc": "wsh(raw(630320830cb17521024e24d2aff4e1c51eaf122e0e5a6dfe218f7b3b883d1eb537ce9a7e040b329ca5ac6703b0830cb17521030618b7d1a6747cb13bba78611646a8d08c3683e14a0d2a4483c877561e1416efac68)#v6fytvxx)",
    "timestamp": "now",
    "active": true,
    "internal": false,
    "label": "My WSH Descriptor"
}]'

```

I want to understand:

1. **How to properly set the descriptor as active** while ensuring it reflects all associated balances and transactions.
2. **What changes are needed** to correctly import the descriptor with all necessary flags?

Any guidance or examples would be greatly appreciated!

**Tags:** bitcoin-core, output-script-descriptors, watch-only, p2wsh, checklocktimeverify

> **Comments:**
> **username_0**: non-standard script in the example provided was successfully funded  and spent from it. Here are the details of the transaction:  Transaction ID: a3e25cac25de40b156ffbb2c53a3a0e78e6a28c33d7bac7a14a6e188b751394d Hash: 6a0c0782a8a148983480c2478ae12e9601d812a4081572dac51eb4e249fc8d3d  I hope this provides more clarity on my situation. Any insights on how to correctly import this descriptor and set it as active while ensuring it reflects all balances and transactions  

---

## 1 answers

### Answer by username_1 on 2024-09-06. Score: 1

1. Wrong checksum

You'll need to use the right checksum. The `getdescriptorinfo` RPC can tell you the checksum for a descriptor that lacks one (as does the error message you're quoting).

2. Active descriptor must be ranged

The point of an *active* descriptor is that it is used to draw new addresses (e.g. `getnewaddress`) from. Without ranging (a `/*` at the end of an xpub expression inside the descriptor), the address that corresponds to it is fixed. As this is the case for you, you cannot make the descriptor active.

3. Success without active

> but this doesn't fulfill my requirement of monitoring all balances and transactions related to the descriptor.

Yes it does. The only effect an active descriptor has vs. an inactive one is that it can be used to generate *new* future addresses. The ability to monitor transactions is unrelated. You don't need an active descriptor.

If importing the descriptor as inactive doesn't do what you're expecting it to do, there is probably something else wrong with it. It's hard for me to guess what is wrong, as you don't explain what you're trying to do.

Also note: `wsh(raw(...))` is not possible.


---

