Skip to content

Commit

Permalink
Merge pull request spesmilo#41 from dashpay/develop-ledger
Browse files Browse the repository at this point in the history
fixed Ledger/btchip
  • Loading branch information
schinzelh committed Jun 9, 2016
2 parents 3314bdf + 9d54c1d commit 9bc6040
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions plugins/btchipwallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def sign_tx(self, tx):

class BTChipWallet(BIP32_HD_Wallet):
wallet_type = 'btchip'
root_derivation = "m/44'/0'"
root_derivation = "m/44'/5'"

def __init__(self, storage):
BIP32_HD_Wallet.__init__(self, storage)
Expand Down Expand Up @@ -234,13 +234,13 @@ def get_client(self, noPin=False):

def address_id(self, address):
account_id, (change, address_index) = self.get_address_index(address)
return "44'/0'/%s'/%d/%d" % (account_id, change, address_index)
return "44'/5'/%s'/%d/%d" % (account_id, change, address_index)

def create_main_account(self, password):
self.create_account('Main account', None) #name, empty password

def derive_xkeys(self, root, derivation, password):
derivation = derivation.replace(self.root_name,"44'/0'/")
derivation = derivation.replace(self.root_name,"44'/5'/")
xpub = self.get_public_key(derivation)
return xpub, None

Expand Down Expand Up @@ -281,7 +281,7 @@ def get_public_key(self, bip32_path):
def get_master_public_key(self):
try:
if not self.mpk:
self.mpk = self.get_public_key("44'/0'")
self.mpk = self.get_public_key("44'/5'")
return self.mpk
except Exception, e:
self.give_error(e, True)
Expand Down Expand Up @@ -477,7 +477,7 @@ def check_proper_device(self):
if not self.device_checked:
self.plugin.handler.show_message("Checking device")
try:
nodeData = self.get_client().getWalletPublicKey("44'/0'/0'")
nodeData = self.get_client().getWalletPublicKey("44'/5'/0'")
except Exception, e:
self.give_error(e, True)
finally:
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ protobuf==2.5.0
dnspython==1.12.0
git+https://github.com/mazaclub/x11_hash@1.4#egg=x11_hash
git+https://github.com/mazaclub/python-trezor@rev#egg=trezor
git+https://github.com/keepkey/python-keepkey@v0.7.2#egg=keepkey
git+https://github.com/keepkey/python-keepkey@v0.7.2#egg=keepkey
git+https://github.com/LedgerHQ/btchip-python.git@v0.1.17#egg=btchip

0 comments on commit 9bc6040

Please sign in to comment.