From e796a1abb52b26b7c33c055fcb11628729c014c6 Mon Sep 17 00:00:00 2001 From: Sarah GLINER Date: Wed, 20 Mar 2024 10:52:20 +0100 Subject: [PATCH] wip --- Makefile | 78 ++++------ core/Makefile | 146 ++++++++++++++++++ .../bitcoin_common}/includes/be_operations.h | 0 .../bitcoin_common}/includes/cashaddr.h | 0 .../bitcoin_common}/includes/common_crypto.h | 0 .../bitcoin_common}/includes/display_utils.h | 0 .../bitcoin_common}/includes/segwit_addr.h | 0 .../includes/sign_message_helpers.h | 0 .../bitcoin_common}/src/be_operations.c | 0 .../bitcoin_common}/src/cashaddr.c | 0 .../bitcoin_common}/src/common_crypto.c | 0 .../bitcoin_common}/src/display_utils.c | 0 .../bitcoin_common}/src/segwit_addr.c | 0 .../src/sign_message_helpers.c | 0 {include => core/include}/btchip.h | 0 .../include}/btchip_apdu_constants.h | 0 {include => core/include}/btchip_config.h | 0 {include => core/include}/btchip_context.h | 0 {include => core/include}/btchip_filesystem.h | 0 .../include}/btchip_filesystem_tx.h | 0 {include => core/include}/btchip_helpers.h | 0 {include => core/include}/swap_lib_calls.h | 0 {src => core/src}/apdu/dispatcher.c | 0 {src => core/src}/apdu/dispatcher.h | 0 {src => core/src}/btchip.c | 0 {src => core/src}/btchip_apdu.h | 0 .../src}/btchip_apdu_get_coin_version.c | 0 .../src}/btchip_apdu_get_firmware_version.c | 0 .../src}/btchip_apdu_get_trusted_input.c | 0 .../src}/btchip_apdu_get_wallet_public_key.c | 0 .../btchip_apdu_hash_input_finalize_full.c | 0 .../src}/btchip_apdu_hash_input_start.c | 0 {src => core/src}/btchip_apdu_hash_sign.c | 0 {src => core/src}/btchip_apdu_sign_message.c | 0 {src => core/src}/btchip_context.c | 0 {src => core/src}/btchip_helpers.c | 0 {src => core/src}/btchip_internal.h | 0 {src => core/src}/btchip_transaction.c | 0 {src => core/src}/btchip_transaction.h | 0 {src => core/src}/swap/handle_check_address.c | 0 {src => core/src}/swap/handle_check_address.h | 0 .../src}/swap/handle_get_printable_amount.c | 0 .../src}/swap/handle_get_printable_amount.h | 0 .../src}/swap/handle_swap_sign_transaction.c | 0 .../src}/swap/handle_swap_sign_transaction.h | 0 {src => core/src}/ui/btchip_bagl_extensions.h | 0 .../src}/ui/btchip_display_variables.c | 0 .../src}/ui/btchip_display_variables.h | 0 {src => core/src}/ui/main_ui.c | 0 {src => core/src}/ui/ui.h | 0 {src => core/src}/ui/ui_bagl.c | 0 {src => core/src}/ui/ui_menu_nbgl.c | 0 {src => core/src}/ui/ui_nbgl.c | 0 53 files changed, 173 insertions(+), 51 deletions(-) create mode 100644 core/Makefile rename {bitcoin_common => core/bitcoin_common}/includes/be_operations.h (100%) rename {bitcoin_common => core/bitcoin_common}/includes/cashaddr.h (100%) rename {bitcoin_common => core/bitcoin_common}/includes/common_crypto.h (100%) rename {bitcoin_common => core/bitcoin_common}/includes/display_utils.h (100%) rename {bitcoin_common => core/bitcoin_common}/includes/segwit_addr.h (100%) rename {bitcoin_common => core/bitcoin_common}/includes/sign_message_helpers.h (100%) rename {bitcoin_common => core/bitcoin_common}/src/be_operations.c (100%) rename {bitcoin_common => core/bitcoin_common}/src/cashaddr.c (100%) rename {bitcoin_common => core/bitcoin_common}/src/common_crypto.c (100%) rename {bitcoin_common => core/bitcoin_common}/src/display_utils.c (100%) rename {bitcoin_common => core/bitcoin_common}/src/segwit_addr.c (100%) rename {bitcoin_common => core/bitcoin_common}/src/sign_message_helpers.c (100%) rename {include => core/include}/btchip.h (100%) rename {include => core/include}/btchip_apdu_constants.h (100%) rename {include => core/include}/btchip_config.h (100%) rename {include => core/include}/btchip_context.h (100%) rename {include => core/include}/btchip_filesystem.h (100%) rename {include => core/include}/btchip_filesystem_tx.h (100%) rename {include => core/include}/btchip_helpers.h (100%) rename {include => core/include}/swap_lib_calls.h (100%) rename {src => core/src}/apdu/dispatcher.c (100%) rename {src => core/src}/apdu/dispatcher.h (100%) rename {src => core/src}/btchip.c (100%) rename {src => core/src}/btchip_apdu.h (100%) rename {src => core/src}/btchip_apdu_get_coin_version.c (100%) rename {src => core/src}/btchip_apdu_get_firmware_version.c (100%) rename {src => core/src}/btchip_apdu_get_trusted_input.c (100%) rename {src => core/src}/btchip_apdu_get_wallet_public_key.c (100%) rename {src => core/src}/btchip_apdu_hash_input_finalize_full.c (100%) rename {src => core/src}/btchip_apdu_hash_input_start.c (100%) rename {src => core/src}/btchip_apdu_hash_sign.c (100%) rename {src => core/src}/btchip_apdu_sign_message.c (100%) rename {src => core/src}/btchip_context.c (100%) rename {src => core/src}/btchip_helpers.c (100%) rename {src => core/src}/btchip_internal.h (100%) rename {src => core/src}/btchip_transaction.c (100%) rename {src => core/src}/btchip_transaction.h (100%) rename {src => core/src}/swap/handle_check_address.c (100%) rename {src => core/src}/swap/handle_check_address.h (100%) rename {src => core/src}/swap/handle_get_printable_amount.c (100%) rename {src => core/src}/swap/handle_get_printable_amount.h (100%) rename {src => core/src}/swap/handle_swap_sign_transaction.c (100%) rename {src => core/src}/swap/handle_swap_sign_transaction.h (100%) rename {src => core/src}/ui/btchip_bagl_extensions.h (100%) rename {src => core/src}/ui/btchip_display_variables.c (100%) rename {src => core/src}/ui/btchip_display_variables.h (100%) rename {src => core/src}/ui/main_ui.c (100%) rename {src => core/src}/ui/ui.h (100%) rename {src => core/src}/ui/ui_bagl.c (100%) rename {src => core/src}/ui/ui_menu_nbgl.c (100%) rename {src => core/src}/ui/ui_nbgl.c (100%) diff --git a/Makefile b/Makefile index db74830a..a2063246 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,7 @@ # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# +# You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software @@ -15,57 +14,17 @@ # limitations under the License. # **************************************************************************** -ifeq ($(BOLOS_SDK),) -$(error Environment variable BOLOS_SDK is not set) -endif -include $(BOLOS_SDK)/Makefile.defines - ######################################## # Mandatory configuration # ######################################## -# Name is defined later # Application version APPVERSION_M = 2 APPVERSION_N = 1 APPVERSION_P = 7 -APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)" - -# Application source files -APP_SOURCE_PATH += src -APP_SOURCE_PATH += bitcoin_common - -ICON_NANOS = icons/nanos_app_$(COIN).gif -ICON_NANOX = icons/nanox_app_$(COIN).gif -ICON_NANOSP = icons/nanox_app_$(COIN).gif -ICON_STAX = icons/stax_app_$(COIN).gif - -# Application allowed derivation curves. -CURVE_APP_LOAD_PARAMS = secp256k1 - -# Application allowed derivation paths. -ifeq ($(COIN),$(filter $(COIN), hydra_testnet hydra)) -PATH_APP_LOAD_PARAMS = "44'/609'" -else -PATH_APP_LOAD_PARAMS = "" -endif - -HAVE_APPLICATION_FLAG_DERIVE_MASTER = 1 -HAVE_APPLICATION_FLAG_LIBRARY = 1 - -VARIANT_PARAM = COIN VARIANT_VALUES = bitcoin_testnet_legacy bitcoin_legacy -ENABLE_BLUETOOTH = 1 -ENABLE_NBGL_QRCODE = 1 -ENABLE_SWAP = 1 - -ifeq ($(TARGET_NAME),TARGET_STAX) -DEFINES += COIN_ICON=C_$(COIN)_64px -DEFINES += COIN_ICON_BITMAP=C_$(COIN)_64px_bitmap -endif - # simplify for tests ifndef COIN COIN=bitcoin_legacy @@ -75,17 +34,34 @@ endif #DEBUG = 1 ifeq ($(COIN),bitcoin_testnet_legacy) -# Bitcoin testnet -DEFINES += BIP44_COIN_TYPE=1 BIP44_COIN_TYPE_2=1 COIN_P2PKH_VERSION=111 COIN_P2SH_VERSION=196 COIN_FAMILY=1 COIN_COINID=\"Bitcoin\" COIN_COINID_HEADER=\"BITCOIN\" COIN_COINID_NAME=\"Bitcoin\" COIN_COINID_SHORT=\"TEST\" COIN_NATIVE_SEGWIT_PREFIX=\"tb\" COIN_KIND=COIN_KIND_BITCOIN_TESTNET COIN_FLAGS=FLAG_SEGWIT_CHANGE_SUPPORT +BIP44_COIN_TYPE=1 +BIP44_COIN_TYPE_2=1 +COIN_P2PKH_VERSION=111 +COIN_P2SH_VERSION=196 +COIN_FAMILY=1 +COIN_COINID=\"Bitcoin\" +COIN_COINID_HEADER=\"BITCOIN\" +COIN_COINID_NAME=\"Bitcoin\" +COIN_COINID_SHORT=\"TEST\" +COIN_NATIVE_SEGWIT_PREFIX=\"tb\" +COIN_KIND=COIN_KIND_BITCOIN_TESTNET +COIN_FLAGS=FLAG_SEGWIT_CHANGE_SUPPORT APPNAME ="Bitcoin Test Legacy" + else ifeq ($(COIN),bitcoin_legacy) -# Bitcoin mainnet -DEFINES += BIP44_COIN_TYPE=0 BIP44_COIN_TYPE_2=0 COIN_P2PKH_VERSION=0 COIN_P2SH_VERSION=5 COIN_FAMILY=1 COIN_COINID=\"Bitcoin\" COIN_COINID_HEADER=\"BITCOIN\" COIN_COINID_NAME=\"Bitcoin\" COIN_COINID_SHORT=\"BTC\" COIN_NATIVE_SEGWIT_PREFIX=\"bc\" COIN_KIND=COIN_KIND_BITCOIN COIN_FLAGS=FLAG_SEGWIT_CHANGE_SUPPORT +BIP44_COIN_TYPE=0 +BIP44_COIN_TYPE_2=0 +COIN_P2PKH_VERSION=0 +COIN_P2SH_VERSION=5 +COIN_FAMILY=1 +COIN_COINID=\"Bitcoin\" +COIN_COINID_HEADER=\"BITCOIN\" +COIN_COINID_NAME=\"Bitcoin\" +COIN_COINID_SHORT=\"BTC\" +COIN_NATIVE_SEGWIT_PREFIX=\"bc\" +COIN_KIND=COIN_KIND_BITCOIN +COIN_FLAGS=FLAG_SEGWIT_CHANGE_SUPPORT APPNAME ="Bitcoin Legacy" -else -ifeq ($(filter clean,$(MAKECMDGOALS)),) -$(error Unsupported COIN - use bitcoin_testnet, bitcoin) -endif endif -include $(BOLOS_SDK)/Makefile.standard_app +include core/Makefile diff --git a/core/Makefile b/core/Makefile new file mode 100644 index 00000000..22dd34e6 --- /dev/null +++ b/core/Makefile @@ -0,0 +1,146 @@ +# **************************************************************************** +# Ledger App Bitcoin +# (c) 2023 Ledger SAS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# **************************************************************************** + +ifeq ($(BOLOS_SDK),) +$(error Environment variable BOLOS_SDK is not set) +endif +include $(BOLOS_SDK)/Makefile.defines + +######################################## +# Mandatory configuration # +######################################## +# Name is defined later + +ifeq ($(APPVERSION_M),) +$(error APPVERSION_M must be defined) +endif +ifeq ($(APPVERSION_N),) +$(error APPVERSION_N must be defined) +endif +ifeq ($(APPVERSION_P),) +$(error APPVERSION_P must be defined) +endif + +APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)" + +# Application source files +APP_SOURCE_PATH += core/src/ +APP_SOURCE_PATH += core/include/ +APP_SOURCE_PATH += core/bitcoin_common/ + +ICON_NANOS = icons/nanos_app_$(COIN).gif +ICON_NANOX = icons/nanox_app_$(COIN).gif +ICON_NANOSP = icons/nanox_app_$(COIN).gif +ICON_STAX = icons/stax_app_$(COIN).gif + +ifeq ($(TARGET_NAME),TARGET_STAX) +DEFINES += COIN_ICON=C_$(COIN)_64px +DEFINES += COIN_ICON_BITMAP=C_$(COIN)_64px_bitmap +endif + +# Application allowed derivation curves. +CURVE_APP_LOAD_PARAMS = secp256k1 + +# Application allowed derivation paths. +PATH_APP_LOAD_PARAMS = "" + +HAVE_APPLICATION_FLAG_DERIVE_MASTER = 1 +HAVE_APPLICATION_FLAG_LIBRARY = 1 + +VARIANT_PARAM = COIN + +ENABLE_BLUETOOTH = 1 +ENABLE_NBGL_QRCODE = 1 +ENABLE_SWAP = 1 + +ifeq ($(TARGET_NAME),TARGET_STAX) +DEFINES += COIN_ICON=C_$(COIN)_64px +DEFINES += COIN_ICON_BITMAP=C_$(COIN)_64px_bitmap +endif + +ifndef BIP44_COIN_TYPE +$(error BIP44_COIN_TYPE must be defined) +endif + +ifndef BIP44_COIN_TYPE_2 +$(error BIP44_COIN_TYPE_2 must be defined) +endif + +ifndef COIN_P2PKH_VERSION +$(error COIN_P2PKH_VERSION must be defined) +endif + +ifndef COIN_P2SH_VERSION +$(error COIN_P2SH_VERSION must be defined) +endif + +ifndef COIN_FAMILY +$(error COIN_FAMILY must be defined) +endif + +ifndef COIN_COINID +$(error COIN_COINID must be defined) +endif + +ifndef COIN_COINID_HEADER +$(error COIN_COINID_HEADER must be defined) +endif + +ifndef COIN_COINID_NAME +$(error COIN_COINID_NAME must be defined) +endif + +ifndef COIN_COINID_SHORT +$(error COIN_COINID_SHORT must be defined) +endif + +ifndef COIN_NATIVE_SEGWIT_PREFIX +$(error COIN_NATIVE_SEGWIT_PREFIX must be defined) +endif + +ifndef COIN_KIND +$(error COIN_KIND must be defined) +endif + +ifndef COIN_FLAGS +$(error COIN_FLAGS must be defined) +endif + +ifndef COIN_FORKID +$(info COIN_FORKID set to 0) +COIN_FORKID=0 +endif + +ifeq ($(APPNAME),) +$(error APPNAME must be defined) +endif + +DEFINES +=BIP44_COIN_TYPE=$(BIP44_COIN_TYPE) +DEFINES +=BIP44_COIN_TYPE_2=$(BIP44_COIN_TYPE_2) +DEFINES +=COIN_P2PKH_VERSION=$(COIN_P2PKH_VERSION) +DEFINES +=COIN_P2SH_VERSION=$(COIN_P2SH_VERSION) +DEFINES +=COIN_FAMILY=$(COIN_FAMILY) +DEFINES +=COIN_COINID=$(COIN_COINID) +DEFINES +=COIN_COINID_HEADER=$(COIN_COINID_HEADER) +DEFINES +=COIN_COINID_NAME=$(COIN_COINID_NAME) +DEFINES +=COIN_COINID_SHORT=$(COIN_COINID_SHORT) +DEFINES +=COIN_NATIVE_SEGWIT_PREFIX=$(COIN_NATIVE_SEGWIT_PREFIX) +DEFINES +=COIN_KIND=$(COIN_KIND) +DEFINES +=COIN_FLAGS=$(COIN_FLAGS) +DEFINES +=COIN_FORKID=$(COIN_FORKID) + +include $(BOLOS_SDK)/Makefile.standard_app diff --git a/bitcoin_common/includes/be_operations.h b/core/bitcoin_common/includes/be_operations.h similarity index 100% rename from bitcoin_common/includes/be_operations.h rename to core/bitcoin_common/includes/be_operations.h diff --git a/bitcoin_common/includes/cashaddr.h b/core/bitcoin_common/includes/cashaddr.h similarity index 100% rename from bitcoin_common/includes/cashaddr.h rename to core/bitcoin_common/includes/cashaddr.h diff --git a/bitcoin_common/includes/common_crypto.h b/core/bitcoin_common/includes/common_crypto.h similarity index 100% rename from bitcoin_common/includes/common_crypto.h rename to core/bitcoin_common/includes/common_crypto.h diff --git a/bitcoin_common/includes/display_utils.h b/core/bitcoin_common/includes/display_utils.h similarity index 100% rename from bitcoin_common/includes/display_utils.h rename to core/bitcoin_common/includes/display_utils.h diff --git a/bitcoin_common/includes/segwit_addr.h b/core/bitcoin_common/includes/segwit_addr.h similarity index 100% rename from bitcoin_common/includes/segwit_addr.h rename to core/bitcoin_common/includes/segwit_addr.h diff --git a/bitcoin_common/includes/sign_message_helpers.h b/core/bitcoin_common/includes/sign_message_helpers.h similarity index 100% rename from bitcoin_common/includes/sign_message_helpers.h rename to core/bitcoin_common/includes/sign_message_helpers.h diff --git a/bitcoin_common/src/be_operations.c b/core/bitcoin_common/src/be_operations.c similarity index 100% rename from bitcoin_common/src/be_operations.c rename to core/bitcoin_common/src/be_operations.c diff --git a/bitcoin_common/src/cashaddr.c b/core/bitcoin_common/src/cashaddr.c similarity index 100% rename from bitcoin_common/src/cashaddr.c rename to core/bitcoin_common/src/cashaddr.c diff --git a/bitcoin_common/src/common_crypto.c b/core/bitcoin_common/src/common_crypto.c similarity index 100% rename from bitcoin_common/src/common_crypto.c rename to core/bitcoin_common/src/common_crypto.c diff --git a/bitcoin_common/src/display_utils.c b/core/bitcoin_common/src/display_utils.c similarity index 100% rename from bitcoin_common/src/display_utils.c rename to core/bitcoin_common/src/display_utils.c diff --git a/bitcoin_common/src/segwit_addr.c b/core/bitcoin_common/src/segwit_addr.c similarity index 100% rename from bitcoin_common/src/segwit_addr.c rename to core/bitcoin_common/src/segwit_addr.c diff --git a/bitcoin_common/src/sign_message_helpers.c b/core/bitcoin_common/src/sign_message_helpers.c similarity index 100% rename from bitcoin_common/src/sign_message_helpers.c rename to core/bitcoin_common/src/sign_message_helpers.c diff --git a/include/btchip.h b/core/include/btchip.h similarity index 100% rename from include/btchip.h rename to core/include/btchip.h diff --git a/include/btchip_apdu_constants.h b/core/include/btchip_apdu_constants.h similarity index 100% rename from include/btchip_apdu_constants.h rename to core/include/btchip_apdu_constants.h diff --git a/include/btchip_config.h b/core/include/btchip_config.h similarity index 100% rename from include/btchip_config.h rename to core/include/btchip_config.h diff --git a/include/btchip_context.h b/core/include/btchip_context.h similarity index 100% rename from include/btchip_context.h rename to core/include/btchip_context.h diff --git a/include/btchip_filesystem.h b/core/include/btchip_filesystem.h similarity index 100% rename from include/btchip_filesystem.h rename to core/include/btchip_filesystem.h diff --git a/include/btchip_filesystem_tx.h b/core/include/btchip_filesystem_tx.h similarity index 100% rename from include/btchip_filesystem_tx.h rename to core/include/btchip_filesystem_tx.h diff --git a/include/btchip_helpers.h b/core/include/btchip_helpers.h similarity index 100% rename from include/btchip_helpers.h rename to core/include/btchip_helpers.h diff --git a/include/swap_lib_calls.h b/core/include/swap_lib_calls.h similarity index 100% rename from include/swap_lib_calls.h rename to core/include/swap_lib_calls.h diff --git a/src/apdu/dispatcher.c b/core/src/apdu/dispatcher.c similarity index 100% rename from src/apdu/dispatcher.c rename to core/src/apdu/dispatcher.c diff --git a/src/apdu/dispatcher.h b/core/src/apdu/dispatcher.h similarity index 100% rename from src/apdu/dispatcher.h rename to core/src/apdu/dispatcher.h diff --git a/src/btchip.c b/core/src/btchip.c similarity index 100% rename from src/btchip.c rename to core/src/btchip.c diff --git a/src/btchip_apdu.h b/core/src/btchip_apdu.h similarity index 100% rename from src/btchip_apdu.h rename to core/src/btchip_apdu.h diff --git a/src/btchip_apdu_get_coin_version.c b/core/src/btchip_apdu_get_coin_version.c similarity index 100% rename from src/btchip_apdu_get_coin_version.c rename to core/src/btchip_apdu_get_coin_version.c diff --git a/src/btchip_apdu_get_firmware_version.c b/core/src/btchip_apdu_get_firmware_version.c similarity index 100% rename from src/btchip_apdu_get_firmware_version.c rename to core/src/btchip_apdu_get_firmware_version.c diff --git a/src/btchip_apdu_get_trusted_input.c b/core/src/btchip_apdu_get_trusted_input.c similarity index 100% rename from src/btchip_apdu_get_trusted_input.c rename to core/src/btchip_apdu_get_trusted_input.c diff --git a/src/btchip_apdu_get_wallet_public_key.c b/core/src/btchip_apdu_get_wallet_public_key.c similarity index 100% rename from src/btchip_apdu_get_wallet_public_key.c rename to core/src/btchip_apdu_get_wallet_public_key.c diff --git a/src/btchip_apdu_hash_input_finalize_full.c b/core/src/btchip_apdu_hash_input_finalize_full.c similarity index 100% rename from src/btchip_apdu_hash_input_finalize_full.c rename to core/src/btchip_apdu_hash_input_finalize_full.c diff --git a/src/btchip_apdu_hash_input_start.c b/core/src/btchip_apdu_hash_input_start.c similarity index 100% rename from src/btchip_apdu_hash_input_start.c rename to core/src/btchip_apdu_hash_input_start.c diff --git a/src/btchip_apdu_hash_sign.c b/core/src/btchip_apdu_hash_sign.c similarity index 100% rename from src/btchip_apdu_hash_sign.c rename to core/src/btchip_apdu_hash_sign.c diff --git a/src/btchip_apdu_sign_message.c b/core/src/btchip_apdu_sign_message.c similarity index 100% rename from src/btchip_apdu_sign_message.c rename to core/src/btchip_apdu_sign_message.c diff --git a/src/btchip_context.c b/core/src/btchip_context.c similarity index 100% rename from src/btchip_context.c rename to core/src/btchip_context.c diff --git a/src/btchip_helpers.c b/core/src/btchip_helpers.c similarity index 100% rename from src/btchip_helpers.c rename to core/src/btchip_helpers.c diff --git a/src/btchip_internal.h b/core/src/btchip_internal.h similarity index 100% rename from src/btchip_internal.h rename to core/src/btchip_internal.h diff --git a/src/btchip_transaction.c b/core/src/btchip_transaction.c similarity index 100% rename from src/btchip_transaction.c rename to core/src/btchip_transaction.c diff --git a/src/btchip_transaction.h b/core/src/btchip_transaction.h similarity index 100% rename from src/btchip_transaction.h rename to core/src/btchip_transaction.h diff --git a/src/swap/handle_check_address.c b/core/src/swap/handle_check_address.c similarity index 100% rename from src/swap/handle_check_address.c rename to core/src/swap/handle_check_address.c diff --git a/src/swap/handle_check_address.h b/core/src/swap/handle_check_address.h similarity index 100% rename from src/swap/handle_check_address.h rename to core/src/swap/handle_check_address.h diff --git a/src/swap/handle_get_printable_amount.c b/core/src/swap/handle_get_printable_amount.c similarity index 100% rename from src/swap/handle_get_printable_amount.c rename to core/src/swap/handle_get_printable_amount.c diff --git a/src/swap/handle_get_printable_amount.h b/core/src/swap/handle_get_printable_amount.h similarity index 100% rename from src/swap/handle_get_printable_amount.h rename to core/src/swap/handle_get_printable_amount.h diff --git a/src/swap/handle_swap_sign_transaction.c b/core/src/swap/handle_swap_sign_transaction.c similarity index 100% rename from src/swap/handle_swap_sign_transaction.c rename to core/src/swap/handle_swap_sign_transaction.c diff --git a/src/swap/handle_swap_sign_transaction.h b/core/src/swap/handle_swap_sign_transaction.h similarity index 100% rename from src/swap/handle_swap_sign_transaction.h rename to core/src/swap/handle_swap_sign_transaction.h diff --git a/src/ui/btchip_bagl_extensions.h b/core/src/ui/btchip_bagl_extensions.h similarity index 100% rename from src/ui/btchip_bagl_extensions.h rename to core/src/ui/btchip_bagl_extensions.h diff --git a/src/ui/btchip_display_variables.c b/core/src/ui/btchip_display_variables.c similarity index 100% rename from src/ui/btchip_display_variables.c rename to core/src/ui/btchip_display_variables.c diff --git a/src/ui/btchip_display_variables.h b/core/src/ui/btchip_display_variables.h similarity index 100% rename from src/ui/btchip_display_variables.h rename to core/src/ui/btchip_display_variables.h diff --git a/src/ui/main_ui.c b/core/src/ui/main_ui.c similarity index 100% rename from src/ui/main_ui.c rename to core/src/ui/main_ui.c diff --git a/src/ui/ui.h b/core/src/ui/ui.h similarity index 100% rename from src/ui/ui.h rename to core/src/ui/ui.h diff --git a/src/ui/ui_bagl.c b/core/src/ui/ui_bagl.c similarity index 100% rename from src/ui/ui_bagl.c rename to core/src/ui/ui_bagl.c diff --git a/src/ui/ui_menu_nbgl.c b/core/src/ui/ui_menu_nbgl.c similarity index 100% rename from src/ui/ui_menu_nbgl.c rename to core/src/ui/ui_menu_nbgl.c diff --git a/src/ui/ui_nbgl.c b/core/src/ui/ui_nbgl.c similarity index 100% rename from src/ui/ui_nbgl.c rename to core/src/ui/ui_nbgl.c