1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 06:18:07 +00:00

core/bitcoin: allow compatibility namespaces for Casa/Greenaddress

This commit is contained in:
matejcik 2020-07-24 13:22:10 +02:00 committed by matejcik
parent b741560997
commit 19ad1dae8b

View File

@ -3,6 +3,8 @@ from trezor import wire
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
@ -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