Author

Topic: SegWit change addresses? (Read 2027 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
December 01, 2016, 12: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.
legendary
Activity: 1260
Merit: 1019
December 01, 2016, 11:55:56 AM
#9
You are correct that non-segwit wallets should handle witness transactions since they will receive them in legacy format.
only when confirmed.
full member
Activity: 136
Merit: 120
December 01, 2016, 11:52:12 AM
#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.
sr. member
Activity: 523
Merit: 250
December 01, 2016, 10:53:58 AM
#7
It is soft-forking.

I don't think this makes an address change.


From wan.
sr. member
Activity: 333
Merit: 252
December 01, 2016, 09:28:38 AM
#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
full member
Activity: 136
Merit: 120
November 29, 2016, 11:48:38 AM
#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.
staff
Activity: 4242
Merit: 8672
November 26, 2016, 06:15:39 PM
#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.
full member
Activity: 217
Merit: 259
November 24, 2016, 12: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.
staff
Activity: 3458
Merit: 6793
Just writing some code
November 20, 2016, 04:53:54 PM
#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.
legendary
Activity: 1260
Merit: 1019
November 20, 2016, 03: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
Jump to: