From 07ef01f3e498449d7f32dc5df898897ed877d60b Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 22 Aug 2019 20:15:16 +0200 Subject: [PATCH 1/6] core: introduce BITCOIN_ONLY flag --- core/Makefile | 7 +- core/SConscript.firmware | 9 +- core/SConscript.unix | 7 +- .../modtrezorcrypto/modtrezorcrypto-bip32.h | 24 +- .../modtrezorcrypto/modtrezorcrypto-ed25519.h | 6 + .../extmod/modtrezorcrypto/modtrezorcrypto.c | 14 +- .../extmod/modtrezorutils/modtrezorutils.c | 5 + core/src/apps/common/coininfo.py | 3224 +++++++++-------- core/src/apps/common/coininfo.py.mako | 20 +- core/src/main.py | 49 +- core/src/trezor/crypto/__init__.py | 6 +- core/src/trezor/crypto/curve.py | 12 +- core/src/trezor/utils.py | 1 + 13 files changed, 1727 insertions(+), 1657 deletions(-) diff --git a/core/Makefile b/core/Makefile index e95a271c88..ace78c0a36 100644 --- a/core/Makefile +++ b/core/Makefile @@ -18,6 +18,7 @@ CROSS_PORT_OPTS ?= PRODUCTION ?= 0 PYOPT ?= 1 +BITCOIN_ONLY ?= 0 STLINK_VER ?= v2 OPENOCD = openocd -f interface/stlink-$(STLINK_VER).cfg -c "transport select hla_swd" -f target/stm32f4x.cfg @@ -105,13 +106,13 @@ build_reflash: ## build reflash firmware + reflash image dd if=build/bootloader/bootloader.bin of=$(REFLASH_BUILD_DIR)/sdimage.bin bs=1 seek=49152 build_firmware: res build_cross ## build firmware with frozen modules - $(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" $(FIRMWARE_BUILD_DIR)/firmware.bin + $(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" BITCOIN_ONLY="$(BITCOIN_ONLY)" $(FIRMWARE_BUILD_DIR)/firmware.bin build_unix: res ## build unix port - $(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/micropython $(UNIX_PORT_OPTS) + $(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/micropython $(UNIX_PORT_OPTS) BITCOIN_ONLY="$(BITCOIN_ONLY)" build_unix_frozen: res build_cross ## build unix port with frozen modules - $(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/micropython $(UNIX_PORT_OPTS) PYOPT="$(PYOPT)" TREZOR_EMULATOR_FROZEN=1 + $(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/micropython $(UNIX_PORT_OPTS) PYOPT="$(PYOPT)" BITCOIN_ONLY="$(BITCOIN_ONLY)" TREZOR_EMULATOR_FROZEN=1 build_cross: ## build mpy-cross port $(MAKE) -C vendor/micropython/mpy-cross $(CROSS_PORT_OPTS) diff --git a/core/SConscript.firmware b/core/SConscript.firmware index fb7c50e197..23a391b72d 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -2,7 +2,8 @@ import os -EVERYTHING = True +BITCOIN_ONLY = ARGUMENTS.get('BITCOIN_ONLY', '0') +EVERYTHING = BITCOIN_ONLY != '1' CCFLAGS_MOD = '' CPPPATH_MOD = [] @@ -326,7 +327,7 @@ SOURCE_TREZORHAL = [ SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_MICROPYTHON_SPEED -env = Environment(ENV=os.environ, CFLAGS='%s -DPRODUCTION=%s -DPYOPT=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0'), PYOPT)) +env = Environment(ENV=os.environ, CFLAGS='%s -DPRODUCTION=%s -DPYOPT=%s -DBITCOIN_ONLY=%s' % (ARGUMENTS.get('CFLAGS', ''), ARGUMENTS.get('PRODUCTION', '0'), PYOPT, BITCOIN_ONLY)) env.Tool('micropython') @@ -365,7 +366,7 @@ env.Replace( '-fstack-protector-all ' + CPU_CCFLAGS + CCFLAGS_MOD, CCFLAGS_QSTR='-DNO_QSTR -DN_X64 -DN_X86 -DN_THUMB', - LINKFLAGS='-T embed/firmware/memory_${TREZOR_MODEL}.ld -Wl,--gc-sections -Wl,-Map=build/firmware/firmware.map -Wl,--warn-common', + LINKFLAGS='-T embed/firmware/memory_${TREZOR_MODEL}%s.ld -Wl,--gc-sections -Wl,-Map=build/firmware/firmware.map -Wl,--warn-common' % ('' if EVERYTHING else '_min'), CPPPATH=[ '.', 'embed/firmware', @@ -504,7 +505,7 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/webauthn/*.py')) - source_mpy = env.FrozenModule(source=SOURCE_PY, source_dir=SOURCE_PY_DIR) + source_mpy = env.FrozenModule(source=SOURCE_PY, source_dir=SOURCE_PY_DIR, bitcoin_only=BITCOIN_ONLY) source_mpyc = env.FrozenCFile( target='frozen_mpy.c', source=source_mpy, qstr_header=qstr_preprocessed) diff --git a/core/SConscript.unix b/core/SConscript.unix index a59a05236c..87f352c05a 100644 --- a/core/SConscript.unix +++ b/core/SConscript.unix @@ -2,7 +2,8 @@ import os -EVERYTHING = True +BITCOIN_ONLY = ARGUMENTS.get('BITCOIN_ONLY', '0') +EVERYTHING = BITCOIN_ONLY != '1' CCFLAGS_MOD = '' CPPPATH_MOD = [] @@ -299,7 +300,7 @@ SOURCE_UNIX = [ SOURCE_QSTR = SOURCE_MOD + SOURCE_MICROPYTHON + SOURCE_UNIX -env = Environment(ENV=os.environ, CFLAGS='%s -DPYOPT=%s' % (ARGUMENTS.get('CFLAGS', ''), PYOPT)) +env = Environment(ENV=os.environ, CFLAGS='%s -DPYOPT=%s -DBITCOIN_ONLY=%s' % (ARGUMENTS.get('CFLAGS', ''), PYOPT, BITCOIN_ONLY)) env.Tool('micropython') @@ -467,7 +468,7 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/webauthn/*.py')) - source_mpy = env.FrozenModule(source=SOURCE_PY, source_dir=SOURCE_PY_DIR) + source_mpy = env.FrozenModule(source=SOURCE_PY, source_dir=SOURCE_PY_DIR, bitcoin_only=BITCOIN_ONLY) source_mpyc = env.FrozenCFile( target='frozen_mpy.c', source=source_mpy, qstr_header=qstr_preprocessed) diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h index c2c1de1430..a33513f541 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-bip32.h @@ -25,7 +25,9 @@ #include "bip39.h" #include "curves.h" #include "memzero.h" +#if !BITCOIN_ONLY #include "nem.h" +#endif /// package: trezorcrypto.bip32 @@ -184,6 +186,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_trezorcrypto_HDNode_derive_obj, 2, 3, mod_trezorcrypto_HDNode_derive); +#if !BITCOIN_ONLY + /// def derive_cardano(self, index: int) -> None: /// """ /// Derive a BIP0032 child node in place using Cardano algorithm. @@ -217,6 +221,8 @@ STATIC mp_obj_t mod_trezorcrypto_HDNode_derive_cardano(mp_obj_t self, STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_trezorcrypto_HDNode_derive_cardano_obj, mod_trezorcrypto_HDNode_derive_cardano); +#endif + /// def derive_path(self, path: List[int]) -> None: /// """ /// Go through a list of indexes and iteratively derive a child node in @@ -409,6 +415,8 @@ STATIC mp_obj_t mod_trezorcrypto_HDNode_address(mp_obj_t self, STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_trezorcrypto_HDNode_address_obj, mod_trezorcrypto_HDNode_address); +#if !BITCOIN_ONLY + /// def nem_address(self, network: int) -> str: /// """ /// Compute a NEM address string from the HD node. @@ -489,6 +497,8 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1( mod_trezorcrypto_HDNode_ethereum_pubkeyhash_obj, mod_trezorcrypto_HDNode_ethereum_pubkeyhash); +#endif + /// def __del__(self) -> None: /// """ /// Cleans up sensitive memory. @@ -507,15 +517,16 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_HDNode_locals_dict_table[] = { MP_ROM_PTR(&mod_trezorcrypto_HDNode___del___obj)}, {MP_ROM_QSTR(MP_QSTR_derive), MP_ROM_PTR(&mod_trezorcrypto_HDNode_derive_obj)}, +#if !BITCOIN_ONLY {MP_ROM_QSTR(MP_QSTR_derive_cardano), MP_ROM_PTR(&mod_trezorcrypto_HDNode_derive_cardano_obj)}, +#endif {MP_ROM_QSTR(MP_QSTR_derive_path), MP_ROM_PTR(&mod_trezorcrypto_HDNode_derive_path_obj)}, {MP_ROM_QSTR(MP_QSTR_serialize_private), MP_ROM_PTR(&mod_trezorcrypto_HDNode_serialize_private_obj)}, {MP_ROM_QSTR(MP_QSTR_serialize_public), MP_ROM_PTR(&mod_trezorcrypto_HDNode_serialize_public_obj)}, - {MP_ROM_QSTR(MP_QSTR_clone), MP_ROM_PTR(&mod_trezorcrypto_HDNode_clone_obj)}, {MP_ROM_QSTR(MP_QSTR_depth), @@ -534,12 +545,14 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_HDNode_locals_dict_table[] = { MP_ROM_PTR(&mod_trezorcrypto_HDNode_public_key_obj)}, {MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&mod_trezorcrypto_HDNode_address_obj)}, +#if !BITCOIN_ONLY {MP_ROM_QSTR(MP_QSTR_nem_address), MP_ROM_PTR(&mod_trezorcrypto_HDNode_nem_address_obj)}, {MP_ROM_QSTR(MP_QSTR_nem_encrypt), MP_ROM_PTR(&mod_trezorcrypto_HDNode_nem_encrypt_obj)}, {MP_ROM_QSTR(MP_QSTR_ethereum_pubkeyhash), MP_ROM_PTR(&mod_trezorcrypto_HDNode_ethereum_pubkeyhash_obj)}, +#endif }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_HDNode_locals_dict, mod_trezorcrypto_HDNode_locals_dict_table); @@ -606,8 +619,10 @@ STATIC mp_obj_t mod_trezorcrypto_bip32_from_seed(mp_obj_t seed, int res = 0; if (strcmp(curveb.buf, ED25519_CARDANO_NAME) != 0) { res = hdnode_from_seed(seedb.buf, seedb.len, curveb.buf, &hdnode); +#if !BITCOIN_ONLY } else { res = hdnode_from_seed_cardano(seedb.buf, seedb.len, &hdnode); +#endif } if (!res) { @@ -623,6 +638,8 @@ STATIC mp_obj_t mod_trezorcrypto_bip32_from_seed(mp_obj_t seed, STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_trezorcrypto_bip32_from_seed_obj, mod_trezorcrypto_bip32_from_seed); +#if !BITCOIN_ONLY + /// def from_mnemonic_cardano(mnemonic: str, passphrase: str) -> bytes: /// """ /// Construct a HD node from a BIP-0039 mnemonic using the Icarus derivation @@ -661,11 +678,12 @@ STATIC mp_obj_t mod_trezorcrypto_bip32_from_mnemonic_cardano( o->fingerprint = 0; return MP_OBJ_FROM_PTR(o); } - STATIC MP_DEFINE_CONST_FUN_OBJ_2( mod_trezorcrypto_bip32_from_mnemonic_cardano_obj, mod_trezorcrypto_bip32_from_mnemonic_cardano); +#endif + STATIC const mp_rom_map_elem_t mod_trezorcrypto_bip32_globals_table[] = { {MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_bip32)}, {MP_ROM_QSTR(MP_QSTR_HDNode), MP_ROM_PTR(&mod_trezorcrypto_HDNode_type)}, @@ -673,8 +691,10 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_bip32_globals_table[] = { MP_ROM_PTR(&mod_trezorcrypto_bip32_deserialize_obj)}, {MP_ROM_QSTR(MP_QSTR_from_seed), MP_ROM_PTR(&mod_trezorcrypto_bip32_from_seed_obj)}, +#if !BITCOIN_ONLY {MP_ROM_QSTR(MP_QSTR_from_mnemonic_cardano), MP_ROM_PTR(&mod_trezorcrypto_bip32_from_mnemonic_cardano_obj)}, +#endif }; STATIC MP_DEFINE_CONST_DICT(mod_trezorcrypto_bip32_globals, mod_trezorcrypto_bip32_globals_table); diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h index 0d395e1abe..81d374222a 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto-ed25519.h @@ -100,6 +100,8 @@ STATIC mp_obj_t mod_trezorcrypto_ed25519_sign(size_t n_args, STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_trezorcrypto_ed25519_sign_obj, 2, 3, mod_trezorcrypto_ed25519_sign); +#if !BITCOIN_ONLY + /// def sign_ext( /// secret_key: bytes, secret_extension: bytes, message: bytes /// ) -> bytes: @@ -135,6 +137,8 @@ STATIC mp_obj_t mod_trezorcrypto_ed25519_sign_ext(mp_obj_t secret_key, STATIC MP_DEFINE_CONST_FUN_OBJ_3(mod_trezorcrypto_ed25519_sign_ext_obj, mod_trezorcrypto_ed25519_sign_ext); +#endif + /// def verify(public_key: bytes, signature: bytes, message: bytes) -> bool: /// """ /// Uses public key to verify the signature of the message. @@ -282,8 +286,10 @@ STATIC const mp_rom_map_elem_t mod_trezorcrypto_ed25519_globals_table[] = { {MP_ROM_QSTR(MP_QSTR_publickey), MP_ROM_PTR(&mod_trezorcrypto_ed25519_publickey_obj)}, {MP_ROM_QSTR(MP_QSTR_sign), MP_ROM_PTR(&mod_trezorcrypto_ed25519_sign_obj)}, +#if !BITCOIN_ONLY {MP_ROM_QSTR(MP_QSTR_sign_ext), MP_ROM_PTR(&mod_trezorcrypto_ed25519_sign_ext_obj)}, +#endif {MP_ROM_QSTR(MP_QSTR_verify), MP_ROM_PTR(&mod_trezorcrypto_ed25519_verify_obj)}, {MP_ROM_QSTR(MP_QSTR_cosi_combine_publickeys), diff --git a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c index 265942f157..2607a41c62 100644 --- a/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c +++ b/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c @@ -36,15 +36,12 @@ #include "modtrezorcrypto-curve25519.h" #include "modtrezorcrypto-ed25519.h" #include "modtrezorcrypto-groestl.h" -#include "modtrezorcrypto-monero.h" -#include "modtrezorcrypto-nem.h" #include "modtrezorcrypto-nist256p1.h" #include "modtrezorcrypto-pbkdf2.h" #include "modtrezorcrypto-random.h" #include "modtrezorcrypto-rfc6979.h" #include "modtrezorcrypto-ripemd160.h" #include "modtrezorcrypto-secp256k1.h" -#include "modtrezorcrypto-secp256k1_zkp.h" #include "modtrezorcrypto-sha1.h" #include "modtrezorcrypto-sha256.h" #include "modtrezorcrypto-sha3-256.h" @@ -52,6 +49,11 @@ #include "modtrezorcrypto-sha512.h" #include "modtrezorcrypto-shamir.h" #include "modtrezorcrypto-slip39.h" +#if !BITCOIN_ONLY +#include "modtrezorcrypto-monero.h" +#include "modtrezorcrypto-nem.h" +#include "modtrezorcrypto-secp256k1_zkp.h" +#endif STATIC const mp_rom_map_elem_t mp_module_trezorcrypto_globals_table[] = { {MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_trezorcrypto)}, @@ -69,12 +71,16 @@ STATIC const mp_rom_map_elem_t mp_module_trezorcrypto_globals_table[] = { MP_ROM_PTR(&mod_trezorcrypto_curve25519_module)}, {MP_ROM_QSTR(MP_QSTR_ed25519), MP_ROM_PTR(&mod_trezorcrypto_ed25519_module)}, +#if !BITCOIN_ONLY {MP_ROM_QSTR(MP_QSTR_monero), MP_ROM_PTR(&mod_trezorcrypto_monero_module)}, +#endif {MP_ROM_QSTR(MP_QSTR_nist256p1), MP_ROM_PTR(&mod_trezorcrypto_nist256p1_module)}, {MP_ROM_QSTR(MP_QSTR_groestl512), MP_ROM_PTR(&mod_trezorcrypto_Groestl512_type)}, +#if !BITCOIN_ONLY {MP_ROM_QSTR(MP_QSTR_nem), MP_ROM_PTR(&mod_trezorcrypto_nem_module)}, +#endif {MP_ROM_QSTR(MP_QSTR_pbkdf2), MP_ROM_PTR(&mod_trezorcrypto_Pbkdf2_type)}, {MP_ROM_QSTR(MP_QSTR_random), MP_ROM_PTR(&mod_trezorcrypto_random_module)}, {MP_ROM_QSTR(MP_QSTR_rfc6979), MP_ROM_PTR(&mod_trezorcrypto_Rfc6979_type)}, @@ -82,8 +88,10 @@ STATIC const mp_rom_map_elem_t mp_module_trezorcrypto_globals_table[] = { MP_ROM_PTR(&mod_trezorcrypto_Ripemd160_type)}, {MP_ROM_QSTR(MP_QSTR_secp256k1), MP_ROM_PTR(&mod_trezorcrypto_secp256k1_module)}, +#if !BITCOIN_ONLY {MP_ROM_QSTR(MP_QSTR_secp256k1_zkp), MP_ROM_PTR(&mod_trezorcrypto_secp256k1_zkp_module)}, +#endif {MP_ROM_QSTR(MP_QSTR_sha1), MP_ROM_PTR(&mod_trezorcrypto_Sha1_type)}, {MP_ROM_QSTR(MP_QSTR_sha256), MP_ROM_PTR(&mod_trezorcrypto_Sha256_type)}, {MP_ROM_QSTR(MP_QSTR_sha512), MP_ROM_PTR(&mod_trezorcrypto_Sha512_type)}, diff --git a/core/embed/extmod/modtrezorutils/modtrezorutils.c b/core/embed/extmod/modtrezorutils/modtrezorutils.c index e51998443f..24b4ae6f8d 100644 --- a/core/embed/extmod/modtrezorutils/modtrezorutils.c +++ b/core/embed/extmod/modtrezorutils/modtrezorutils.c @@ -147,6 +147,11 @@ STATIC const mp_rom_map_elem_t mp_module_trezorutils_globals_table[] = { #else {MP_ROM_QSTR(MP_QSTR_EMULATOR), mp_const_false}, #endif +#if BITCOIN_ONLY + {MP_ROM_QSTR(MP_QSTR_BITCOIN_ONLY), mp_const_true}, +#else + {MP_ROM_QSTR(MP_QSTR_BITCOIN_ONLY), mp_const_false}, +#endif }; STATIC MP_DEFINE_CONST_DICT(mp_module_trezorutils_globals, diff --git a/core/src/apps/common/coininfo.py b/core/src/apps/common/coininfo.py index 883b25a108..13b00df757 100644 --- a/core/src/apps/common/coininfo.py +++ b/core/src/apps/common/coininfo.py @@ -1,5 +1,6 @@ # generated from coininfo.py.mako # do not edit manually! +from trezor import utils from trezor.crypto.base58 import blake256d_32, groestl512d_32, keccak_32, sha256d_32 from trezor.crypto.scripts import blake256_ripemd160_digest, sha256_ripemd160_digest @@ -146,1614 +147,1617 @@ def by_name(name: str) -> CoinInfo: curve_name='secp256k1', confidential_assets=None, ) - elif name == "Actinium": - return CoinInfo( - coin_name=name, - coin_shortcut="ACM", - address_type=53, - address_type_p2sh=55, - maxfee_kb=40000000, - signed_message_header="Actinium Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="acm", - cashaddr_prefix=None, - slip44=228, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Axe": - return CoinInfo( - coin_name=name, - coin_shortcut="AXE", - address_type=55, - address_type_p2sh=16, - maxfee_kb=100000, - signed_message_header="DarkCoin Signed Message:\n", - xpub_magic=0x02fe52cc, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=4242, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Bellcoin": - return CoinInfo( - coin_name=name, - coin_shortcut="BELL", - address_type=25, - address_type_p2sh=85, - maxfee_kb=1000000, - signed_message_header="Bellcoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="bm", - cashaddr_prefix=None, - slip44=25252, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "BitCash": - return CoinInfo( - coin_name=name, - coin_shortcut="BITC", - address_type=230, - address_type_p2sh=235, - maxfee_kb=30000000, - signed_message_header="Bitcash Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=230, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Bitgreen": - return CoinInfo( - coin_name=name, - coin_shortcut="BITG", - address_type=38, - address_type_p2sh=6, - maxfee_kb=100000, - signed_message_header="DarkNet Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=222, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "BitZeny": - return CoinInfo( - coin_name=name, - coin_shortcut="ZNY", - address_type=81, - address_type_p2sh=5, - maxfee_kb=1000000, - signed_message_header="BitZeny Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="bz", - cashaddr_prefix=None, - slip44=123, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Bitcloud": - return CoinInfo( - coin_name=name, - coin_shortcut="BTDX", - address_type=25, - address_type_p2sh=5, - maxfee_kb=1000000, - signed_message_header="Diamond Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=218, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Bcash": - return CoinInfo( - coin_name=name, - coin_shortcut="BCH", - address_type=0, - address_type_p2sh=5, - maxfee_kb=500000, - signed_message_header="Bitcoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix="bitcoincash", - slip44=145, - segwit=False, - fork_id=0, - force_bip143=True, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Bcash Testnet": - return CoinInfo( - coin_name=name, - coin_shortcut="TBCH", - address_type=111, - address_type_p2sh=196, - maxfee_kb=10000000, - signed_message_header="Bitcoin Signed Message:\n", - xpub_magic=0x043587cf, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix="bchtest", - slip44=1, - segwit=False, - fork_id=0, - force_bip143=True, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Bgold": - return CoinInfo( - coin_name=name, - coin_shortcut="BTG", - address_type=38, - address_type_p2sh=23, - maxfee_kb=500000, - signed_message_header="Bitcoin Gold Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="btg", - cashaddr_prefix=None, - slip44=156, - segwit=True, - fork_id=79, - force_bip143=True, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Bgold Testnet": - return CoinInfo( - coin_name=name, - coin_shortcut="TBTG", - address_type=111, - address_type_p2sh=196, - maxfee_kb=500000, - signed_message_header="Bitcoin Gold Signed Message:\n", - xpub_magic=0x043587cf, - xpub_magic_segwit_p2sh=0x044a5262, - xpub_magic_segwit_native=0x045f1cf6, - bech32_prefix="tbtg", - cashaddr_prefix=None, - slip44=156, - segwit=True, - fork_id=79, - force_bip143=True, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Bprivate": - return CoinInfo( - coin_name=name, - coin_shortcut="BTCP", - address_type=4901, - address_type_p2sh=5039, - maxfee_kb=1000000, - signed_message_header="BitcoinPrivate Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=183, - segwit=False, - fork_id=42, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Brhodium": - return CoinInfo( - coin_name=name, - coin_shortcut="XRC", - address_type=61, - address_type_p2sh=123, - maxfee_kb=2000000, - signed_message_header="BitCoin Rhodium Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=10291, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Bitcore": - return CoinInfo( - coin_name=name, - coin_shortcut="BTX", - address_type=3, - address_type_p2sh=125, - maxfee_kb=2000000, - signed_message_header="BitCore Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="btx", - cashaddr_prefix=None, - slip44=160, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Bitsend": - return CoinInfo( - coin_name=name, - coin_shortcut="BSD", - address_type=102, - address_type_p2sh=5, - maxfee_kb=1000000, - signed_message_header="Bitsend Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="bsd", - cashaddr_prefix=None, - slip44=91, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "BlockStamp": - return CoinInfo( - coin_name=name, - coin_shortcut="BST", - address_type=26, - address_type_p2sh=5, - maxfee_kb=2000000, - signed_message_header="BST Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="bst", - cashaddr_prefix=None, - slip44=254, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "CPUchain": - return CoinInfo( - coin_name=name, - coin_shortcut="CPU", - address_type=28, - address_type_p2sh=30, - maxfee_kb=1000000, - signed_message_header="CPUchain Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="cpu", - cashaddr_prefix=None, - slip44=363, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Capricoin": - return CoinInfo( - coin_name=name, - coin_shortcut="CPC", - address_type=28, - address_type_p2sh=35, - maxfee_kb=2000000, - signed_message_header="Capricoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=289, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Dash": - return CoinInfo( - coin_name=name, - coin_shortcut="DASH", - address_type=76, - address_type_p2sh=16, - maxfee_kb=100000, - signed_message_header="DarkCoin Signed Message:\n", - xpub_magic=0x02fe52cc, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=5, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Dash Testnet": - return CoinInfo( - coin_name=name, - coin_shortcut="tDASH", - address_type=140, - address_type_p2sh=19, - maxfee_kb=100000, - signed_message_header="DarkCoin Signed Message:\n", - xpub_magic=0x043587cf, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=1, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Decred": - return CoinInfo( - coin_name=name, - coin_shortcut="DCR", - address_type=1855, - address_type_p2sh=1818, - maxfee_kb=1000000, - signed_message_header="Decred Signed Message:\n", - xpub_magic=0x02fda926, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=42, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=True, - negative_fee=False, - curve_name='secp256k1-decred', - confidential_assets=None, - ) - elif name == "Decred Testnet": - return CoinInfo( - coin_name=name, - coin_shortcut="TDCR", - address_type=3873, - address_type_p2sh=3836, - maxfee_kb=10000000, - signed_message_header="Decred Signed Message:\n", - xpub_magic=0x043587d1, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=1, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=True, - negative_fee=False, - curve_name='secp256k1-decred', - confidential_assets=None, - ) - elif name == "Denarius": - return CoinInfo( - coin_name=name, - coin_shortcut="DNR", - address_type=30, - address_type_p2sh=90, - maxfee_kb=100000, - signed_message_header="Denarius Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=116, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "DigiByte": - return CoinInfo( - coin_name=name, - coin_shortcut="DGB", - address_type=30, - address_type_p2sh=63, - maxfee_kb=500000, - signed_message_header="DigiByte Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="dgb", - cashaddr_prefix=None, - slip44=20, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Dogecoin": - return CoinInfo( - coin_name=name, - coin_shortcut="DOGE", - address_type=30, - address_type_p2sh=22, - maxfee_kb=1000000000, - signed_message_header="Dogecoin Signed Message:\n", - xpub_magic=0x02facafd, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=3, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Elements": - return CoinInfo( - coin_name=name, - coin_shortcut="ELEMENTS", - address_type=235, - address_type_p2sh=75, - maxfee_kb=10000000, - signed_message_header="Bitcoin Signed Message:\n", - xpub_magic=0x043587cf, - xpub_magic_segwit_p2sh=0x044a5262, - xpub_magic_segwit_native=0x045f1cf6, - bech32_prefix="ert", - cashaddr_prefix=None, - slip44=1, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets={'address_prefix': 4, 'blech32_prefix': 'el'}, - ) - elif name == "FairCoin": - return CoinInfo( - coin_name=name, - coin_shortcut="FAIR", - address_type=95, - address_type_p2sh=36, - maxfee_kb=10000000, - signed_message_header="FairCoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=298, - segwit=False, - fork_id=0, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Feathercoin": - return CoinInfo( - coin_name=name, - coin_shortcut="FTC", - address_type=14, - address_type_p2sh=5, - maxfee_kb=40000000, - signed_message_header="Feathercoin Signed Message:\n", - xpub_magic=0x0488bc26, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="fc", - cashaddr_prefix=None, - slip44=8, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Florincoin": - return CoinInfo( - coin_name=name, - coin_shortcut="FLO", - address_type=35, - address_type_p2sh=94, - maxfee_kb=40000000, - signed_message_header="Florincoin Signed Message:\n", - xpub_magic=0x00174921, - xpub_magic_segwit_p2sh=0x01b26ef6, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="flo", - cashaddr_prefix=None, - slip44=216, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Fujicoin": - return CoinInfo( - coin_name=name, - coin_shortcut="FJC", - address_type=36, - address_type_p2sh=16, - maxfee_kb=1000000000, - signed_message_header="FujiCoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="fc", - cashaddr_prefix=None, - slip44=75, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Gincoin": - return CoinInfo( - coin_name=name, - coin_shortcut="GIN", - address_type=38, - address_type_p2sh=10, - maxfee_kb=100000, - signed_message_header="DarkCoin Signed Message:\n", - xpub_magic=0x02fe52cc, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=2000, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "GameCredits": - return CoinInfo( - coin_name=name, - coin_shortcut="GAME", - address_type=38, - address_type_p2sh=62, - maxfee_kb=5000000, - signed_message_header="GameCredits Signed Message:\n", - xpub_magic=0x019d9cfe, - xpub_magic_segwit_p2sh=0x01b26ef6, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="game", - cashaddr_prefix=None, - slip44=101, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Groestlcoin": - return CoinInfo( - coin_name=name, - coin_shortcut="GRS", - address_type=36, - address_type_p2sh=5, - maxfee_kb=100000, - signed_message_header="GroestlCoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="grs", - cashaddr_prefix=None, - slip44=17, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1-groestl', - confidential_assets=None, - ) - elif name == "Groestlcoin Testnet": - return CoinInfo( - coin_name=name, - coin_shortcut="tGRS", - address_type=111, - address_type_p2sh=196, - maxfee_kb=100000, - signed_message_header="GroestlCoin Signed Message:\n", - xpub_magic=0x043587cf, - xpub_magic_segwit_p2sh=0x044a5262, - xpub_magic_segwit_native=0x045f1cf6, - bech32_prefix="tgrs", - cashaddr_prefix=None, - slip44=1, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1-groestl', - confidential_assets=None, - ) - elif name == "Horizen": - return CoinInfo( - coin_name=name, - coin_shortcut="ZEN", - address_type=8329, - address_type_p2sh=8342, - maxfee_kb=2000000, - signed_message_header="Zcash Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=121, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=True, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Komodo": - return CoinInfo( - coin_name=name, - coin_shortcut="KMD", - address_type=60, - address_type_p2sh=85, - maxfee_kb=1000000, - signed_message_header="Komodo Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=141, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=True, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Koto": - return CoinInfo( - coin_name=name, - coin_shortcut="KOTO", - address_type=6198, - address_type_p2sh=6203, - maxfee_kb=1000000, - signed_message_header="Koto Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=510, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Litecoin": - return CoinInfo( - coin_name=name, - coin_shortcut="LTC", - address_type=48, - address_type_p2sh=50, - maxfee_kb=40000000, - signed_message_header="Litecoin Signed Message:\n", - xpub_magic=0x019da462, - xpub_magic_segwit_p2sh=0x01b26ef6, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="ltc", - cashaddr_prefix=None, - slip44=2, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Litecoin Testnet": - return CoinInfo( - coin_name=name, - coin_shortcut="tLTC", - address_type=111, - address_type_p2sh=58, - maxfee_kb=40000000, - signed_message_header="Litecoin Signed Message:\n", - xpub_magic=0x043587cf, - xpub_magic_segwit_p2sh=0x044a5262, - xpub_magic_segwit_native=0x045f1cf6, - bech32_prefix="tltc", - cashaddr_prefix=None, - slip44=1, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Megacoin": - return CoinInfo( - coin_name=name, - coin_shortcut="MEC", - address_type=50, - address_type_p2sh=5, - maxfee_kb=1000000, - signed_message_header="MegaCoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="mec", - cashaddr_prefix=None, - slip44=217, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Monacoin": - return CoinInfo( - coin_name=name, - coin_shortcut="MONA", - address_type=50, - address_type_p2sh=55, - maxfee_kb=5000000, - signed_message_header="Monacoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="mona", - cashaddr_prefix=None, - slip44=22, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "MonetaryUnit": - return CoinInfo( - coin_name=name, - coin_shortcut="MUE", - address_type=16, - address_type_p2sh=76, - maxfee_kb=100000, - signed_message_header="MonetaryUnit Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=31, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Myriad": - return CoinInfo( - coin_name=name, - coin_shortcut="XMY", - address_type=50, - address_type_p2sh=9, - maxfee_kb=2000000, - signed_message_header="Myriadcoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="my", - cashaddr_prefix=None, - slip44=90, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "NIX": - return CoinInfo( - coin_name=name, - coin_shortcut="NIX", - address_type=38, - address_type_p2sh=53, - maxfee_kb=40000000, - signed_message_header="NIX Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="nix", - cashaddr_prefix=None, - slip44=400, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Namecoin": - return CoinInfo( - coin_name=name, - coin_shortcut="NMC", - address_type=52, - address_type_p2sh=5, - maxfee_kb=10000000, - signed_message_header="Namecoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=7, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "OmotenashiCoin": - return CoinInfo( - coin_name=name, - coin_shortcut="MTNS", - address_type=63, - address_type_p2sh=18, - maxfee_kb=100000, - signed_message_header="MtnsNet Signed Message:\n", - xpub_magic=0x03a39555, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=341, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "PIVX": - return CoinInfo( - coin_name=name, - coin_shortcut="PIVX", - address_type=30, - address_type_p2sh=13, - maxfee_kb=100000, - signed_message_header="DarkNet Signed Message:\n", - xpub_magic=0x022d2533, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=119, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "PIVX Testnet": - return CoinInfo( - coin_name=name, - coin_shortcut="tPIVX", - address_type=139, - address_type_p2sh=19, - maxfee_kb=100000, - signed_message_header="DarkNet Signed Message:\n", - xpub_magic=0x3a8061a0, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=1, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Particl": - return CoinInfo( - coin_name=name, - coin_shortcut="PART", - address_type=56, - address_type_p2sh=60, - maxfee_kb=2000000, - signed_message_header="Bitcoin Signed Message:\n", - xpub_magic=0x8f1daeb8, - xpub_magic_segwit_p2sh=0x01b26ef6, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="bc", - cashaddr_prefix=None, - slip44=44, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Particl Testnet": - return CoinInfo( - coin_name=name, - coin_shortcut="tPART", - address_type=118, - address_type_p2sh=122, - maxfee_kb=10000000, - signed_message_header="Bitcoin Signed Message:\n", - xpub_magic=0x04889478, - xpub_magic_segwit_p2sh=0x044a5262, - xpub_magic_segwit_native=0x045f1cf6, - bech32_prefix="tb", - cashaddr_prefix=None, - slip44=1, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Pesetacoin": - return CoinInfo( - coin_name=name, - coin_shortcut="PTC", - address_type=47, - address_type_p2sh=22, - maxfee_kb=1000000000, - signed_message_header="Pesetacoin Signed Message:\n", - xpub_magic=0x0488c42e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=109, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Polis": - return CoinInfo( - coin_name=name, - coin_shortcut="POLIS", - address_type=55, - address_type_p2sh=56, - maxfee_kb=100000, - signed_message_header="Polis Signed Message:\n", - xpub_magic=0x03e25d7e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=1997, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Primecoin": - return CoinInfo( - coin_name=name, - coin_shortcut="XPM", - address_type=23, - address_type_p2sh=83, - maxfee_kb=1000000, - signed_message_header="Primecoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=24, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Qtum": - return CoinInfo( - coin_name=name, - coin_shortcut="QTUM", - address_type=58, - address_type_p2sh=50, - maxfee_kb=40000000, - signed_message_header="Qtum Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="qc", - cashaddr_prefix=None, - slip44=2301, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Qtum Testnet": - return CoinInfo( - coin_name=name, - coin_shortcut="tQTUM", - address_type=120, - address_type_p2sh=110, - maxfee_kb=40000000, - signed_message_header="Qtum Signed Message:\n", - xpub_magic=0x043587cf, - xpub_magic_segwit_p2sh=0x044a5262, - xpub_magic_segwit_native=0x045f1cf6, - bech32_prefix="tq", - cashaddr_prefix=None, - slip44=1, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Ravencoin": - return CoinInfo( - coin_name=name, - coin_shortcut="RVN", - address_type=60, - address_type_p2sh=122, - maxfee_kb=2000000, - signed_message_header="Raven Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=175, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Ritocoin": - return CoinInfo( - coin_name=name, - coin_shortcut="RITO", - address_type=25, - address_type_p2sh=105, - maxfee_kb=2000000, - signed_message_header="Rito Signed Message:\n", - xpub_magic=0x0534e7ca, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=19169, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "SmartCash": - return CoinInfo( - coin_name=name, - coin_shortcut="SMART", - address_type=63, - address_type_p2sh=18, - maxfee_kb=1000000, - signed_message_header="SmartCash Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=224, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1-smart', - confidential_assets=None, - ) - elif name == "SmartCash Testnet": - return CoinInfo( - coin_name=name, - coin_shortcut="tSMART", - address_type=65, - address_type_p2sh=21, - maxfee_kb=1000000, - signed_message_header="SmartCash Signed Message:\n", - xpub_magic=0x043587cf, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=224, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1-smart', - confidential_assets=None, - ) - elif name == "Stakenet": - return CoinInfo( - coin_name=name, - coin_shortcut="XSN", - address_type=76, - address_type_p2sh=16, - maxfee_kb=2000000, - signed_message_header="DarkCoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="xc", - cashaddr_prefix=None, - slip44=199, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Umbru": - return CoinInfo( - coin_name=name, - coin_shortcut="UMBRU", - address_type=68, - address_type_p2sh=5, - maxfee_kb=100000, - signed_message_header="DarkCoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=395, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "VIPSTARCOIN": - return CoinInfo( - coin_name=name, - coin_shortcut="VIPS", - address_type=70, - address_type_p2sh=50, - maxfee_kb=40000000, - signed_message_header="VIPSTARCOIN Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="vips", - cashaddr_prefix=None, - slip44=1919, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Vertcoin": - return CoinInfo( - coin_name=name, - coin_shortcut="VTC", - address_type=71, - address_type_p2sh=5, - maxfee_kb=40000000, - signed_message_header="Vertcoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="vtc", - cashaddr_prefix=None, - slip44=28, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Viacoin": - return CoinInfo( - coin_name=name, - coin_shortcut="VIA", - address_type=71, - address_type_p2sh=33, - maxfee_kb=40000000, - signed_message_header="Viacoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=0x049d7cb2, - xpub_magic_segwit_native=0x04b24746, - bech32_prefix="via", - cashaddr_prefix=None, - slip44=14, - segwit=True, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "ZClassic": - return CoinInfo( - coin_name=name, - coin_shortcut="ZCL", - address_type=7352, - address_type_p2sh=7357, - maxfee_kb=1000000, - signed_message_header="Zcash Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=147, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Zcash": - return CoinInfo( - coin_name=name, - coin_shortcut="ZEC", - address_type=7352, - address_type_p2sh=7357, - maxfee_kb=1000000, - signed_message_header="Zcash Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=133, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Zcash Testnet": - return CoinInfo( - coin_name=name, - coin_shortcut="TAZ", - address_type=7461, - address_type_p2sh=7354, - maxfee_kb=10000000, - signed_message_header="Zcash Signed Message:\n", - xpub_magic=0x043587cf, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=1, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Zcoin": - return CoinInfo( - coin_name=name, - coin_shortcut="XZC", - address_type=82, - address_type_p2sh=7, - maxfee_kb=1000000, - signed_message_header="Zcoin Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=136, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "Zcoin Testnet": - return CoinInfo( - coin_name=name, - coin_shortcut="tXZC", - address_type=65, - address_type_p2sh=178, - maxfee_kb=1000000, - signed_message_header="Zcoin Signed Message:\n", - xpub_magic=0x043587cf, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=1, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) - elif name == "ZelCash": - return CoinInfo( - coin_name=name, - coin_shortcut="ZEL", - address_type=7352, - address_type_p2sh=7357, - maxfee_kb=1000000, - signed_message_header="Zcash Signed Message:\n", - xpub_magic=0x0488b21e, - xpub_magic_segwit_p2sh=None, - xpub_magic_segwit_native=None, - bech32_prefix=None, - cashaddr_prefix=None, - slip44=19167, - segwit=False, - fork_id=None, - force_bip143=False, - bip115=False, - decred=False, - negative_fee=False, - curve_name='secp256k1', - confidential_assets=None, - ) + if not utils.BITCOIN_ONLY: + if False: + pass + elif name == "Actinium": + return CoinInfo( + coin_name=name, + coin_shortcut="ACM", + address_type=53, + address_type_p2sh=55, + maxfee_kb=40000000, + signed_message_header="Actinium Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="acm", + cashaddr_prefix=None, + slip44=228, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Axe": + return CoinInfo( + coin_name=name, + coin_shortcut="AXE", + address_type=55, + address_type_p2sh=16, + maxfee_kb=100000, + signed_message_header="DarkCoin Signed Message:\n", + xpub_magic=0x02fe52cc, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=4242, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Bellcoin": + return CoinInfo( + coin_name=name, + coin_shortcut="BELL", + address_type=25, + address_type_p2sh=85, + maxfee_kb=1000000, + signed_message_header="Bellcoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="bm", + cashaddr_prefix=None, + slip44=25252, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "BitCash": + return CoinInfo( + coin_name=name, + coin_shortcut="BITC", + address_type=230, + address_type_p2sh=235, + maxfee_kb=30000000, + signed_message_header="Bitcash Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=230, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Bitgreen": + return CoinInfo( + coin_name=name, + coin_shortcut="BITG", + address_type=38, + address_type_p2sh=6, + maxfee_kb=100000, + signed_message_header="DarkNet Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=222, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "BitZeny": + return CoinInfo( + coin_name=name, + coin_shortcut="ZNY", + address_type=81, + address_type_p2sh=5, + maxfee_kb=1000000, + signed_message_header="BitZeny Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="bz", + cashaddr_prefix=None, + slip44=123, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Bitcloud": + return CoinInfo( + coin_name=name, + coin_shortcut="BTDX", + address_type=25, + address_type_p2sh=5, + maxfee_kb=1000000, + signed_message_header="Diamond Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=218, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Bcash": + return CoinInfo( + coin_name=name, + coin_shortcut="BCH", + address_type=0, + address_type_p2sh=5, + maxfee_kb=500000, + signed_message_header="Bitcoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix="bitcoincash", + slip44=145, + segwit=False, + fork_id=0, + force_bip143=True, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Bcash Testnet": + return CoinInfo( + coin_name=name, + coin_shortcut="TBCH", + address_type=111, + address_type_p2sh=196, + maxfee_kb=10000000, + signed_message_header="Bitcoin Signed Message:\n", + xpub_magic=0x043587cf, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix="bchtest", + slip44=1, + segwit=False, + fork_id=0, + force_bip143=True, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Bgold": + return CoinInfo( + coin_name=name, + coin_shortcut="BTG", + address_type=38, + address_type_p2sh=23, + maxfee_kb=500000, + signed_message_header="Bitcoin Gold Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="btg", + cashaddr_prefix=None, + slip44=156, + segwit=True, + fork_id=79, + force_bip143=True, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Bgold Testnet": + return CoinInfo( + coin_name=name, + coin_shortcut="TBTG", + address_type=111, + address_type_p2sh=196, + maxfee_kb=500000, + signed_message_header="Bitcoin Gold Signed Message:\n", + xpub_magic=0x043587cf, + xpub_magic_segwit_p2sh=0x044a5262, + xpub_magic_segwit_native=0x045f1cf6, + bech32_prefix="tbtg", + cashaddr_prefix=None, + slip44=156, + segwit=True, + fork_id=79, + force_bip143=True, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Bprivate": + return CoinInfo( + coin_name=name, + coin_shortcut="BTCP", + address_type=4901, + address_type_p2sh=5039, + maxfee_kb=1000000, + signed_message_header="BitcoinPrivate Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=183, + segwit=False, + fork_id=42, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Brhodium": + return CoinInfo( + coin_name=name, + coin_shortcut="XRC", + address_type=61, + address_type_p2sh=123, + maxfee_kb=2000000, + signed_message_header="BitCoin Rhodium Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=10291, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Bitcore": + return CoinInfo( + coin_name=name, + coin_shortcut="BTX", + address_type=3, + address_type_p2sh=125, + maxfee_kb=2000000, + signed_message_header="BitCore Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="btx", + cashaddr_prefix=None, + slip44=160, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Bitsend": + return CoinInfo( + coin_name=name, + coin_shortcut="BSD", + address_type=102, + address_type_p2sh=5, + maxfee_kb=1000000, + signed_message_header="Bitsend Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="bsd", + cashaddr_prefix=None, + slip44=91, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "BlockStamp": + return CoinInfo( + coin_name=name, + coin_shortcut="BST", + address_type=26, + address_type_p2sh=5, + maxfee_kb=2000000, + signed_message_header="BST Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="bst", + cashaddr_prefix=None, + slip44=254, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "CPUchain": + return CoinInfo( + coin_name=name, + coin_shortcut="CPU", + address_type=28, + address_type_p2sh=30, + maxfee_kb=1000000, + signed_message_header="CPUchain Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="cpu", + cashaddr_prefix=None, + slip44=363, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Capricoin": + return CoinInfo( + coin_name=name, + coin_shortcut="CPC", + address_type=28, + address_type_p2sh=35, + maxfee_kb=2000000, + signed_message_header="Capricoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=289, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Dash": + return CoinInfo( + coin_name=name, + coin_shortcut="DASH", + address_type=76, + address_type_p2sh=16, + maxfee_kb=100000, + signed_message_header="DarkCoin Signed Message:\n", + xpub_magic=0x02fe52cc, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=5, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Dash Testnet": + return CoinInfo( + coin_name=name, + coin_shortcut="tDASH", + address_type=140, + address_type_p2sh=19, + maxfee_kb=100000, + signed_message_header="DarkCoin Signed Message:\n", + xpub_magic=0x043587cf, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=1, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Decred": + return CoinInfo( + coin_name=name, + coin_shortcut="DCR", + address_type=1855, + address_type_p2sh=1818, + maxfee_kb=1000000, + signed_message_header="Decred Signed Message:\n", + xpub_magic=0x02fda926, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=42, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=True, + negative_fee=False, + curve_name='secp256k1-decred', + confidential_assets=None, + ) + elif name == "Decred Testnet": + return CoinInfo( + coin_name=name, + coin_shortcut="TDCR", + address_type=3873, + address_type_p2sh=3836, + maxfee_kb=10000000, + signed_message_header="Decred Signed Message:\n", + xpub_magic=0x043587d1, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=1, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=True, + negative_fee=False, + curve_name='secp256k1-decred', + confidential_assets=None, + ) + elif name == "Denarius": + return CoinInfo( + coin_name=name, + coin_shortcut="DNR", + address_type=30, + address_type_p2sh=90, + maxfee_kb=100000, + signed_message_header="Denarius Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=116, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "DigiByte": + return CoinInfo( + coin_name=name, + coin_shortcut="DGB", + address_type=30, + address_type_p2sh=63, + maxfee_kb=500000, + signed_message_header="DigiByte Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="dgb", + cashaddr_prefix=None, + slip44=20, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Dogecoin": + return CoinInfo( + coin_name=name, + coin_shortcut="DOGE", + address_type=30, + address_type_p2sh=22, + maxfee_kb=1000000000, + signed_message_header="Dogecoin Signed Message:\n", + xpub_magic=0x02facafd, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=3, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Elements": + return CoinInfo( + coin_name=name, + coin_shortcut="ELEMENTS", + address_type=235, + address_type_p2sh=75, + maxfee_kb=10000000, + signed_message_header="Bitcoin Signed Message:\n", + xpub_magic=0x043587cf, + xpub_magic_segwit_p2sh=0x044a5262, + xpub_magic_segwit_native=0x045f1cf6, + bech32_prefix="ert", + cashaddr_prefix=None, + slip44=1, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets={'address_prefix': 4, 'blech32_prefix': 'el'}, + ) + elif name == "FairCoin": + return CoinInfo( + coin_name=name, + coin_shortcut="FAIR", + address_type=95, + address_type_p2sh=36, + maxfee_kb=10000000, + signed_message_header="FairCoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=298, + segwit=False, + fork_id=0, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Feathercoin": + return CoinInfo( + coin_name=name, + coin_shortcut="FTC", + address_type=14, + address_type_p2sh=5, + maxfee_kb=40000000, + signed_message_header="Feathercoin Signed Message:\n", + xpub_magic=0x0488bc26, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="fc", + cashaddr_prefix=None, + slip44=8, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Florincoin": + return CoinInfo( + coin_name=name, + coin_shortcut="FLO", + address_type=35, + address_type_p2sh=94, + maxfee_kb=40000000, + signed_message_header="Florincoin Signed Message:\n", + xpub_magic=0x00174921, + xpub_magic_segwit_p2sh=0x01b26ef6, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="flo", + cashaddr_prefix=None, + slip44=216, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Fujicoin": + return CoinInfo( + coin_name=name, + coin_shortcut="FJC", + address_type=36, + address_type_p2sh=16, + maxfee_kb=1000000000, + signed_message_header="FujiCoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="fc", + cashaddr_prefix=None, + slip44=75, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Gincoin": + return CoinInfo( + coin_name=name, + coin_shortcut="GIN", + address_type=38, + address_type_p2sh=10, + maxfee_kb=100000, + signed_message_header="DarkCoin Signed Message:\n", + xpub_magic=0x02fe52cc, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=2000, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "GameCredits": + return CoinInfo( + coin_name=name, + coin_shortcut="GAME", + address_type=38, + address_type_p2sh=62, + maxfee_kb=5000000, + signed_message_header="GameCredits Signed Message:\n", + xpub_magic=0x019d9cfe, + xpub_magic_segwit_p2sh=0x01b26ef6, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="game", + cashaddr_prefix=None, + slip44=101, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Groestlcoin": + return CoinInfo( + coin_name=name, + coin_shortcut="GRS", + address_type=36, + address_type_p2sh=5, + maxfee_kb=100000, + signed_message_header="GroestlCoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="grs", + cashaddr_prefix=None, + slip44=17, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1-groestl', + confidential_assets=None, + ) + elif name == "Groestlcoin Testnet": + return CoinInfo( + coin_name=name, + coin_shortcut="tGRS", + address_type=111, + address_type_p2sh=196, + maxfee_kb=100000, + signed_message_header="GroestlCoin Signed Message:\n", + xpub_magic=0x043587cf, + xpub_magic_segwit_p2sh=0x044a5262, + xpub_magic_segwit_native=0x045f1cf6, + bech32_prefix="tgrs", + cashaddr_prefix=None, + slip44=1, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1-groestl', + confidential_assets=None, + ) + elif name == "Horizen": + return CoinInfo( + coin_name=name, + coin_shortcut="ZEN", + address_type=8329, + address_type_p2sh=8342, + maxfee_kb=2000000, + signed_message_header="Zcash Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=121, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=True, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Komodo": + return CoinInfo( + coin_name=name, + coin_shortcut="KMD", + address_type=60, + address_type_p2sh=85, + maxfee_kb=1000000, + signed_message_header="Komodo Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=141, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=True, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Koto": + return CoinInfo( + coin_name=name, + coin_shortcut="KOTO", + address_type=6198, + address_type_p2sh=6203, + maxfee_kb=1000000, + signed_message_header="Koto Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=510, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Litecoin": + return CoinInfo( + coin_name=name, + coin_shortcut="LTC", + address_type=48, + address_type_p2sh=50, + maxfee_kb=40000000, + signed_message_header="Litecoin Signed Message:\n", + xpub_magic=0x019da462, + xpub_magic_segwit_p2sh=0x01b26ef6, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="ltc", + cashaddr_prefix=None, + slip44=2, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Litecoin Testnet": + return CoinInfo( + coin_name=name, + coin_shortcut="tLTC", + address_type=111, + address_type_p2sh=58, + maxfee_kb=40000000, + signed_message_header="Litecoin Signed Message:\n", + xpub_magic=0x043587cf, + xpub_magic_segwit_p2sh=0x044a5262, + xpub_magic_segwit_native=0x045f1cf6, + bech32_prefix="tltc", + cashaddr_prefix=None, + slip44=1, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Megacoin": + return CoinInfo( + coin_name=name, + coin_shortcut="MEC", + address_type=50, + address_type_p2sh=5, + maxfee_kb=1000000, + signed_message_header="MegaCoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="mec", + cashaddr_prefix=None, + slip44=217, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Monacoin": + return CoinInfo( + coin_name=name, + coin_shortcut="MONA", + address_type=50, + address_type_p2sh=55, + maxfee_kb=5000000, + signed_message_header="Monacoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="mona", + cashaddr_prefix=None, + slip44=22, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "MonetaryUnit": + return CoinInfo( + coin_name=name, + coin_shortcut="MUE", + address_type=16, + address_type_p2sh=76, + maxfee_kb=100000, + signed_message_header="MonetaryUnit Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=31, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Myriad": + return CoinInfo( + coin_name=name, + coin_shortcut="XMY", + address_type=50, + address_type_p2sh=9, + maxfee_kb=2000000, + signed_message_header="Myriadcoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="my", + cashaddr_prefix=None, + slip44=90, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "NIX": + return CoinInfo( + coin_name=name, + coin_shortcut="NIX", + address_type=38, + address_type_p2sh=53, + maxfee_kb=40000000, + signed_message_header="NIX Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="nix", + cashaddr_prefix=None, + slip44=400, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Namecoin": + return CoinInfo( + coin_name=name, + coin_shortcut="NMC", + address_type=52, + address_type_p2sh=5, + maxfee_kb=10000000, + signed_message_header="Namecoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=7, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "OmotenashiCoin": + return CoinInfo( + coin_name=name, + coin_shortcut="MTNS", + address_type=63, + address_type_p2sh=18, + maxfee_kb=100000, + signed_message_header="MtnsNet Signed Message:\n", + xpub_magic=0x03a39555, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=341, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "PIVX": + return CoinInfo( + coin_name=name, + coin_shortcut="PIVX", + address_type=30, + address_type_p2sh=13, + maxfee_kb=100000, + signed_message_header="DarkNet Signed Message:\n", + xpub_magic=0x022d2533, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=119, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "PIVX Testnet": + return CoinInfo( + coin_name=name, + coin_shortcut="tPIVX", + address_type=139, + address_type_p2sh=19, + maxfee_kb=100000, + signed_message_header="DarkNet Signed Message:\n", + xpub_magic=0x3a8061a0, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=1, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Particl": + return CoinInfo( + coin_name=name, + coin_shortcut="PART", + address_type=56, + address_type_p2sh=60, + maxfee_kb=2000000, + signed_message_header="Bitcoin Signed Message:\n", + xpub_magic=0x8f1daeb8, + xpub_magic_segwit_p2sh=0x01b26ef6, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="bc", + cashaddr_prefix=None, + slip44=44, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Particl Testnet": + return CoinInfo( + coin_name=name, + coin_shortcut="tPART", + address_type=118, + address_type_p2sh=122, + maxfee_kb=10000000, + signed_message_header="Bitcoin Signed Message:\n", + xpub_magic=0x04889478, + xpub_magic_segwit_p2sh=0x044a5262, + xpub_magic_segwit_native=0x045f1cf6, + bech32_prefix="tb", + cashaddr_prefix=None, + slip44=1, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Pesetacoin": + return CoinInfo( + coin_name=name, + coin_shortcut="PTC", + address_type=47, + address_type_p2sh=22, + maxfee_kb=1000000000, + signed_message_header="Pesetacoin Signed Message:\n", + xpub_magic=0x0488c42e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=109, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Polis": + return CoinInfo( + coin_name=name, + coin_shortcut="POLIS", + address_type=55, + address_type_p2sh=56, + maxfee_kb=100000, + signed_message_header="Polis Signed Message:\n", + xpub_magic=0x03e25d7e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=1997, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Primecoin": + return CoinInfo( + coin_name=name, + coin_shortcut="XPM", + address_type=23, + address_type_p2sh=83, + maxfee_kb=1000000, + signed_message_header="Primecoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=24, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Qtum": + return CoinInfo( + coin_name=name, + coin_shortcut="QTUM", + address_type=58, + address_type_p2sh=50, + maxfee_kb=40000000, + signed_message_header="Qtum Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="qc", + cashaddr_prefix=None, + slip44=2301, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Qtum Testnet": + return CoinInfo( + coin_name=name, + coin_shortcut="tQTUM", + address_type=120, + address_type_p2sh=110, + maxfee_kb=40000000, + signed_message_header="Qtum Signed Message:\n", + xpub_magic=0x043587cf, + xpub_magic_segwit_p2sh=0x044a5262, + xpub_magic_segwit_native=0x045f1cf6, + bech32_prefix="tq", + cashaddr_prefix=None, + slip44=1, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Ravencoin": + return CoinInfo( + coin_name=name, + coin_shortcut="RVN", + address_type=60, + address_type_p2sh=122, + maxfee_kb=2000000, + signed_message_header="Raven Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=175, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Ritocoin": + return CoinInfo( + coin_name=name, + coin_shortcut="RITO", + address_type=25, + address_type_p2sh=105, + maxfee_kb=2000000, + signed_message_header="Rito Signed Message:\n", + xpub_magic=0x0534e7ca, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=19169, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "SmartCash": + return CoinInfo( + coin_name=name, + coin_shortcut="SMART", + address_type=63, + address_type_p2sh=18, + maxfee_kb=1000000, + signed_message_header="SmartCash Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=224, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1-smart', + confidential_assets=None, + ) + elif name == "SmartCash Testnet": + return CoinInfo( + coin_name=name, + coin_shortcut="tSMART", + address_type=65, + address_type_p2sh=21, + maxfee_kb=1000000, + signed_message_header="SmartCash Signed Message:\n", + xpub_magic=0x043587cf, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=224, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1-smart', + confidential_assets=None, + ) + elif name == "Stakenet": + return CoinInfo( + coin_name=name, + coin_shortcut="XSN", + address_type=76, + address_type_p2sh=16, + maxfee_kb=2000000, + signed_message_header="DarkCoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="xc", + cashaddr_prefix=None, + slip44=199, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Umbru": + return CoinInfo( + coin_name=name, + coin_shortcut="UMBRU", + address_type=68, + address_type_p2sh=5, + maxfee_kb=100000, + signed_message_header="DarkCoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=395, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "VIPSTARCOIN": + return CoinInfo( + coin_name=name, + coin_shortcut="VIPS", + address_type=70, + address_type_p2sh=50, + maxfee_kb=40000000, + signed_message_header="VIPSTARCOIN Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="vips", + cashaddr_prefix=None, + slip44=1919, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Vertcoin": + return CoinInfo( + coin_name=name, + coin_shortcut="VTC", + address_type=71, + address_type_p2sh=5, + maxfee_kb=40000000, + signed_message_header="Vertcoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="vtc", + cashaddr_prefix=None, + slip44=28, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Viacoin": + return CoinInfo( + coin_name=name, + coin_shortcut="VIA", + address_type=71, + address_type_p2sh=33, + maxfee_kb=40000000, + signed_message_header="Viacoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=0x049d7cb2, + xpub_magic_segwit_native=0x04b24746, + bech32_prefix="via", + cashaddr_prefix=None, + slip44=14, + segwit=True, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "ZClassic": + return CoinInfo( + coin_name=name, + coin_shortcut="ZCL", + address_type=7352, + address_type_p2sh=7357, + maxfee_kb=1000000, + signed_message_header="Zcash Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=147, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Zcash": + return CoinInfo( + coin_name=name, + coin_shortcut="ZEC", + address_type=7352, + address_type_p2sh=7357, + maxfee_kb=1000000, + signed_message_header="Zcash Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=133, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Zcash Testnet": + return CoinInfo( + coin_name=name, + coin_shortcut="TAZ", + address_type=7461, + address_type_p2sh=7354, + maxfee_kb=10000000, + signed_message_header="Zcash Signed Message:\n", + xpub_magic=0x043587cf, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=1, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Zcoin": + return CoinInfo( + coin_name=name, + coin_shortcut="XZC", + address_type=82, + address_type_p2sh=7, + maxfee_kb=1000000, + signed_message_header="Zcoin Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=136, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "Zcoin Testnet": + return CoinInfo( + coin_name=name, + coin_shortcut="tXZC", + address_type=65, + address_type_p2sh=178, + maxfee_kb=1000000, + signed_message_header="Zcoin Signed Message:\n", + xpub_magic=0x043587cf, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=1, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) + elif name == "ZelCash": + return CoinInfo( + coin_name=name, + coin_shortcut="ZEL", + address_type=7352, + address_type_p2sh=7357, + maxfee_kb=1000000, + signed_message_header="Zcash Signed Message:\n", + xpub_magic=0x0488b21e, + xpub_magic_segwit_p2sh=None, + xpub_magic_segwit_native=None, + bech32_prefix=None, + cashaddr_prefix=None, + slip44=19167, + segwit=False, + fork_id=None, + force_bip143=False, + bip115=False, + decred=False, + negative_fee=False, + curve_name='secp256k1', + confidential_assets=None, + ) raise ValueError('Unknown coin name "%s"' % name) diff --git a/core/src/apps/common/coininfo.py.mako b/core/src/apps/common/coininfo.py.mako index c97bda7e83..b7df1e314b 100644 --- a/core/src/apps/common/coininfo.py.mako +++ b/core/src/apps/common/coininfo.py.mako @@ -1,5 +1,6 @@ # generated from coininfo.py.mako # do not edit manually! +from trezor import utils from trezor.crypto.base58 import blake256d_32, groestl512d_32, keccak_32, sha256d_32 from trezor.crypto.scripts import blake256_ripemd160_digest, sha256_ripemd160_digest @@ -108,16 +109,33 @@ ATTRIBUTES = ( ("curve_name", lambda r: repr(r.replace("_", "-"))), ("confidential_assets", optional_dict), ) + +btc_names = ["Bitcoin", "Testnet", "Regtest"] + +coins_btc = [c for c in supported_on("trezor2", bitcoin) if c.name in btc_names] +coins_alt = [c for c in supported_on("trezor2", bitcoin) if c.name not in btc_names] + %>\ def by_name(name: str) -> CoinInfo: if False: pass -% for coin in supported_on("trezor2", bitcoin): +% for coin in coins_btc: elif name == ${black_repr(coin["coin_name"])}: return CoinInfo( % for attr, func in ATTRIBUTES: ${attr}=${func(coin[attr])}, % endfor ) +% endfor + if not utils.BITCOIN_ONLY: + if False: + pass +% for coin in coins_alt: + elif name == ${black_repr(coin["coin_name"])}: + return CoinInfo( + % for attr, func in ATTRIBUTES: + ${attr}=${func(coin[attr])}, + % endfor + ) % endfor raise ValueError('Unknown coin name "%s"' % name) diff --git a/core/src/main.py b/core/src/main.py index 859153b611..890d39a3a9 100644 --- a/core/src/main.py +++ b/core/src/main.py @@ -32,40 +32,45 @@ def _boot_default() -> None: import apps.homescreen import apps.management import apps.wallet - import apps.ethereum - import apps.lisk - import apps.monero - import apps.nem - import apps.stellar - import apps.ripple - import apps.cardano - import apps.tezos - import apps.eos - import apps.binance + + if not utils.BITCOIN_ONLY: + import apps.ethereum + import apps.lisk + import apps.monero + import apps.nem + import apps.stellar + import apps.ripple + import apps.cardano + import apps.tezos + import apps.eos + import apps.binance if __debug__: import apps.debug else: - import apps.webauthn + if not utils.BITCOIN_ONLY: + import apps.webauthn # boot applications apps.homescreen.boot() apps.management.boot() apps.wallet.boot() - apps.ethereum.boot() - apps.lisk.boot() - apps.monero.boot() - apps.nem.boot() - apps.stellar.boot() - apps.ripple.boot() - apps.cardano.boot() - apps.tezos.boot() - apps.eos.boot() - apps.binance.boot() + if not utils.BITCOIN_ONLY: + apps.ethereum.boot() + apps.lisk.boot() + apps.monero.boot() + apps.nem.boot() + apps.stellar.boot() + apps.ripple.boot() + apps.cardano.boot() + apps.tezos.boot() + apps.eos.boot() + apps.binance.boot() if __debug__: apps.debug.boot() else: - apps.webauthn.boot(usb.iface_webauthn) + if not utils.BITCOIN_ONLY: + apps.webauthn.boot(usb.iface_webauthn) # run main event loop and specify which screen is the default from apps.homescreen.homescreen import homescreen diff --git a/core/src/trezor/crypto/__init__.py b/core/src/trezor/crypto/__init__.py index 5d538d3e17..32879eeb1b 100644 --- a/core/src/trezor/crypto/__init__.py +++ b/core/src/trezor/crypto/__init__.py @@ -1,12 +1,14 @@ +from trezor import utils from trezorcrypto import ( # noqa: F401 aes, bip32, bip39, chacha20poly1305, crc, - monero, - nem, pbkdf2, random, rfc6979, ) + +if not utils.BITCOIN_ONLY: + from trezorcrypto import monero, nem # noqa: F401 diff --git a/core/src/trezor/crypto/curve.py b/core/src/trezor/crypto/curve.py index 98d093ea55..ea6e7e965a 100644 --- a/core/src/trezor/crypto/curve.py +++ b/core/src/trezor/crypto/curve.py @@ -1,7 +1,5 @@ -from trezorcrypto import ( # noqa: F401 - curve25519, - ed25519, - nist256p1, - secp256k1, - secp256k1_zkp, -) +from trezor import utils +from trezorcrypto import curve25519, ed25519, nist256p1, secp256k1 # noqa: F401 + +if not utils.BITCOIN_ONLY: + from trezorcrypto import secp256k1_zkp # noqa: F401 diff --git a/core/src/trezor/utils.py b/core/src/trezor/utils.py index a64b32e43f..f387923592 100644 --- a/core/src/trezor/utils.py +++ b/core/src/trezor/utils.py @@ -1,6 +1,7 @@ import gc import sys from trezorutils import ( # noqa: F401 + BITCOIN_ONLY, EMULATOR, GITREV, MODEL, From ca494940a53b5497e13ba2fc0acfb85e9569ddd1 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 22 Aug 2019 20:16:00 +0200 Subject: [PATCH 2/6] legacy: fill in Features.features --- legacy/firmware/fsm_msg_common.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/legacy/firmware/fsm_msg_common.h b/legacy/firmware/fsm_msg_common.h index 6231d8ff9a..594e3920c1 100644 --- a/legacy/firmware/fsm_msg_common.h +++ b/legacy/firmware/fsm_msg_common.h @@ -83,6 +83,22 @@ void fsm_msgGetFeatures(const GetFeatures *msg) { resp->has_model = true; strlcpy(resp->model, "1", sizeof(resp->model)); +#if BITCOIN_ONLY + resp->features_count = 2; + resp->features[0] = Feature_Feature_Bitcoin; + resp->features[1] = Feature_Feature_Crypto; +#else + resp->features_count = 8; + resp->features[0] = Feature_Feature_Bitcoin; + resp->features[1] = Feature_Feature_Bitcoin_like; + resp->features[2] = Feature_Feature_Crypto; + resp->features[3] = Feature_Feature_Ethereum; + resp->features[4] = Feature_Feature_Lisk; + resp->features[5] = Feature_Feature_NEM; + resp->features[6] = Feature_Feature_Stellar; + resp->features[7] = Feature_Feature_U2F; +#endif + msg_write(MessageType_MessageType_Features, resp); } From 9ae319211f47d329a5923a85f8a46bccd004dd72 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 22 Aug 2019 20:16:18 +0200 Subject: [PATCH 3/6] core: fill in Features.features --- core/src/apps/homescreen/__init__.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/core/src/apps/homescreen/__init__.py b/core/src/apps/homescreen/__init__.py index f80e08fbfc..08313f89b4 100644 --- a/core/src/apps/homescreen/__init__.py +++ b/core/src/apps/homescreen/__init__.py @@ -1,5 +1,5 @@ from trezor import config, utils, wire -from trezor.messages import MessageType +from trezor.messages import Feature, MessageType from trezor.messages.Features import Features from trezor.messages.Success import Success from trezor.wire import register @@ -36,6 +36,25 @@ def get_features() -> Features: f.no_backup = storage.device.no_backup() f.flags = storage.device.get_flags() f.recovery_mode = storage.recovery.is_in_progress() + if utils.BITCOIN_ONLY: + f.features = [Feature.Bitcoin, Feature.Crypto] + else: + f.features = [ + Feature.Bitcoin, + Feature.Bitcoin_like, + Feature.Binance, + Feature.Cardano, + Feature.Crypto, + Feature.EOS, + Feature.Ethereum, + Feature.Lisk, + Feature.Monero, + Feature.NEM, + Feature.Ripple, + Feature.Stellar, + Feature.Tezos, + Feature.U2F, + ] return f From 4036f2243bb2a4c7c83b00ef1b679c56c672fb2e Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 22 Aug 2019 20:16:54 +0200 Subject: [PATCH 4/6] core: introduce linker script for BITCOIN_ONLY --- core/embed/firmware/memory_T_min.ld | 79 +++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 core/embed/firmware/memory_T_min.ld diff --git a/core/embed/firmware/memory_T_min.ld b/core/embed/firmware/memory_T_min.ld new file mode 100644 index 0000000000..e253c8ea3f --- /dev/null +++ b/core/embed/firmware/memory_T_min.ld @@ -0,0 +1,79 @@ +/* TREZORv2 firmware linker script */ + +ENTRY(reset_handler) + +MEMORY { + FLASH (rx) : ORIGIN = 0x08040000, LENGTH = 768K + FLASH2 (r) : ORIGIN = 0x08120000, LENGTH = 896K + CCMRAM (wal) : ORIGIN = 0x10000000, LENGTH = 64K + SRAM (wal) : ORIGIN = 0x20000000, LENGTH = 192K +} + +main_stack_base = ORIGIN(SRAM) + LENGTH(SRAM); /* 8-byte aligned full descending stack */ +_estack = main_stack_base; + +/* used by the startup code to populate variables used by the C code */ +data_lma = LOADADDR(.data); +data_vma = ADDR(.data); +data_size = SIZEOF(.data); + +/* used by the startup code to wipe memory */ +ccmram_start = ORIGIN(CCMRAM); +ccmram_end = ORIGIN(CCMRAM) + LENGTH(CCMRAM); + +/* used by the startup code to wipe memory */ +sram_start = ORIGIN(SRAM); +sram_end = ORIGIN(SRAM) + LENGTH(SRAM); +_ram_start = sram_start; +_ram_end = sram_end; + +_codelen = LENGTH(FLASH) - SIZEOF(.vendorheader) - SIZEOF(.header) + SIZEOF(.flash2); +_flash_start = ORIGIN(FLASH); +_flash_end = ORIGIN(FLASH) + LENGTH(FLASH); +_heap_start = ADDR(.heap); +_heap_end = ADDR(.heap) + SIZEOF(.heap); + +SECTIONS { + .vendorheader : ALIGN(4) { + KEEP(*(.vendorheader)) + } >FLASH AT>FLASH + + .header : ALIGN(4) { + KEEP(*(.header)); + } >FLASH AT>FLASH + + .flash2 : ALIGN(512) { + build/firmware/frozen_mpy.o(.rodata*); + . = ALIGN(512); + } >FLASH2 AT>FLASH2 + + .flash : ALIGN(512) { + KEEP(*(.vector_table)); + . = ALIGN(4); + *(.text*); + . = ALIGN(4); + *(.rodata*); + . = ALIGN(4); + *(.bootloader*); + . = ALIGN(512); + } >FLASH AT>FLASH + + .data : ALIGN(4) { + *(.data*); + . = ALIGN(512); + } >SRAM AT>FLASH + + .bss : ALIGN(4) { + *(.bss*); + . = ALIGN(4); + } >SRAM + + .heap : ALIGN(4) { + . = 37K; /* this acts as a build time assertion that at least this much memory is available for heap use */ + . = ABSOLUTE(sram_end - 16K); /* this explicitly sets the end of the heap effectively giving the stack at most 16K */ + } >SRAM + + .stack : ALIGN(8) { + . = 4K; /* this acts as a build time assertion that at least this much memory is available for stack use */ + } >SRAM +} From 8a61ef4f6e2dc0d23b8363943a1bc9a2e74123be Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 22 Aug 2019 20:18:26 +0200 Subject: [PATCH 5/6] core: unroll the utils.BITCOIN_ONLY constant in mpy-cross --- core/site_scons/site_tools/micropython/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/site_scons/site_tools/micropython/__init__.py b/core/site_scons/site_tools/micropython/__init__.py index a149e6c02b..fa60d1ac83 100644 --- a/core/site_scons/site_tools/micropython/__init__.py +++ b/core/site_scons/site_tools/micropython/__init__.py @@ -23,7 +23,10 @@ def generate(env): target = str(target[0]) source = str(source[0]) source_name = source.replace(env['source_dir'], '') - return '$MPY_CROSS -o %s -s %s %s' % (target, source_name, source) + # unroll the utils.BITCOIN_ONLY constant + btc_only = 'True' if env['bitcoin_only'] == '1' else 'False' + interim = "%s.i" % target[:-4] # replace .mpy with .i + return '$SED "s:utils\.BITCOIN_ONLY:%s:g" %s > %s && $MPY_CROSS -o %s -s %s %s' % (btc_only, source, interim, target, source_name, interim) env['BUILDERS']['FrozenModule'] = SCons.Builder.Builder( generator=generate_frozen_module, From b1f435e1784fafe24ff78d92de9428e6b3925e04 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 22 Aug 2019 20:18:44 +0200 Subject: [PATCH 6/6] ci: test BITCOIN_ONLY firmware --- ci/build.yml | 35 ++++++++++++++++++++++++++++++++++ ci/test.yml | 23 ++++++++++++++++++++++ tests/device_tests/conftest.py | 4 ++++ 3 files changed, 62 insertions(+) diff --git a/ci/build.yml b/ci/build.yml index db2eb72a9b..25e2c96569 100644 --- a/ci/build.yml +++ b/ci/build.yml @@ -24,6 +24,20 @@ build core firmware: - core/build/bootloader/bootloader.bin expire_in: 1 week +build core firmware bitcoinonly: + stage: build + variables: + BITCOIN_ONLY: "1" + script: + - cd core + - pipenv run make build_firmware + - mv build/firmware/firmware.bin build/firmware/firmware-bitcoinonly.bin + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + paths: + - core/build/firmware/firmware-bitcoinonly.bin + expire_in: 1 week + build core unix: stage: build script: @@ -42,6 +56,21 @@ build core unix frozen: - core/src/trezor/res/resources.py expire_in: 1 day +build core unix frozen bitcoinonly: + stage: build + variables: + BITCOIN_ONLY: "1" + script: + - cd core + - pipenv run make build_unix_frozen + - mv build/unix/micropython build/unix/micropython-bitcoinonly + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + paths: + - core/build/unix/micropython-bitcoinonly + - core/src/trezor/res/resources.py + expire_in: 1 day + # Crypto @@ -110,3 +139,9 @@ build legacy emu bitcoinonly: script: - cd legacy - pipenv run script/cibuild + - mv firmware/trezor.elf firmware/trezor-bitcoinonly.elf + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" + paths: + - legacy/firmware/trezor-bitcoinonly.elf + expire_in: 1 day diff --git a/ci/test.yml b/ci/test.yml index d8549d62c1..48e8d65980 100644 --- a/ci/test.yml +++ b/ci/test.yml @@ -18,6 +18,17 @@ test core unix device: - cd core - pipenv run make test_emu +test core unix device bitcoinonly: + stage: test + dependencies: + - build core unix frozen bitcoinonly + variables: + MICROPYTHON: "../build/unix/micropython-bitcoinonly" + TREZOR_PYTEST_SKIP_ALTCOINS: 1 + script: + - cd core + - pipenv run make test_emu + test core unix monero: stage: test dependencies: @@ -54,6 +65,18 @@ test legacy emu: - cd legacy - pipenv run script/test +test legacy emu bitcoinonly: + stage: test + dependencies: + - build legacy emu bitcoinonly + variables: + EMULATOR: "1" + EMULATOR_BINARY: "firmware/trezor-bitcoinonly.elf" + TREZOR_PYTEST_SKIP_ALTCOINS: 1 + script: + - cd legacy + - pipenv run script/test + # Python diff --git a/tests/device_tests/conftest.py b/tests/device_tests/conftest.py index 59036c02c1..5640cc4612 100644 --- a/tests/device_tests/conftest.py +++ b/tests/device_tests/conftest.py @@ -127,6 +127,10 @@ def pytest_runtest_setup(item): if item.get_closest_marker("skip_t1") and item.get_closest_marker("skip_t2"): pytest.fail("Don't skip tests for both trezors!") + if item.get_closest_marker("altcoin") and os.environ.get( + "TREZOR_PYTEST_SKIP_ALTCOINS", 0 + ): + pytest.skip("Skipping altcoin test") if item.get_closest_marker("skip_t2") and TREZOR_VERSION == 2: pytest.skip("Test excluded on Trezor T") if item.get_closest_marker("skip_t1") and TREZOR_VERSION == 1: