From fc6ec565a15d402264182e8247794132ed675a1e Mon Sep 17 00:00:00 2001 From: Fabien Date: Mon, 6 Sep 2021 11:55:39 +0200 Subject: [PATCH] feat(core): Add coin definition for eCash --- common/defs/bitcoin/ecash.json | 44 ++++++++++ common/defs/bitcoin/ecash.png | Bin 0 -> 5417 bytes common/defs/support.json | 6 ++ core/src/apps/common/coininfo.py | 145 +++++++++++++++++++++++++++++++ 4 files changed, 195 insertions(+) create mode 100644 common/defs/bitcoin/ecash.json create mode 100644 common/defs/bitcoin/ecash.png diff --git a/common/defs/bitcoin/ecash.json b/common/defs/bitcoin/ecash.json new file mode 100644 index 0000000000..afdc4698cb --- /dev/null +++ b/common/defs/bitcoin/ecash.json @@ -0,0 +1,44 @@ +{ + "coin_name": "Ecash", + "coin_shortcut": "XEC", + "coin_label": "eCash", + "website": "https://e.cash", + "github": "https://github.com/Bitcoin-ABC/bitcoin-abc", + "maintainer": "Fabien ", + "curve_name": "secp256k1", + "decimals": 2, + "address_type": 0, + "address_type_p2sh": 5, + "maxfee_kb": 14000000, + "minfee_kb": 1000, + "signed_message_header": "eCash Signed Message:\n", + "hash_genesis_block": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f", + "xprv_magic": 76066276, + "xpub_magic": 76067358, + "xpub_magic_segwit_p2sh": null, + "xpub_magic_segwit_native": null, + "xpub_magic_multisig_segwit_p2sh": null, + "xpub_magic_multisig_segwit_native": null, + "bech32_prefix": null, + "cashaddr_prefix": "ecash", + "slip44": 899, + "segwit": false, + "taproot": false, + "decred": false, + "fork_id": 0, + "force_bip143": true, + "default_fee_b": { + "Normal": 1 + }, + "dust_limit": 546, + "blocktime_seconds": 600, + "uri_prefix": "ecash", + "min_address_length": 27, + "max_address_length": 34, + "negative_fee": false, + "cooldown": 100, + "overwintered": false, + "extra_data": false, + "timestamp": false, + "confidential_assets": null +} diff --git a/common/defs/bitcoin/ecash.png b/common/defs/bitcoin/ecash.png new file mode 100644 index 0000000000000000000000000000000000000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JdSd}$Ss-V)}1kN)6WPp&`u2GVSZ4rQd;A|g^$hp*=+}oq?5YRQB@Q1G=89)*^ zrGStOLQKa`>G}Z(1mV)V-I~Er4~}MlngO8%kmZ93xiC{6yxQ`ycyv==e9Zp?*GczQ T((G=_00000NkvXXu0mjfT7G0u literal 0 HcmV?d00001 diff --git a/common/defs/support.json b/common/defs/support.json index 0c8e90c9d6..24edcf57f7 100644 --- a/common/defs/support.json +++ b/common/defs/support.json @@ -41,6 +41,7 @@ "bitcoin:VIA": "1.6.2", "bitcoin:VIPS": "1.8.2", "bitcoin:VTC": "1.6.1", + "bitcoin:XEC": "1.12.2", "bitcoin:XPM": "1.8.0", "bitcoin:XRC": "1.8.2", "bitcoin:XSN": "1.8.0", @@ -147,6 +148,7 @@ "bitcoin:UNO": "2.6.1", "bitcoin:VIA": "2.6.1", "bitcoin:VIPS": "2.6.1", + "bitcoin:XEC": "2.8.6", "bitcoin:XPM": "2.6.1", "bitcoin:XRC": "2.6.1", "bitcoin:XSN": "2.6.1", @@ -269,6 +271,7 @@ "bitcoin:VIA": "2.0.7", "bitcoin:VIPS": "2.1.1", "bitcoin:VTC": "2.0.5", + "bitcoin:XEC": "2.8.6", "bitcoin:XPM": "2.0.11", "bitcoin:XRC": "2.1.1", "bitcoin:XSN": "2.0.11", @@ -375,6 +378,7 @@ "bitcoin:UNO": "2.8.1", "bitcoin:VIA": "2.8.1", "bitcoin:VIPS": "2.8.1", + "bitcoin:XEC": "2.8.6", "bitcoin:XPM": "2.8.1", "bitcoin:XRC": "2.8.1", "bitcoin:XSN": "2.8.1", @@ -489,6 +493,7 @@ "bitcoin:UNO": "2.6.1", "bitcoin:VIA": "2.6.1", "bitcoin:VIPS": "2.6.1", + "bitcoin:XEC": "2.8.6", "bitcoin:XPM": "2.6.1", "bitcoin:XRC": "2.6.1", "bitcoin:XSN": "2.6.1", @@ -603,6 +608,7 @@ "bitcoin:UNO": "2.6.1", "bitcoin:VIA": "2.6.1", "bitcoin:VIPS": "2.6.1", + "bitcoin:XEC": "2.8.6", "bitcoin:XPM": "2.6.1", "bitcoin:XRC": "2.6.1", "bitcoin:XSN": "2.6.1", diff --git a/core/src/apps/common/coininfo.py b/core/src/apps/common/coininfo.py index 90c4704149..602f2ada3f 100644 --- a/core/src/apps/common/coininfo.py +++ b/core/src/apps/common/coininfo.py @@ -1372,6 +1372,35 @@ def by_name(name: str) -> CoinInfo: True, # overwintered None, # confidential_assets ) + if name == "Ecash": + return CoinInfo( + name, # coin_name + "XEC", # coin_shortcut + 2, # decimals + 0, # address_type + 5, # address_type_p2sh + 14000000, # maxfee_kb + "eCash Signed Message:\n", # signed_message_header + 0x0488b21e, # xpub_magic + None, # xpub_magic_segwit_p2sh + None, # xpub_magic_segwit_native + None, # xpub_magic_multisig_segwit_p2sh + None, # xpub_magic_multisig_segwit_native + None, # bech32_prefix + "ecash", # cashaddr_prefix + 899, # slip44 + False, # segwit + False, # taproot + 0, # fork_id + True, # force_bip143 + False, # decred + False, # negative_fee + 'secp256k1', # curve_name + False, # extra_data + False, # timestamp + False, # overwintered + None, # confidential_assets + ) if name == "Brhodium": return CoinInfo( name, # coin_name @@ -2941,6 +2970,35 @@ def by_name(name: str) -> CoinInfo: True, # overwintered None, # confidential_assets ) + if name == "Ecash": + return CoinInfo( + name, # coin_name + "XEC", # coin_shortcut + 2, # decimals + 0, # address_type + 5, # address_type_p2sh + 14000000, # maxfee_kb + "eCash Signed Message:\n", # signed_message_header + 0x0488b21e, # xpub_magic + None, # xpub_magic_segwit_p2sh + None, # xpub_magic_segwit_native + None, # xpub_magic_multisig_segwit_p2sh + None, # xpub_magic_multisig_segwit_native + None, # bech32_prefix + "ecash", # cashaddr_prefix + 899, # slip44 + False, # segwit + False, # taproot + 0, # fork_id + True, # force_bip143 + False, # decred + False, # negative_fee + 'secp256k1', # curve_name + False, # extra_data + False, # timestamp + False, # overwintered + None, # confidential_assets + ) if name == "Brhodium": return CoinInfo( name, # coin_name @@ -4249,6 +4307,35 @@ def by_name(name: str) -> CoinInfo: True, # overwintered None, # confidential_assets ) + if name == "Ecash": + return CoinInfo( + name, # coin_name + "XEC", # coin_shortcut + 2, # decimals + 0, # address_type + 5, # address_type_p2sh + 14000000, # maxfee_kb + "eCash Signed Message:\n", # signed_message_header + 0x0488b21e, # xpub_magic + None, # xpub_magic_segwit_p2sh + None, # xpub_magic_segwit_native + None, # xpub_magic_multisig_segwit_p2sh + None, # xpub_magic_multisig_segwit_native + None, # bech32_prefix + "ecash", # cashaddr_prefix + 899, # slip44 + False, # segwit + False, # taproot + 0, # fork_id + True, # force_bip143 + False, # decred + False, # negative_fee + 'secp256k1', # curve_name + False, # extra_data + False, # timestamp + False, # overwintered + None, # confidential_assets + ) if name == "Brhodium": return CoinInfo( name, # coin_name @@ -5557,6 +5644,35 @@ def by_name(name: str) -> CoinInfo: True, # overwintered None, # confidential_assets ) + if name == "Ecash": + return CoinInfo( + name, # coin_name + "XEC", # coin_shortcut + 2, # decimals + 0, # address_type + 5, # address_type_p2sh + 14000000, # maxfee_kb + "eCash Signed Message:\n", # signed_message_header + 0x0488b21e, # xpub_magic + None, # xpub_magic_segwit_p2sh + None, # xpub_magic_segwit_native + None, # xpub_magic_multisig_segwit_p2sh + None, # xpub_magic_multisig_segwit_native + None, # bech32_prefix + "ecash", # cashaddr_prefix + 899, # slip44 + False, # segwit + False, # taproot + 0, # fork_id + True, # force_bip143 + False, # decred + False, # negative_fee + 'secp256k1', # curve_name + False, # extra_data + False, # timestamp + False, # overwintered + None, # confidential_assets + ) if name == "Brhodium": return CoinInfo( name, # coin_name @@ -6865,6 +6981,35 @@ def by_name(name: str) -> CoinInfo: True, # overwintered None, # confidential_assets ) + if name == "Ecash": + return CoinInfo( + name, # coin_name + "XEC", # coin_shortcut + 2, # decimals + 0, # address_type + 5, # address_type_p2sh + 14000000, # maxfee_kb + "eCash Signed Message:\n", # signed_message_header + 0x0488b21e, # xpub_magic + None, # xpub_magic_segwit_p2sh + None, # xpub_magic_segwit_native + None, # xpub_magic_multisig_segwit_p2sh + None, # xpub_magic_multisig_segwit_native + None, # bech32_prefix + "ecash", # cashaddr_prefix + 899, # slip44 + False, # segwit + False, # taproot + 0, # fork_id + True, # force_bip143 + False, # decred + False, # negative_fee + 'secp256k1', # curve_name + False, # extra_data + False, # timestamp + False, # overwintered + None, # confidential_assets + ) if name == "Brhodium": return CoinInfo( name, # coin_name