From 41b003814c1dd3b5614cfb7e9df336fa766b99c4 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Sat, 15 Aug 2020 18:25:54 +0200 Subject: [PATCH] core: allow spending coins from Bitcoin paths if the coin ... has implemented strong replay protection via SIGHASH_FORKID --- core/src/apps/bitcoin/keychain.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/src/apps/bitcoin/keychain.py b/core/src/apps/bitcoin/keychain.py index e3a2c05d76a..7d198b7906a 100644 --- a/core/src/apps/bitcoin/keychain.py +++ b/core/src/apps/bitcoin/keychain.py @@ -56,6 +56,16 @@ def get_namespaces_for_coin(coin: coininfo.CoinInfo): # m/0x4741b11e/6/pointer namespaces.append([0x4741B11E]) + # some wallets such as Electron-Cash (BCH) store coins on Bitcoin paths + # we can allow spending these coins from Bitcoin paths if the coin has + # implemented strong replay protection via SIGHASH_FORKID + if coin.fork_id is not None: + namespaces.append([44 | HARDENED, 0]) + namespaces.append([48 | HARDENED, 0]) + if coin.segwit: + namespaces.append([49 | HARDENED, 0]) + namespaces.append([84 | HARDENED, 0]) + return namespaces