Load PSBT error: Unable to decode PSBT #30070

issue foolbear openend this issue on May 9, 2024
  1. foolbear commented at 5:34 am on May 9, 2024: none

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    “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)

    Expected behaviour

    I expect Load PSBT success.

    And same procedure works fine in another wallet of test net. Both wallets are not watch-only

    Steps to reproduce

    I test PSBT in my wallet today, create a transaction in Bitcoin Core, click “send” and “create unsigned”, then “Load PSBT from …” from menu

    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:

                 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;
                }
    

    Relevant log output

    no relevant log.

    How did you obtain Bitcoin Core

    Pre-built binaries

    What version of Bitcoin Core are you using?

    Bitcoin Core version v27.0.0

    Operating system and version

    MacOS 14.4.1

    Machine specifications

    No response

  2. willcl-ark added the label PSBT on May 9, 2024
  3. maflcko commented at 1:06 pm on May 13, 2024: member
    Are you able to reproduce in regtest, with exact steps to reproduce?
  4. foolbear commented at 1:25 pm on May 13, 2024: none

    keywords: not watch-only wallet, prune mode, importprivkey, migratewallet.

    “And same procedure works fine in another wallet of test net”, but I cannot make an address with UTXOs from years ago(maybe have something to do with prune mode?).

  5. maflcko added the label Wallet on May 13, 2024
  6. foolbear commented at 9:37 am on May 28, 2024: none
    In the above issue, PSBT was created from GUI - send - create unsigned. If I create it using ‘walletcreatefundedpsbt,’ there is no problem. in main net.
  7. willcl-ark commented at 1:38 pm on June 26, 2024: member

    @foolbear are you able to provide some concrete steps to reproduce this? I can’t get it to happen in a few quick tests on my side.

    Without reproduction steps it’s likely going to be difficult to fix, and perhaps we should close the issue for now until we get verified repro steps.

  8. foolbear commented at 4:33 pm on June 26, 2024: none
    1. run bitcoin core in prune mode
    2. create a new blank wallet
    3. importprivkey from an old private key
    4. migratewallet
    5. re-sync blockchain
    6. show the balance
    7. create a transaction using GUI, click “send” and “create unsigned”.
    8. then “Load PSBT from clipboard” from menu, error fired.

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-21 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me