PSBT strange behavior #21547

issue GhostOfSatoshi opened this issue on March 29, 2021
  1. GhostOfSatoshi commented at 2:46 PM on March 29, 2021: none

    <!-- Describe the issue -->

    Hi,

    I am trying to set-up a ColdCard to work air-gapped with Bitcoin Core (via SD card). Latest Bitcoin Core 0.21.0 and latest ColdCard firmware used.

    Expected behavior

    <!--- What behavior did you expect? -->

    I Create a watch-only non-descriptor wallet and I execute the importmulti command created by ColdCard (2x5000 addresses).

    • I do a two simple (1in 1 out) test transactions (main-net) all looks good. Core exports the PSBT file ~600 bytes. Coldcard signs it and creates the final TXN ~400 bytes. All good.
    • I believe the exported unsigned PSBT should stay small, but it's not. Actual behavior

    <!--- What was the actual behavior (provide screenshots if the issue is GUI-related)? -->

    Nothing changed (I mean Core closed and reopened few hours later, that's all). New TX arrives in. Trying to do the same spend and PSBT export. Exported PSBT file is now ~176 Kilobytes(!!). See attached partial file. PSBTPartial.txt

    Takes minutes while ColdCard digs through all of that and finally signs the one used and produces a ~400 bytes TXN with the one input one output.

    Nothing fancy is going on, no multisig used, no nothing. Why does Core include a lot/all addresses in a PSBT? Also it's not doing it at the beginning.

    To reproduce

    • Create a watch-only non-descriptor wallet and I execute the importmulti command created by ColdCard (2x5000 addresses) importdescriptors '[{"range": [0, 5000], "timestamp": "now", "active": true, "watchonly": true, "desc": "pkh([XX/44h/0h/0h]xpubXX/0/)#XX", "internal": false}, {"range": [0, 5000], "timestamp": "now", "active": true, "watchonly": true, "desc": "pkh([XX/44h/0h/0h]xpubXX/1/)#XX", "internal": true}]'
    • Check you received the correct addresses from Core
    • Make two receive and send (full) amount transaction to/from on other wallet
    • Now you should see the huge PSBT file now.

    I have done this from scratch with BIP44 and BIP84 addresses and both suffer from the same issue.

    System information Core v0.21.0 from download AMD 2920X Win10 x64

  2. GhostOfSatoshi added the label Bug on Mar 29, 2021
  3. achow101 commented at 4:03 PM on March 29, 2021: member

    This is expected behavior. Bitcoin Core is not including a lot of addresses in the PSBT. It is including an entire previous transaction which happens to be enormous. Due to the way that signing works currently, many airgapped/offline/hardware signers need the entire previous transaction for each input in order to verify the correctness of amounts before they sign the transaction. As such, PSBT includes entire previous transactions. Sometimes this results in very large PSBTs when previous transactions are themselves large. In this case, the previous transaction for the input in this transaction is very large - it is 131953 bytes. You can see this in the non_witness_utxo field of the input.

  4. MarcoFalke closed this on Mar 29, 2021

  5. MarcoFalke removed the label Bug on Mar 29, 2021
  6. MarcoFalke added the label Questions and Help on Mar 29, 2021
  7. GhostOfSatoshi commented at 5:35 PM on March 29, 2021: none

    I see and kind of makes sense now (and see why it includes addresses I have no clue about).

    Thanks for the clarification!

  8. DrahtBot locked this on Aug 18, 2022

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: 2026-04-26 06:14 UTC

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