Bitcoin Forum
May 11, 2024, 10:41:34 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: SegWit change addresses?  (Read 2020 times)
amaclin (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
November 20, 2016, 07:44:04 PM
 #1

Should the client use segwit-addresses for change addresses?
If yes - it will be confusing users.
If no - the benefits of segwit are smaller than expected
1715424094
Hero Member
*
Offline Offline

Posts: 1715424094

View Profile Personal Message (Offline)

Ignore
1715424094
Reply with quote  #2

1715424094
Report to moderator
Even in the event that an attacker gains more than 50% of the network's computational power, only transactions sent by the attacker could be reversed or double-spent. The network would not be destroyed.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
November 20, 2016, 08:53:54 PM
Merited by ABCbits (1)
 #2

Should the client use segwit-addresses for change addresses?
Yes

If yes - it will be confusing users.
How so? It should be giving segwit addresses for all addresses regardless.

johoe
Full Member
***
Offline Offline

Activity: 217
Merit: 241


View Profile
November 24, 2016, 04:38:18 PM
 #3

I think the idea so far is to add a segwit account to segwit enabled wallets.  The segwit account then has segwit addresses (p2sh at first).  The user is free to choose between his segwit account and non-segwit account and whether he wants to transfer his funds to the segwit account.  When he uses the segwit account, he uses segwit change addresses.  So every user can decide for himself if/when he wants to update to segwit (of course, only after it gets activated).

It would be possible to use a mixed account with both segwit and non-segwit addresses and maybe even native p2wpkh addresses for change.  But this may be confusing to users, cause inconsistent balances between different wallets (e.g. when sharing xpubs), and make it easier to spot the change output.

Donations to 1CF62UFWXiKqFUmgQMUby9DpEW5LXjypU3
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4172
Merit: 8419



View Profile WWW
November 26, 2016, 10:15:39 PM
Merited by ABCbits (1)
 #4

I think the idea so far is to add a segwit account to segwit enabled wallets.  The segwit account then has segwit addresses (p2sh at first).  The user is free to choose between his segwit account and non-segwit account and whether he wants to transfer his funds to the segwit account.  When he uses the segwit account, he uses segwit change addresses.  So every user can decide for himself if/when he wants to update to segwit (of course, only after it gets activated).

That sounds like foolish wallet construction, IMO.  Don't do that.  A wallet should use segwit (in which case all newly generated addresses should be segwit) or it shouldn't (in which case none of it is).

As far as bare P2WPKH outputs, indeed-- those could be used for change, but they're more identifiable which is pretty ugly.
ScripterRon
Full Member
***
Offline Offline

Activity: 136
Merit: 120


View Profile
November 29, 2016, 03:48:38 PM
 #5

For my own wallet, I've taken the approach of providing both P2PKH ('1') and P2SH-P2WPKH ('3') addresses for each private key.  The user can select either address when providing a receive address to an external site. 

When sending coins, the transaction type is determined by the outputs being spent.  A witness transaction will be created if any output is a witness output.  Otherwise, a legacy transaction is created.  The change address is then selected based on the transaction type.

This should provide interoperability with both new and old wallets.  Even if segwit is activated, that doesn't mean a particular web site will accept witness transactions.  So wallets will need to support both for some time.
trout
Sr. Member
****
Offline Offline

Activity: 333
Merit: 252


View Profile
December 01, 2016, 01:28:38 PM
 #6

Even if segwit is activated, that doesn't mean a particular web site will accept witness transactions.  So wallets will need to support both for some time.

AFAIU,   non-segwit-supporting wallets will still recognize transactions with segwit inputs. So no need keep creating P2PKH addresses in order to be able to pay to non-segwit wallets
dbstmddhks
Sr. Member
****
Offline Offline

Activity: 523
Merit: 250



View Profile
December 01, 2016, 02:53:58 PM
 #7

It is soft-forking.

I don't think this makes an address change.


From wan.
ScripterRon
Full Member
***
Offline Offline

Activity: 136
Merit: 120


View Profile
December 01, 2016, 03:52:12 PM
 #8

Even if segwit is activated, that doesn't mean a particular web site will accept witness transactions.  So wallets will need to support both for some time.

AFAIU,   non-segwit-supporting wallets will still recognize transactions with segwit inputs. So no need keep creating P2PKH addresses in order to be able to pay to non-segwit wallets
I need to generate P2PKH addresses for non-segwit wallets sending coins to me (the generated addresses are for my private keys).  You are correct that non-segwit wallets should handle witness transactions since they will receive them in legacy format.
amaclin (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
December 01, 2016, 03:55:56 PM
 #9

You are correct that non-segwit wallets should handle witness transactions since they will receive them in legacy format.
only when confirmed.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
December 01, 2016, 04:19:04 PM
 #10

Even if segwit is activated, that doesn't mean a particular web site will accept witness transactions.  So wallets will need to support both for some time.

AFAIU,   non-segwit-supporting wallets will still recognize transactions with segwit inputs. So no need keep creating P2PKH addresses in order to be able to pay to non-segwit wallets
I need to generate P2PKH addresses for non-segwit wallets sending coins to me (the generated addresses are for my private keys).  You are correct that non-segwit wallets should handle witness transactions since they will receive them in legacy format.
You should be using p2sh nested segwit addresses. The segwit scripts are the "redeemscript" of a p2sh address. Since all wallets today can use p2sh, this lets wallets without segwit still be able to send to you and you can take advantage of segwit.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!