1
0

implement bip84: bip43 purpose/der path for p2wpkh scripts

This commit is contained in:
SomberNight
2017-12-31 02:20:58 +01:00
parent a95534bb0c
commit e3164286d0
3 changed files with 39 additions and 9 deletions

View File

@@ -231,14 +231,15 @@ class BaseWizard(object):
self.derivation_dialog(f)
def derivation_dialog(self, f):
default = bip44_derivation(0, False)
default = bip44_derivation(0, bip43_purpose=44)
message = '\n'.join([
_('Enter your wallet derivation here.'),
_('If you are not sure what this is, leave this field unchanged.')
])
presets = (
('legacy BIP44', bip44_derivation(0, False)),
('p2sh-segwit BIP49', bip44_derivation(0, True)),
('legacy BIP44', bip44_derivation(0, bip43_purpose=44)),
('p2sh-segwit BIP49', bip44_derivation(0, bip43_purpose=49)),
('native-segwit BIP84', bip44_derivation(0, bip43_purpose=84)),
)
self.line_dialog(run_next=f, title=_('Derivation'), message=message,
default=default, test=bitcoin.is_bip32_derivation,
@@ -246,7 +247,7 @@ class BaseWizard(object):
def on_hw_derivation(self, name, device_info, derivation):
from .keystore import hardware_keystore
xtype = 'p2wpkh-p2sh' if derivation.startswith("m/49'/") else 'standard'
xtype = keystore.xtype_from_derivation(derivation)
try:
xpub = self.plugin.get_xpub(device_info.device.id_, derivation, xtype, self)
except BaseException as e: