<p>I test PSBT in my wallet today, create a transaction in Bitcoin Core, click &quot;send&quot; and &quot;create unsigned&quot;, then &quot;Load PSBT from ...&quot; from menu, error shows:</p>
<pre><code>Unable to decode PSBT 
Unsigned tx does not have empty scriptSigs and scriptWitnesses.: unspecified iostream_category error
</code></pre>
<p>decodepsbt and analyzepsbt show the same error too:</p>
<pre><code>TX decode failed Unsigned tx does not have empty scriptSigs and scriptWitnesses.: unspecified iostream_category error (code -22)
</code></pre>
<p>I have no ideal what happened. But same procedure works fine in another wallet of testnet. Both wallets are not watch-only. Besides, I'm using <strong>prune mode</strong> for block chain. This address I made tx was obtained by <strong>importprivkey</strong>, and then covert to Descriptor Wallets by <strong>migratewallet</strong>.</p>
<p>I found the <a href="https://github.com/bitcoin/bitcoin/blob/master/src/psbt.h" rel="nofollow noreferrer">source code</a>, any clarification is welcome:</p>
<pre><code>                case PSBT_GLOBAL_UNSIGNED_TX:
                {
                    if (!key_lookup.emplace(key).second) {
                        throw std::ios_base::failure(&quot;Duplicate Key, unsigned tx already provided&quot;);
                    } else if (key.size() != 1) {
                        throw std::ios_base::failure(&quot;Global unsigned tx key is more than one byte type&quot;);
                    }
                    CMutableTransaction mtx;
                    // Set the stream to serialize with non-witness since this should always be non-witness
                    UnserializeFromVector(s, TX_NO_WITNESS(mtx));
                    tx = std::move(mtx);
                    // Make sure that all scriptSigs and scriptWitnesses are empty
                    for (const CTxIn&amp; txin : tx-&gt;vin) {
                        if (!txin.scriptSig.empty() || !txin.scriptWitness.IsNull()) {
                            **throw std::ios_base::failure(&quot;Unsigned tx does not have empty scriptSigs and scriptWitnesses.&quot;);**
                        }
                    }
                    break;
                }
</code></pre>

CC BY-SA 4.0
2024-05-08T04:02:01.730Z
The "Create Unsigned" button is only available to wallets with private keys disabled (i.e. watch only wallets)(https://bitcoin.stackexchange.com/a/112432/147825), But the button is active to click in bitcoin core 27.0 with my non-watchonly wallet.
foolbear
CC BY-SA 4.0
2024-05-08T21:20:19.180Z
I'm not able to replicate this error. Regarding the button being there, it added for non-watchonly wallets sometime in the past few years, so that's expected.
Ava Chow
CC BY-SA 4.0
2024-05-09T01:29:04.163Z
@AvaChow，I'm using prune mode for block chain.
foolbear
CC BY-SA 4.0
2024-05-09T01:37:37.890Z
@AvaChow, what does error message "Unsigned tx does not have empty scriptSigs and scriptWitnesses." mean? does it mean that unsigned tx information carries signed info?
foolbear
CC BY-SA 4.0
2024-05-09T01:42:58.327Z
@AvaChow, I don't know does it matter. This address was obtained by importprivkey, and then covert to Descriptor Wallets by migratewallet.
foolbear
<bitcoin-core>
Load PSBT error: Unable to decode PSBT
foolbear
# Load PSBT error: Unable to decode PSBT

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

I test PSBT in my wallet today, create a transaction in Bitcoin Core, click "send" and "create unsigned", then "Load PSBT from ..." from menu, error shows:

```
Unable to decode PSBT 
Unsigned tx does not have empty scriptSigs and scriptWitnesses.: unspecified iostream_category error

```

decodepsbt and analyzepsbt show the same error too:

```
TX decode failed Unsigned tx does not have empty scriptSigs and scriptWitnesses.: unspecified iostream_category error (code -22)

```

I have no ideal what happened. But same procedure works fine in another wallet of testnet. Both wallets are not watch-only. Besides, I'm using **prune mode** for block chain. This address I made tx was obtained by **importprivkey**, and then covert to Descriptor Wallets by **migratewallet**.

I found the [source code](https://github.com/bitcoin/bitcoin/blob/master/src/psbt.h), any clarification is welcome:

```
                case PSBT_GLOBAL_UNSIGNED_TX:
                {
                    if (!key_lookup.emplace(key).second) {
                        throw std::ios_base::failure("Duplicate Key, unsigned tx already provided");
                    } else if (key.size() != 1) {
                        throw std::ios_base::failure("Global unsigned tx key is more than one byte type");
                    }
                    CMutableTransaction mtx;
                    // Set the stream to serialize with non-witness since this should always be non-witness
                    UnserializeFromVector(s, TX_NO_WITNESS(mtx));
                    tx = std::move(mtx);
                    // Make sure that all scriptSigs and scriptWitnesses are empty
                    for (const CTxIn& txin : tx->vin) {
                        if (!txin.scriptSig.empty() || !txin.scriptWitness.IsNull()) {
                            **throw std::ios_base::failure("Unsigned tx does not have empty scriptSigs and scriptWitnesses.");**
                        }
                    }
                    break;
                }

```

**Tags:** bitcoin-core

> **Comments:**
> **username_0**: The "Create Unsigned" button is only available to wallets with private keys disabled (i.e. watch only wallets)(https://bitcoin.stackexchange.com/a/112432/147825), But the button is active to click in bitcoin core 27.0 with my non-watchonly wallet.  
> **username_1**: I'm not able to replicate this error. Regarding the button being there, it added for non-watchonly wallets sometime in the past few years, so that's expected.  
> **username_0**: @username_1，I'm using prune mode for block chain.  
> **username_0**: @username_1, what does error message "Unsigned tx does not have empty scriptSigs and scriptWitnesses." mean? does it mean that unsigned tx information carries signed info?  
> **username_0**: @username_1, I don't know does it matter. This address was obtained by importprivkey, and then covert to Descriptor Wallets by migratewallet.  

---

## 0 answers

