Only accept bare multisig outputs after addmultisigaddress #12874

pull sipa wants to merge 2 commits into bitcoin:master from sipa:201803_nowalletbaremultisig changing 3 files +37 −0
  1. sipa commented at 10:40 pm on April 3, 2018: member

    Currently our wallet code will treat bare multisig outputs (meaning scriptPubKeys with multiple public keys + OP_CHECKMULTISIG operator in it) as ours without the user asking for it, as long as all public keys in it are ours.

    These are:

    • hard to test (as there is no explicit address format for them)
    • expensive to spend (need multiple signatures)
    • wasteful (require more space in the UTXO set than P2PKH/P2SH/P2WPK/P2WSH)
    • generally pointless (you won’t use multisig just for public keys that are all in the same wallet)

    Furthermore, they are problematic in that means that producing a list of all scriptPubKeys we accept is not tractable (it involves all combinations of all public keys that are ours). In further wallet changes I’d like to move to a model where all scriptPubKeys that are treated as ours are explicit, rather than defined by whatever keys we have. The current behavior of the wallet is very hard to model in such a design, so I’d like to get rid of it.

    I think there are two options:

    • Remove it entirely (do not ever accept bare multisig outputs as ours)
    • Only accept bare multisig outputs in situations where the P2SH version of that output would also be acceptable

    This PR implements the second, though I’m open to discussing the first option.

  2. instagibbs commented at 11:21 pm on April 3, 2018: member
    “Do[n’t] treat bare multisig as ours unless added as script” I assume
  3. Do not treat bare multisig as ours unless added as script fb97b3b580
  4. Add test for bare multisig ismine 044770e37c
  5. sipa force-pushed on Apr 3, 2018
  6. sipa commented at 11:24 pm on April 3, 2018: member
    @instagibbs Oops, fixed.
  7. fanquake added the label Validation on Apr 3, 2018
  8. sipa added the label Wallet on Apr 4, 2018
  9. sipa added the label Scripts and tools on Apr 4, 2018
  10. sipa removed the label Validation on Apr 4, 2018
  11. sipa removed the label Scripts and tools on Apr 4, 2018
  12. jonasschnelli commented at 2:09 pm on April 8, 2018: contributor

    utACK 044770e37c4d7d91210e07ddeacd4093be6c9a58 I think this is acceptable. Should probably have a short release notes part.

    Previous slightly related discussions: #8079 #12033

  13. sipa commented at 1:15 am on April 17, 2018: member
    As discussed in the April 12th 2018 IRC meeting, closing this in favor of #13002.
  14. sipa closed this on Apr 17, 2018

  15. laanwj referenced this in commit 487dcbe80c on Apr 26, 2018
  16. UdjinM6 referenced this in commit a1feaa997c on May 21, 2021
  17. TheArbitrator referenced this in commit 55b74a62bb on Jun 4, 2021
  18. UdjinM6 referenced this in commit 7e072720b4 on Jun 5, 2021
  19. UdjinM6 referenced this in commit 370ec04a02 on Jun 5, 2021
  20. MarcoFalke locked this on Sep 8, 2021

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-11-17 12:12 UTC

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