<p>It would appear you're trying to import a non-standard redeemScript. Those are non-solvable by definition.</p>
<p>In Bitcoin Core's terminology, there are several &quot;levels&quot; of knowledge about an address/script/output can have:</p>
<ul>
<li><strong>Nothing</strong>. We know nothing about an address, and don't consider it ours.</li>
<li><strong>Watched</strong>. An address was imported into the wallet, and thus the wallet considers payments to it as incoming (watch-only) payments that affect its balance. However, nothing else is known about the address.</li>
<li><strong>Solvable</strong>. Like watched, but in addition, we actually know how to construct a transaction for spending such an output, with the exception of access to private keys. This means the wallet can do fee estimation for spending (because it can predict how big of a witness/scriptSig will be needed for spending), and can participate in PSBT construction for spending it (which could then e.g. be handed to a hardware wallet or other wallet which does have the private keys). These things aren't possible with just a watched address.</li>
<li><strong>Signable</strong>. Like solvable, but the wallet actually has access to private keys for signing too, and thus could directly construct a transaction spending it, without interacting with any other entity.</li>
</ul>
<p>A non-standard redeemScript cannot be more than watched, as clearly Bitcoin Core can't know how to construct an input for such a script/address. The warning you're getting is letting you know that despite the fact that you provided scripts or public keys to the import command (information which typically helps achieve solvability), the result isn't actually solvable, and thus you'd be just as well off just importing the address and nothing more.</p>

CC BY-SA 4.0
2022-10-18T15:13:58.983Z
2022-10-18T15:13:58.983Z
Pieter Wuille
<p>I am trying to import a P2SH address as watch-only using the importmulti RPC command. I provide the scriptPubKey, timestamp, and redeemscript values. The value of scriptPubKey that I'm submitting is the hex representation of the <code>P2SH HASH160 &lt;20 byte hash&gt; EQUAL</code> part of the script. The redeemscript I'm submitting is the hex representation of the preimage to the <code>OP_HASH160</code> function, that when hashed, equals the <code>&lt;20 byte hash&gt;</code>.</p>
<p>The import is successful, but I get a warning:</p>
<p><em>&quot;Importing as non-solvable: unrecognized script. If this is intentional, don't provide any keys, pubkeys, witnessscript, or redeemscript.&quot;</em></p>
<p>Should not this be solvable if providing both the scriptPubKey and redeemscript? If not, what am I missing?</p>

CC BY-SA 4.0
2022-10-18T04:22:32.820Z
What redeemscript are you trying to import?
Pieter Wuille
CC BY-SA 4.0
2022-10-18T14:31:57.070Z
The scriptPubKey I'm submitting is the Hex representation of the P2SH `HASH160 <20 byte hash> EQUAL` part of the unlocking script. The redeemscript I'm submitting is the hex representation of the preimage to the OP_HASH160 function. It is what satisfies the scriptPubKey execution.
Jeff Trimmer
CC BY-SA 4.0
2022-10-18T14:54:10.950Z
Yes, but what is that redeemscript? Solvable means "Bitcoin Core knows how to construct spends for it, ignoring private keys". If the redeemscript isn't one of a small number of existing templates it recognizes, I don't expect it to consider the construct solvable.
Pieter Wuille
CC BY-SA 4.0
2022-10-18T15:01:02.067Z
It is indeed a nonstandard script. That is, a custom script that probably does not conform to any standard template. Also nonstandard in the sense that when you decode the redeemscript using the `decodescript` RPC, the JSON result includes `"type": "nonstandard"`. Is it impossible to import custom P2SH scripts/addresses as solvable into a bitcoind watch-only wallet?
Jeff Trimmer
CC BY-SA 4.0
2022-10-18T15:02:20.500Z
Yes, by definition. If it's non-standard, Bitcoin Core can't know how to sign for it. You can import and watch such scripts/addresses, but nothing else can be done with it (e.g. fee estimation, or participating in PSBT construction/signing for it). Thus, you might as well just import the address, without providing anything else (scripts etc), as those don't help you do anything you couldn't do without.
Pieter Wuille
CC BY-SA 4.0
2022-10-18T15:17:18.857Z
Ahh, Thanks. I think that answers my question. I was hoping to use bitcoind to construct and fund unsigned transactions with UTXOs encumbered by such custom nonstandard scripts and then export them to an external key store for signing. Sounds like this will not be possible.
Jeff Trimmer
CC BY-SA 4.0
2022-10-18T15:36:23.213Z
You may be interested in the miniscript project (https://bitcoin.sipa.be/miniscript/; disclaimer: my website) which aims to greatly extend the set of scripts Bitcoin software can reason about (including for signing purposes). Watch-only miniscript support will be in the upcoming Bitcoin Core 24.0 version, and signing will possibly be in 25.0. You do need to use descriptor wallets to use them, however, through the `importdescriptor` RPC (`importmulti` doesn't work for legacy wallets).
Pieter Wuille
<bitcoind><p2sh><non-standard-transaction><importmulti>
Is it possible to import a P2SH address as solvable with nonstandard type script?
Jeff Trimmer
# Is it possible to import a P2SH address as solvable with nonstandard type script?

(Asked by: username_0 on 2022-10-17)

I am trying to import a P2SH address as watch-only using the importmulti RPC command. I provide the scriptPubKey, timestamp, and redeemscript values. The value of scriptPubKey that I'm submitting is the hex representation of the `P2SH HASH160 <20 byte hash> EQUAL` part of the script. The redeemscript I'm submitting is the hex representation of the preimage to the `OP_HASH160` function, that when hashed, equals the `<20 byte hash>`.

The import is successful, but I get a warning:

*"Importing as non-solvable: unrecognized script. If this is intentional, don't provide any keys, pubkeys, witnessscript, or redeemscript."*

Should not this be solvable if providing both the scriptPubKey and redeemscript? If not, what am I missing?

**Tags:** bitcoind, p2sh, non-standard-transaction, importmulti

> **Comments:**
> **username_1**: What redeemscript are you trying to import?  
> **username_0**: The scriptPubKey I'm submitting is the Hex representation of the P2SH `HASH160 <20 byte hash> EQUAL` part of the unlocking script. The redeemscript I'm submitting is the hex representation of the preimage to the OP_HASH160 function. It is what satisfies the scriptPubKey execution.  
> **username_1**: Yes, but what is that redeemscript? Solvable means "Bitcoin Core knows how to construct spends for it, ignoring private keys". If the redeemscript isn't one of a small number of existing templates it recognizes, I don't expect it to consider the construct solvable.  
> **username_0**: It is indeed a nonstandard script. That is, a custom script that probably does not conform to any standard template. Also nonstandard in the sense that when you decode the redeemscript using the `decodescript` RPC, the JSON result includes `"type": "nonstandard"`. Is it impossible to import custom P2SH scripts/addresses as solvable into a bitcoind watch-only wallet?  
> **username_1**: Yes, by definition. If it's non-standard, Bitcoin Core can't know how to sign for it. You can import and watch such scripts/addresses, but nothing else can be done with it (e.g. fee estimation, or participating in PSBT construction/signing for it). Thus, you might as well just import the address, without providing anything else (scripts etc), as those don't help you do anything you couldn't do without.  
> **username_0**: Ahh, Thanks. I think that answers my question. I was hoping to use bitcoind to construct and fund unsigned transactions with UTXOs encumbered by such custom nonstandard scripts and then export them to an external key store for signing. Sounds like this will not be possible.  
> **username_1**: You may be interested in the miniscript project (https://bitcoin.sipa.be/miniscript/; disclaimer: my website) which aims to greatly extend the set of scripts Bitcoin software can reason about (including for signing purposes). Watch-only miniscript support will be in the upcoming Bitcoin Core 24.0 version, and signing will possibly be in 25.0. You do need to use descriptor wallets to use them, however, through the `importdescriptor` RPC (`importmulti` doesn't work for legacy wallets).  

---

## 1 answers

### Answer by username_1 on 2022-10-18. Score: 2 | Accepted answer

It would appear you're trying to import a non-standard redeemScript. Those are non-solvable by definition.

In Bitcoin Core's terminology, there are several "levels" of knowledge about an address/script/output can have:

* **Nothing**. We know nothing about an address, and don't consider it ours.
* **Watched**. An address was imported into the wallet, and thus the wallet considers payments to it as incoming (watch-only) payments that affect its balance. However, nothing else is known about the address.
* **Solvable**. Like watched, but in addition, we actually know how to construct a transaction for spending such an output, with the exception of access to private keys. This means the wallet can do fee estimation for spending (because it can predict how big of a witness/scriptSig will be needed for spending), and can participate in PSBT construction for spending it (which could then e.g. be handed to a hardware wallet or other wallet which does have the private keys). These things aren't possible with just a watched address.
* **Signable**. Like solvable, but the wallet actually has access to private keys for signing too, and thus could directly construct a transaction spending it, without interacting with any other entity.

A non-standard redeemScript cannot be more than watched, as clearly Bitcoin Core can't know how to construct an input for such a script/address. The warning you're getting is letting you know that despite the fact that you provided scripts or public keys to the import command (information which typically helps achieve solvability), the result isn't actually solvable, and thus you'd be just as well off just importing the address and nothing more.


---

