Skip to content

Commit

Permalink
core/bitcoin: allow compatibility namespaces for Casa/Greenaddress
Browse files Browse the repository at this point in the history
  • Loading branch information
matejcik committed Jul 24, 2020
1 parent f1f5816 commit 2c4661e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions core/src/apps/bitcoin/keychain.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from apps.common import HARDENED, coininfo
from apps.common.keychain import get_keychain

from .common import BITCOIN_NAMES

if False:
from protobuf import MessageType
from typing import Callable, Optional, Tuple, TypeVar
Expand Down Expand Up @@ -37,6 +39,21 @@ def get_namespaces_for_coin(coin: coininfo.CoinInfo):
# BIP-84 - native segwit: m/84'/slip44' (/account'/change/addr)
namespaces.append([84 | HARDENED, slip44_id])

if coin.coin_name in BITCOIN_NAMES:
# compatibility namespace for Casa
namespaces.append([49, slip44_id])

# compatibility namespace for Greenaddress:
# m/branch/address_pointer, for branch in (1, 4)
namespaces.append([1])
namespaces.append([4])
# m/3'/subaccount'/branch/address_pointer
namespaces.append([3 | HARDENED])
# sign msg:
# m/0x4741b11e
# m/0x4741b11e/6/pointer
namespaces.append([0x4741B11E])

return namespaces


Expand Down

0 comments on commit 2c4661e

Please sign in to comment.