Bitcoin Forum
September 24, 2018, 04:46:04 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Segwit HD wallet issues  (Read 774 times)
btc_enigma
Hero Member
*****
Offline Offline

Activity: 630
Merit: 501


View Profile
September 03, 2017, 07:09:15 AM
 #1

This thread proposes changes to BIP49 to address segwit compatibility issues

Breaking backwards compatibility
The BIP talks about breaking this, and  but it really doesn't.  I really feel it should completely break this. Here is why

What would happen if you recover a wallet  using seed words ?
  1. Since there is no difference in seed words between segwit/non segwit, the wallet would discover both m/44' and m/49' accounts
  2. Note that we cannot ask the user to choose an account he wants to operate on (Segwit/Non segwit). This is like asking him the HD derivation path and a really bad UI
  3. The wallet now has to constantly monitor both m/44' and m/49' accounts for transactions
  
Basically we are always stuck with keeping compatibility with older seed words or always asking the user if the seed words came from segwit/non segwit wallet !

Here is my suggestion :
1. By default all new wallets will be created as segwit  m/49' without asking user anything. I think you would agree with me that in future we want most wallet to be default segwit (unless user chooses a non segwit from advanced options)!

2. Segwit wallet seed words have a different format which is incompatible with previous wallet seed words. This  encodes the information that this wallet is segwit in the seed words itself. We need to define a structure for this


XPUB Derivation
This is something not addressed in the BIP yet.

1. Right now you can get an xpub balance/transaction history. Now there is no way to know whether an xpub is from m/44' or m/49'

2. This breaks lots of things. Wallets like electrum/armory/mycelium support importing  xpub as a watch only wallet. Also services like blockonomics/blockchain.info use xpub for displaying balance/generating merchant addresses

Looking forward to hearing your thoughts. Please advise and I can create a PR encompassing your suggestions.

1537807564
Hero Member
*
Offline Offline

Posts: 1537807564

View Profile Personal Message (Offline)

Ignore
1537807564
Reply with quote  #2

1537807564
Report to moderator
1537807564
Hero Member
*
Offline Offline

Posts: 1537807564

View Profile Personal Message (Offline)

Ignore
1537807564
Reply with quote  #2

1537807564
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1537807564
Hero Member
*
Offline Offline

Posts: 1537807564

View Profile Personal Message (Offline)

Ignore
1537807564
Reply with quote  #2

1537807564
Report to moderator
cr1776
Legendary
*
Offline Offline

Activity: 2002
Merit: 1007


View Profile
September 03, 2017, 10:50:04 AM
 #2

It might be useful to check out how Electrum handles your suggestion #2:

http://docs.electrum.org/en/latest/seedphrase.html

btc_enigma
Hero Member
*****
Offline Offline

Activity: 630
Merit: 501


View Profile
September 04, 2017, 05:07:44 AM
 #3

It might be useful to check out how Electrum handles your suggestion #2:

http://docs.electrum.org/en/latest/seedphrase.html



Thanks for this, in fact electrum also echoes similar reasoning for abandoning seed words in favour of passphrase

Quote
BIP39 seed phrases do not include a version number. This means that software should always know how to generate keys and addresses. BIP43 suggests that wallet software will try various existing derivation schemes within the BIP32 framework. This is extremely inefficient and rests on the assumption that future wallets will support all previously accepted derivation methods. If, in the future, a wallet developer decides not to implement a particular derivation method because it is deprecated, then the software will not be able to detect that the corresponding seed phrases are not supported, and it will return an empty wallet instead. This threatens users funds.

I propose additional version numbers for BIP32 Serialization format to help segwit xpub/xprv derivation. Below the list of new version bytes, resulting base58 prefix and network type:

0x042393df ,  sxpr ,   segwit mainnet private key
0x04239377 , sxpb , segwit mainnet public key
0x042224cc ,  stpr ,  segwit testnet private key
0x04222463 , stpb ,  segwit testnet public key



Looking forward to hearing your thoughts

btc_enigma
Hero Member
*****
Offline Offline

Activity: 630
Merit: 501


View Profile
September 05, 2017, 02:18:53 PM
 #4

Edit: Updated version numbers so that prefix is more readable

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!