Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update segwit derivation paths #851

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions coins
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/0'",
"derivation_path": "m/84'/0'",
"trezor_coin": "Bitcoin",
"links": {
"github": "https://github.com/bitcoin/bitcoin",
Expand Down Expand Up @@ -2324,7 +2324,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/160'",
"derivation_path": "m/84'/160'",
"trezor_coin": "Bitcore",
"links": {
"github": "https://github.com/LIMXTEC/BitCore",
Expand Down Expand Up @@ -2604,7 +2604,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/34'"
"derivation_path": "m/84'/34'"
},
{
"coin": "CEL-ERC20",
Expand Down Expand Up @@ -3226,7 +3226,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/802'",
"derivation_path": "m/84'/802'",
"links": {
"github": "https://github.com/cyberyen/cyberyen",
"homepage": "https://cyberyen.org"
Expand Down Expand Up @@ -3517,7 +3517,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/20'",
"derivation_path": "m/84'/20'",
"trezor_coin": "DigiByte",
"links": {
"github": "https://github.com/digibyte/digibyte",
Expand Down Expand Up @@ -4661,7 +4661,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/75'",
"derivation_path": "m/84'/75'",
"trezor_coin": "Fujicoin",
"links": {
"github": "https://github.com/fujicoin/fujicoin",
Expand Down Expand Up @@ -4827,7 +4827,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/8'",
"derivation_path": "m/84'/8'",
"trezor_coin": "Feathercoin",
"links": {
"github": "https://github.com/FeatherCoin/Feathercoin",
Expand Down Expand Up @@ -5442,7 +5442,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/17'",
"derivation_path": "m/84'/17'",
"trezor_coin": "Groestlcoin",
"links": {
"github": "https://github.com/Groestlcoin/groestlcoin",
Expand Down Expand Up @@ -6909,7 +6909,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/140'"
"derivation_path": "m/84'/140'"
},
{
"coin": "LCC",
Expand Down Expand Up @@ -6959,7 +6959,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/192'"
"derivation_path": "m/84'/192'"
},
{
"coin": "LDO-ERC20",
Expand Down Expand Up @@ -7313,7 +7313,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/613'"
"derivation_path": "m/84'/613'"
},
{
"coin": "LEASH-ERC20",
Expand Down Expand Up @@ -7444,7 +7444,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/2'",
"derivation_path": "m/84'/2'",
"trezor_coin": "Litecoin",
"links": {
"github": "https://github.com/litecoin-project/litecoin",
Expand Down Expand Up @@ -8146,7 +8146,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/22'",
"derivation_path": "m/84'/22'",
"trezor_coin": "Monacoin",
"links": {
"github": "https://github.com/monacoinproject/monacoin",
Expand Down Expand Up @@ -8388,7 +8388,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/7'",
"derivation_path": "m/84'/7'",
"trezor_coin": "Namecoin",
"links": {
"github": "https://github.com/namecoin/namecoin-core",
Expand Down Expand Up @@ -9499,7 +9499,7 @@
"protocol": {
"type": "QTUM"
},
"derivation_path": "m/44'/2301'",
"derivation_path": "m/84'/2301'",
"trezor_coin": "Qtum",
"links": {
"github": "https://github.com/qtumproject/qtum",
Expand Down Expand Up @@ -9744,7 +9744,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/143'"
"derivation_path": "m/84'/143'"
},
{
"coin": "NFTX",
Expand Down Expand Up @@ -10587,7 +10587,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/57'",
"derivation_path": "m/84'/57'",
"trezor_coin": "Syscoin",
"links": {
"github": "https://github.com/syscoin/syscoin",
Expand Down Expand Up @@ -11987,7 +11987,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/14'",
"derivation_path": "m/84'/14'",
"trezor_coin": "Viacoin",
"links": {
"github": "https://github.com/viacoin",
Expand Down Expand Up @@ -12130,7 +12130,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/28'",
"derivation_path": "m/84'/28'",
"trezor_coin": "Vertcoin",
"links": {
"github": "https://github.com/vertcoin-project/vertcoin-core",
Expand Down Expand Up @@ -12374,7 +12374,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/597'"
"derivation_path": "m/84'/597'"
},
{
"coin": "XEP-BEP20",
Expand Down Expand Up @@ -12491,7 +12491,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/90'"
"derivation_path": "m/84'/90'"
},
{
"coin": "XNA",
Expand Down Expand Up @@ -13935,7 +13935,7 @@
"protocol": {
"type": "UTXO"
},
"derivation_path": "m/44'/202'",
"derivation_path": "m/84'/202'",
"links": {
"github": "https://github.com/fiscalobject/ufo",
"homepage": "https://ufobject.com"
Expand Down
22 changes: 22 additions & 0 deletions utils/generate_app_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,22 @@ def filter_wss(coins_config):
json.dump(coins_config_wss, f, indent=4)
return coins_config_wss

def scan_segwit(coins_config):
no_tc = []
no_dv = []
bad_dv = []
for coin in coins_config:
if coin.endswith('-segwit'):
if "derivation_path" not in coins_config[coin]:
print(colorize(f"{coin} has no derivation path!", 'red'))
no_dv.append(coin)
elif coins_config[coin]["derivation_path"].startswith("m/84'") == False:
print(colorize(f"{coin} has non-segwit derivation path!", 'red'))
bad_dv.append(coin)
if "trezor_coin" not in coins_config[coin]:
print(colorize(f"{coin} has no trezor coin!", 'red'))
no_tc.append(coin)
return no_dv, bad_dv, no_tc


if __name__ == "__main__":
Expand All @@ -611,3 +627,9 @@ def filter_wss(coins_config):
print(f"Total coins with SSL: {len(coins_config_ssl)}")
print(f"Total coins with TCP: {len(coins_config_tcp)}")
print(f"Total coins with WSS: {len(coins_config_wss)}")
no_dv, bad_dv, no_tc = scan_segwit(coins_config)
print(f"Segwit coins with no derivation path: {no_dv}")
print(f"Segwit coins with bad derivation path: {bad_dv}")
print(f"Segwit coins with no trezor coin: {no_tc}")


2 changes: 2 additions & 0 deletions utils/scan_electrums.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def thread_ws(coin, ip, port, method, params):
passed_ws[coin].append(f"{ip}:{port}")

except Exception as e:
# TODO: Fix this
resp = ""
if str(resp).find('{"jsonrpc": "2.0"') > -1:
if coin not in passed_ws:
passed_ws.update({coin:[]})
Expand Down
2 changes: 1 addition & 1 deletion utils/update_derivation_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
proto = i['protocol']['type']
if proto in ["UTXO", "QTUM"]:
if 'derivation_path' in i:
path = i['derivation_path']
path = i['derivation_path'].replace("m/44'", "m/84'")
for i in coins:
if i["coin"] == coin:
if path != "":
Expand Down