wallet: bugfix, 'AvailableCoins' invalid output type set for raw PK outputs #27478

pull furszy wants to merge 1 commits into bitcoin:master from furszy:2023_wallet_fix_p2pk_type changing 2 files +6 −7
  1. furszy commented at 9:13 PM on April 17, 2023: member

    AvailableCoins sets raw pubkey outputs with an OutputType::UNKNOWN type instead of OutputType::LEGACY.

    Gladly, no type unknown outputs are skipped during coin selection, nor anything different is done with them. It is just an inconsistency.

  2. wallet: bugfix, 'AvailableCoins' invalid output type set for raw PK outputs
    Raw pubkey outputs are `OutputType::LEGACY` not `OutputType::UNKNOWN`.
    5eda1a11c8
  3. DrahtBot commented at 9:13 PM on April 17, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  4. DrahtBot added the label Wallet on Apr 17, 2023
  5. achow101 commented at 9:26 PM on April 17, 2023: member

    I'm not sure if that's really a bug so long as we aren't excluding them from coin selection. I don't think we actually classify p2pk outputs as being legacy since they don't have an address. Really legacy is talking about address type.

    Additionally, in descriptors, pk() descriptors are treated as having no output type, rather than unknown or legacy.

  6. furszy commented at 10:40 PM on April 17, 2023: member

    I'm not sure if that's really a bug so long as we aren't excluding them from coin selection. I don't think we actually classify p2pk outputs as being legacy since they don't have an address. Really legacy is talking about address type.

    Yeah, so far we aren't excluding them from coin selection but hmm, the more I think about this, the odder is turns for me. E.g. we mix the "legacy" output type usage for the address encoding and also to create and handle the legacy spkm. Because, in parallel to the legacy spkm (which could return two different address encodings), we can also have single p2pkh or p2sh descriptors that returns the same "legacy" output type.

    But ok, that can be left aside. It should get better once we deprecate the legacy spkm.

    Additionally, in descriptors, pk() descriptors are treated as having no output type, rather than unknown or legacy.

    It's odd to be classifying a known spendable output type as unknown. I wouldn't be surprised if someone proposes to skip them during coin selection thinking that they are non-spendable in the future (or thinking that the wallet wasn't able to recognize them so it will not be able to create an input that spends them etc).

    We should document this stuff better somewhere.

  7. furszy commented at 12:30 PM on April 18, 2023: member

    closing since it's not a bug, just an odd classification.

  8. furszy closed this on Apr 18, 2023

  9. furszy deleted the branch on May 27, 2023
  10. bitcoin locked this on May 26, 2024
Labels

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-16 00:13 UTC

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