Sendtoaddress flag for sending change to a segwit address? #11134

issue cryptogenesis openend this issue on August 25, 2017
  1. cryptogenesis commented at 2:21 pm on August 25, 2017: none

    Hi all,

    Congratulations and fantastic work with segwit!

    I believe uptake would be much faster if there was a possibility of flagging the sendtoaddress call to send change to a segwit address. Currently the only way to accomplish this is to use raw transactions which makes it quite a bit more complicated for the average user/business owner.

    Thank you all for the continued efforts,

    Evan

  2. coinables commented at 4:02 am on August 27, 2017: contributor
    Concept ACK
  3. sipa commented at 4:04 am on August 27, 2017: member
    This feature is planned for the next minor release (after 0.15.0, whose feature freeze has already passed).
  4. fanquake added this to the milestone 0.15.1 on Aug 27, 2017
  5. luke-jr commented at 6:55 am on August 27, 2017: member
    Probably it should use the same output form as the real destination, at least initially?
  6. dooglus commented at 9:04 am on August 27, 2017: contributor
    It’s not possible to tell whether the real destination is a segwit address or not in general, and I don’t see why it matters.
  7. fanquake added the label RPC/REST/ZMQ on Aug 28, 2017
  8. RHavar commented at 8:16 pm on August 29, 2017: contributor

    It’s not possible to tell whether the real destination is a segwit address or not in general

    You can tell it’s p2sh though. And do the same with your change

    and I don’t see why it matters

    Privacy. It makes it harder to tell to tell which output is change and which address is the “send”.

    I think it’s a good idea (to support as a non-default option), but doubt it’s worth the implementation cost

  9. sipa commented at 1:46 am on October 13, 2017: member
    Is there a strong reason to be able to change the style of change on a per transaction basis? (as opposed to a config option)
  10. RHavar commented at 1:56 am on October 13, 2017: contributor

    Is there a strong reason to be able to change the style of change on a per transaction basis? (as opposed to a config option)

    One case, when sending to an X address (where X is p2sh/p2wsh/p2pkh), I’d like to use X change. (To make it less obvious which is change and which isn’t).

    I guess though that could be a config option (“match change”?) or something though. (And I would suggest that that should even be the default)

  11. MarcoFalke removed this from the milestone 0.15.2 on Nov 10, 2017
  12. MarcoFalke added this to the milestone 0.16.0 on Nov 10, 2017
  13. MarcoFalke commented at 1:38 pm on January 17, 2018: member

    Note that after #11403 it is possible to set the change type for all sentoaddress calls. Though, not on a per-call-basis.

    0./src/qt/bitcoin-qt -regtest -changetype=bech32 -server &
    1./src/bitcoin-cli sendtoaddress $(./src/bitcoin-cli getnewaddress) 1  # Sends to legacy address and change to bech32 address
    
  14. MarcoFalke commented at 1:42 pm on January 17, 2018: member

    Note that there is also a way to do this automatically when another output is bech32. See #12119

    I don’t think it makes sense to add another option to sendtoaddress to allow setting the change type on a per-call basis.

  15. promag commented at 1:49 pm on January 17, 2018: member
    See #12194.
  16. kallewoof referenced this in commit e82ae087ed on Jan 18, 2018
  17. kallewoof referenced this in commit 6ac76db2f6 on Jan 18, 2018
  18. kallewoof referenced this in commit 676b58d825 on Jan 18, 2018
  19. MarcoFalke commented at 7:04 pm on January 18, 2018: member
    #12194 is about fundrawtransaction, this issue is about sendtoaddress
  20. MarcoFalke removed this from the milestone 0.16.0 on Jan 18, 2018
  21. MarcoFalke commented at 7:38 pm on January 18, 2018: member
    Removing this from the 0.16 milestone, since #11489 was untagged also.
  22. jnewbery commented at 6:52 pm on April 2, 2018: member

    I believe the type of change for sendtoaddress will now be determined by the -changetype parameter, as described in #12119.

    I’ve tried this and I’m able to get bech32 change addresses using the sendtoaddress RPC. @cryptogenesis - do you still need this issue to be open?

  23. MarcoFalke commented at 6:56 pm on April 2, 2018: member
    It is not possible on a per-call basis, but I don’t think that is heavy enough to keep this issue open.
  24. MarcoFalke closed this on Apr 2, 2018

  25. 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-09-29 07:12 UTC

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