diff --git a/core/src/apps/bitcoin/get_ownership_id.py b/core/src/apps/bitcoin/get_ownership_id.py index 479dbd05fd..d95ea931e4 100644 --- a/core/src/apps/bitcoin/get_ownership_id.py +++ b/core/src/apps/bitcoin/get_ownership_id.py @@ -1,4 +1,5 @@ from trezor import wire +from trezor.enums import InputScriptType from trezor.messages import GetOwnershipId, OwnershipId from apps.common.paths import validate_path @@ -29,6 +30,9 @@ async def get_ownership_id( if msg.script_type in common.SEGWIT_INPUT_SCRIPT_TYPES and not coin.segwit: raise wire.DataError("Segwit not enabled on this coin") + if msg.script_type == InputScriptType.SPENDTAPROOT and not coin.taproot: + raise wire.DataError("Taproot not enabled on this coin") + node = keychain.derive(msg.address_n) address = addresses.get_address(msg.script_type, coin, node, msg.multisig) script_pubkey = scripts.output_derive_script(address, coin) diff --git a/core/src/apps/bitcoin/get_ownership_proof.py b/core/src/apps/bitcoin/get_ownership_proof.py index a451d49745..7d44c11666 100644 --- a/core/src/apps/bitcoin/get_ownership_proof.py +++ b/core/src/apps/bitcoin/get_ownership_proof.py @@ -1,4 +1,5 @@ from trezor import ui, wire +from trezor.enums import InputScriptType from trezor.messages import GetOwnershipProof, OwnershipProof from trezor.ui.layouts import confirm_action, confirm_blob @@ -42,6 +43,9 @@ async def get_ownership_proof( if msg.script_type in common.SEGWIT_INPUT_SCRIPT_TYPES and not coin.segwit: raise wire.DataError("Segwit not enabled on this coin") + if msg.script_type == InputScriptType.SPENDTAPROOT and not coin.taproot: + raise wire.DataError("Taproot not enabled on this coin") + node = keychain.derive(msg.address_n) address = addresses.get_address(msg.script_type, coin, node, msg.multisig) script_pubkey = scripts.output_derive_script(address, coin) diff --git a/core/src/apps/bitcoin/sign_tx/helpers.py b/core/src/apps/bitcoin/sign_tx/helpers.py index 8ef82d195c..84ec7d8713 100644 --- a/core/src/apps/bitcoin/sign_tx/helpers.py +++ b/core/src/apps/bitcoin/sign_tx/helpers.py @@ -412,6 +412,9 @@ def sanitize_tx_input(txi: TxInput, coin: CoinInfo) -> TxInput: if not coin.segwit: raise wire.DataError("Segwit not enabled on this coin.") + if txi.script_type == InputScriptType.SPENDTAPROOT and not coin.taproot: + raise wire.DataError("Taproot not enabled on this coin") + if txi.commitment_data and not txi.ownership_proof: raise wire.DataError("commitment_data field provided but not expected.") @@ -448,6 +451,9 @@ def sanitize_tx_output(txo: TxOutput, coin: CoinInfo) -> TxOutput: if not coin.segwit: raise wire.DataError("Segwit not enabled on this coin.") + if txo.script_type == OutputScriptType.PAYTOTAPROOT and not coin.taproot: + raise wire.DataError("Taproot not enabled on this coin") + if txo.script_type == OutputScriptType.PAYTOOPRETURN: # op_return output if txo.op_return_data is None: