[TREZOR] Added Segwit support.
Following changes were necessary outside the TREZOR plugin. - transaction.py: update_transaction handles segwit transactions. - keystore.py: added a segwit parameter to bip44_derivation, use m/49' instead of m/44' for segwit.
This commit is contained in:
@@ -684,11 +684,10 @@ is_private_key = lambda x: is_xprv(x) or is_private_key_list(x)
|
||||
is_bip32_key = lambda x: is_xprv(x) or is_xpub(x)
|
||||
|
||||
|
||||
def bip44_derivation(account_id):
|
||||
if bitcoin.TESTNET:
|
||||
return "m/44'/1'/%d'"% int(account_id)
|
||||
else:
|
||||
return "m/44'/0'/%d'"% int(account_id)
|
||||
def bip44_derivation(account_id, segwit=False):
|
||||
bip = 49 if segwit else 44
|
||||
coin = 1 if bitcoin.TESTNET else 0
|
||||
return "m/%d'/%d'/%d'" % (bip, coin, int(account_id))
|
||||
|
||||
def from_seed(seed, passphrase):
|
||||
t = seed_type(seed)
|
||||
|
||||
Reference in New Issue
Block a user