From b4b2a28bfd830b53e8434d2f438413b6edbbbdba Mon Sep 17 00:00:00 2001 From: Joshua Infante Date: Fri, 21 Apr 2023 08:26:24 -0700 Subject: [PATCH 1/5] New Cryptocurrencies: Evrmore "EVR", Foxdcoin "FOXD", and Aviancoin "AVN" wallet protocols added. --- .gitignore | 2 + hdwallet/cryptocurrencies.py | 245 ++++++++++++++++++++++++++++++++++- hdwallet/symbols.py | 13 +- 3 files changed, 256 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 3c1a6c2..5d8f3a2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,11 @@ make.bat Makefile # Folders stuff +env/ experiment/ .idea/ .tox/ +.vs/ # Setuptools stuff build/ diff --git a/hdwallet/cryptocurrencies.py b/hdwallet/cryptocurrencies.py index ef24396..63a33e7 100644 --- a/hdwallet/cryptocurrencies.py +++ b/hdwallet/cryptocurrencies.py @@ -354,6 +354,46 @@ class AuroracoinMainnet(Cryptocurrency): WIF_SECRET_KEY = 0x97 +class AviancoinMainnet(Cryptocurrency): + NAME = "Aviancoin" + SYMBOL = "AVN" + NETWORK = "mainnet" + SOURCE_CODE = "https://github.com/AvianNetwork/Avian" + COIN_TYPE = CoinType({ + "INDEX": 921, + "HARDENED": True + }) + + SCRIPT_ADDRESS = 0x7a + PUBLIC_KEY_ADDRESS = 0x3c + SEGWIT_ADDRESS = SegwitAddress({ + "HRP": None, + "VERSION": 0x00 + }) + + EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ + "P2PKH": 0x488ade4, + "P2SH": 0x488ade4, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ + "P2PKH": 0x488b21e, + "P2SH": 0x488b21e, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + MESSAGE_PREFIX = "Aviancoin Signed Message:\n" + DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" + WIF_SECRET_KEY = 0x80 + + class AxeMainnet(Cryptocurrency): NAME = "Axe" @@ -2154,6 +2194,88 @@ class EuropeCoinMainnet(Cryptocurrency): WIF_SECRET_KEY = 0xa8 +class EvrmoreMainnet(Cryptocurrency): + + NAME = "Evrmore" + SYMBOL = "EVR" + NETWORK = "mainnet" + SOURCE_CODE = "https://github.com/EvrmoreOrg/Evrmore" + COIN_TYPE = CoinType({ + "INDEX": 175, + "HARDENED": True + }) + + SCRIPT_ADDRESS = 0x5c + PUBLIC_KEY_ADDRESS = 0x21 + SEGWIT_ADDRESS = SegwitAddress({ + "HRP": None, + "VERSION": 0x00 + }) + + EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ + "P2PKH": 0x488ade4, + "P2SH": 0x488ade4, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ + "P2PKH": 0x488b21e, + "P2SH": 0x488b21e, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + MESSAGE_PREFIX = "Evrmore Signed Message:\n" + DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" + WIF_SECRET_KEY = 0x80 + + +class EvrmoreTestnet(Cryptocurrency): + + NAME = "Evrmore" + SYMBOL = "EVRTEST" + NETWORK = "testnet" + SOURCE_CODE = "https://github.com/EvrmoreOrg/Evrmore" + COIN_TYPE = CoinType({ + "INDEX": 1, + "HARDENED": True + }) + + SCRIPT_ADDRESS = 0xc4 + PUBLIC_KEY_ADDRESS = 0x6f + SEGWIT_ADDRESS = SegwitAddress({ + "HRP": None, + "VERSION": 0x00 + }) + + EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ + "P2PKH": 0x04358394, + "P2SH": 0x04358394, + "P2WPKH": 0x04358394, + "P2WPKH_IN_P2SH": 0x04358394, + "P2WSH": 0x04358394, + "P2WSH_IN_P2SH": 0x04358394 + }) + + EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ + "P2PKH": 0x043587cf, + "P2SH": 0x043587cf, + "P2WPKH": 0x043587cf, + "P2WPKH_IN_P2SH": 0x043587cf, + "P2WSH": 0x043587cf, + "P2WSH_IN_P2SH": 0x043587cf + }) + + MESSAGE_PREFIX = "Evrmore Signed Message:\n" + DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" + WIF_SECRET_KEY = 0xef + + class ExclusiveCoinMainnet(Cryptocurrency): NAME = "Exclusive Coin" @@ -2431,6 +2553,89 @@ class FluxMainnet(Cryptocurrency): DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" WIF_SECRET_KEY = 0x80 + +class FoxdcoinMainnet(Cryptocurrency): + + NAME = "Foxdcoin" + SYMBOL = "FOXD" + NETWORK = "mainnet" + SOURCE_CODE = "https://github.com/foxdproject/foxdcoin" + COIN_TYPE = CoinType({ + "INDEX": 175, + "HARDENED": True + }) + + SCRIPT_ADDRESS = 0x1e + PUBLIC_KEY_ADDRESS = 0x23 + SEGWIT_ADDRESS = SegwitAddress({ + "HRP": None, + "VERSION": 0x00 + }) + + EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ + "P2PKH": 0x488ade4, + "P2SH": 0x488ade4, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ + "P2PKH": 0x488b21e, + "P2SH": 0x488b21e, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + MESSAGE_PREFIX = "Foxdcoin Signed Message:\n" + DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" + WIF_SECRET_KEY = 0x80 + + +class FoxdcoinTestnet(Cryptocurrency): + + NAME = "Foxdcoin" + SYMBOL = "FOXDTEST" + NETWORK = "testnet" + SOURCE_CODE = "https://github.com/foxdproject/foxdcoin" + COIN_TYPE = CoinType({ + "INDEX": 1, + "HARDENED": True + }) + + SCRIPT_ADDRESS = 0x5a + PUBLIC_KEY_ADDRESS = 0x5f + SEGWIT_ADDRESS = SegwitAddress({ + "HRP": None, + "VERSION": 0x00 + }) + + EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ + "P2PKH": 0x488ade4, + "P2SH": 0x488ade4, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ + "P2PKH": 0x488b21e, + "P2SH": 0x488b21e, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + MESSAGE_PREFIX = "Foxdcoin Signed Message:\n" + DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" + WIF_SECRET_KEY = 0xef + + class FujiCoinMainnet(Cryptocurrency): NAME = "Fuji Coin" @@ -4836,7 +5041,7 @@ class RavencoinMainnet(Cryptocurrency): NAME = "Ravencoin" SYMBOL = "RVN" NETWORK = "mainnet" - SOURCE_CODE = None + SOURCE_CODE = "https://github.com/RavenProject/Ravencoin" COIN_TYPE = CoinType({ "INDEX": 175, "HARDENED": True @@ -4866,11 +5071,47 @@ class RavencoinMainnet(Cryptocurrency): "P2WSH_IN_P2SH": None }) - MESSAGE_PREFIX = "Raven Signed Message:\n" + MESSAGE_PREFIX = "Raven Signed Message:\n" DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" WIF_SECRET_KEY = 0x80 +class RavencoinTestnet(Cryptocurrency): + + NAME = "Ravencoin" + SYMBOL = "RVNTEST" + NETWORK = "testnet" + SOURCE_CODE = "https://github.com/RavenProject/Ravencoin" + COIN_TYPE = CoinType({ + "INDEX": 1, + "HARDENED": True + }) + + SCRIPT_ADDRESS = 0xc4 + PUBLIC_KEY_ADDRESS = 0x6f + SEGWIT_ADDRESS = SegwitAddress({ + "HRP": None, + "VERSION": 0x00 + }) + + EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ + "P2PKH": 0x04358394, + "P2SH": 0x04358394, + "P2WPKH": 0x04358394, + "P2WPKH_IN_P2SH": 0x04358394, + "P2WSH": 0x04358394, + "P2WSH_IN_P2SH": 0x04358394 + }) + EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ + "P2PKH": 0x043587cf, + "P2SH": 0x043587cf, + "P2WPKH": 0x043587cf, + "P2WPKH_IN_P2SH": 0x043587cf, + "P2WSH": 0x043587cf, + "P2WSH_IN_P2SH": 0x043587cf + }) + + class ReddcoinMainnet(Cryptocurrency): NAME = "Reddcoin" diff --git a/hdwallet/symbols.py b/hdwallet/symbols.py index 531f6ea..e78d379 100644 --- a/hdwallet/symbols.py +++ b/hdwallet/symbols.py @@ -14,6 +14,8 @@ ATOM = "ATOM" # Auroracoin AUR = "AUR" +# Aviancoin +AVN = "AVN" # Axe AXE = "AXE" # Bata @@ -96,6 +98,8 @@ ETH = "ETH" # Europe Coin ERC = "ERC" +# Evrmore +EVR, EVRTEST = "EVR", "EVRTEST" # Exclusive Coin EXCL = "EXCL" # FIX @@ -108,6 +112,8 @@ FLASH = "FLASH" # Flux FLUX = "FLUX" +# Foxdcoin +FOXD, FOXDTEST = "FOXD", "FOXDTEST" # Fuji Coin FJC = "FJC" # GCR Coin @@ -217,7 +223,7 @@ # Rapids RPD = "RPD" # Ravencoin -RVN = "RVN" +RVN, RVNTEST = "RVN", "RVNTEST" # Reddcoin RDD = "RDD" # Rubycoin @@ -296,6 +302,7 @@ "AC", "ATOM", "AUR", + "AVN", "AXE", "BTA", "BEET", @@ -337,12 +344,14 @@ "NRG", "ETH", "ERC", + "EVR", "EVRTEST", "EXCL", "FIX", "FIXTEST", "FLUX", "FTC", "FRST", "FLASH", + "FOXD", "FOXDTEST", "FJC", "GCR", "GAME", @@ -397,7 +406,7 @@ "QTUM", "QTUMTEST", "RBTC", "RBTCTEST", "RPD", - "RVN", + "RVN", "RVNTEST", "RDD", "RBY", "SAFE", From 0763022abd645bd684aae057eb2e3564a66605d3 Mon Sep 17 00:00:00 2001 From: Joshua Infante Date: Fri, 21 Apr 2023 08:26:24 -0700 Subject: [PATCH 2/5] New Cryptocurrencies: Evrmore "EVR", Foxdcoin "FOXD", and Aviancoin "AVN" wallet protocols added. --- .gitignore | 2 + hdwallet/cryptocurrencies.py | 245 ++++++++++++++++++++++++++++++++++- hdwallet/symbols.py | 13 +- 3 files changed, 256 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 3c1a6c2..5d8f3a2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,11 @@ make.bat Makefile # Folders stuff +env/ experiment/ .idea/ .tox/ +.vs/ # Setuptools stuff build/ diff --git a/hdwallet/cryptocurrencies.py b/hdwallet/cryptocurrencies.py index ef24396..8464bc1 100644 --- a/hdwallet/cryptocurrencies.py +++ b/hdwallet/cryptocurrencies.py @@ -354,6 +354,46 @@ class AuroracoinMainnet(Cryptocurrency): WIF_SECRET_KEY = 0x97 +class AviancoinMainnet(Cryptocurrency): + NAME = "Aviancoin" + SYMBOL = "AVN" + NETWORK = "mainnet" + SOURCE_CODE = "https://github.com/AvianNetwork/Avian" + COIN_TYPE = CoinType({ + "INDEX": 921, + "HARDENED": True + }) + + SCRIPT_ADDRESS = 0x7a + PUBLIC_KEY_ADDRESS = 0x3c + SEGWIT_ADDRESS = SegwitAddress({ + "HRP": None, + "VERSION": 0x00 + }) + + EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ + "P2PKH": 0x488ade4, + "P2SH": 0x488ade4, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ + "P2PKH": 0x488b21e, + "P2SH": 0x488b21e, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + MESSAGE_PREFIX = "Aviancoin Signed Message:\n" + DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" + WIF_SECRET_KEY = 0x80 + + class AxeMainnet(Cryptocurrency): NAME = "Axe" @@ -2154,6 +2194,88 @@ class EuropeCoinMainnet(Cryptocurrency): WIF_SECRET_KEY = 0xa8 +class EvrmoreMainnet(Cryptocurrency): + + NAME = "Evrmore" + SYMBOL = "EVR" + NETWORK = "mainnet" + SOURCE_CODE = "https://github.com/EvrmoreOrg/Evrmore" + COIN_TYPE = CoinType({ + "INDEX": 175, + "HARDENED": True + }) + + SCRIPT_ADDRESS = 0x5c + PUBLIC_KEY_ADDRESS = 0x21 + SEGWIT_ADDRESS = SegwitAddress({ + "HRP": None, + "VERSION": 0x00 + }) + + EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ + "P2PKH": 0x488ade4, + "P2SH": 0x488ade4, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ + "P2PKH": 0x488b21e, + "P2SH": 0x488b21e, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + MESSAGE_PREFIX = "Evrmore Signed Message:\n" + DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" + WIF_SECRET_KEY = 0x80 + + +class EvrmoreTestnet(Cryptocurrency): + + NAME = "Evrmore" + SYMBOL = "EVRTEST" + NETWORK = "testnet" + SOURCE_CODE = "https://github.com/EvrmoreOrg/Evrmore" + COIN_TYPE = CoinType({ + "INDEX": 1, + "HARDENED": True + }) + + SCRIPT_ADDRESS = 0xc4 + PUBLIC_KEY_ADDRESS = 0x6f + SEGWIT_ADDRESS = SegwitAddress({ + "HRP": None, + "VERSION": 0x00 + }) + + EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ + "P2PKH": 0x04358394, + "P2SH": 0x04358394, + "P2WPKH": 0x04358394, + "P2WPKH_IN_P2SH": 0x04358394, + "P2WSH": 0x04358394, + "P2WSH_IN_P2SH": 0x04358394 + }) + + EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ + "P2PKH": 0x043587cf, + "P2SH": 0x043587cf, + "P2WPKH": 0x043587cf, + "P2WPKH_IN_P2SH": 0x043587cf, + "P2WSH": 0x043587cf, + "P2WSH_IN_P2SH": 0x043587cf + }) + + MESSAGE_PREFIX = "Evrmore Signed Message:\n" + DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" + WIF_SECRET_KEY = 0xef + + class ExclusiveCoinMainnet(Cryptocurrency): NAME = "Exclusive Coin" @@ -2431,6 +2553,89 @@ class FluxMainnet(Cryptocurrency): DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" WIF_SECRET_KEY = 0x80 + +class FoxdcoinMainnet(Cryptocurrency): + + NAME = "Foxdcoin" + SYMBOL = "FOXD" + NETWORK = "mainnet" + SOURCE_CODE = "https://github.com/foxdproject/foxdcoin" + COIN_TYPE = CoinType({ + "INDEX": 175, + "HARDENED": True + }) + + SCRIPT_ADDRESS = 0x1e + PUBLIC_KEY_ADDRESS = 0x23 + SEGWIT_ADDRESS = SegwitAddress({ + "HRP": None, + "VERSION": 0x00 + }) + + EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ + "P2PKH": 0x488ade4, + "P2SH": 0x488ade4, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ + "P2PKH": 0x488b21e, + "P2SH": 0x488b21e, + "P2WPKH": None, + "P2WPKH_IN_P2SH": None, + "P2WSH": None, + "P2WSH_IN_P2SH": None + }) + + MESSAGE_PREFIX = "Foxdcoin Signed Message:\n" + DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" + WIF_SECRET_KEY = 0x80 + + +class FoxdcoinTestnet(Cryptocurrency): + + NAME = "Foxdcoin" + SYMBOL = "FOXDTEST" + NETWORK = "testnet" + SOURCE_CODE = "https://github.com/foxdproject/foxdcoin" + COIN_TYPE = CoinType({ + "INDEX": 1, + "HARDENED": True + }) + + SCRIPT_ADDRESS = 0x5a + PUBLIC_KEY_ADDRESS = 0x5f + SEGWIT_ADDRESS = SegwitAddress({ + "HRP": None, + "VERSION": 0x00 + }) + + EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ + "P2PKH": 0x488ade4, + "P2SH": 0x488ade4, + "P2WPKH": 0x488ade4, + "P2WPKH_IN_P2SH": 0x488ade4, + "P2WSH": 0x488ade4, + "P2WSH_IN_P2SH": 0x488ade4 + }) + + EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ + "P2PKH": 0x488b21e, + "P2SH": 0x488b21e, + "P2WPKH": 0x488b21e, + "P2WPKH_IN_P2SH": 0x488b21e, + "P2WSH": 0x488b21e, + "P2WSH_IN_P2SH": 0x488b21e + }) + + MESSAGE_PREFIX = "Foxdcoin Signed Message:\n" + DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" + WIF_SECRET_KEY = 0xef + + class FujiCoinMainnet(Cryptocurrency): NAME = "Fuji Coin" @@ -4836,7 +5041,7 @@ class RavencoinMainnet(Cryptocurrency): NAME = "Ravencoin" SYMBOL = "RVN" NETWORK = "mainnet" - SOURCE_CODE = None + SOURCE_CODE = "https://github.com/RavenProject/Ravencoin" COIN_TYPE = CoinType({ "INDEX": 175, "HARDENED": True @@ -4866,11 +5071,47 @@ class RavencoinMainnet(Cryptocurrency): "P2WSH_IN_P2SH": None }) - MESSAGE_PREFIX = "Raven Signed Message:\n" + MESSAGE_PREFIX = "Raven Signed Message:\n" DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0" WIF_SECRET_KEY = 0x80 +class RavencoinTestnet(Cryptocurrency): + + NAME = "Ravencoin" + SYMBOL = "RVNTEST" + NETWORK = "testnet" + SOURCE_CODE = "https://github.com/RavenProject/Ravencoin" + COIN_TYPE = CoinType({ + "INDEX": 1, + "HARDENED": True + }) + + SCRIPT_ADDRESS = 0xc4 + PUBLIC_KEY_ADDRESS = 0x6f + SEGWIT_ADDRESS = SegwitAddress({ + "HRP": None, + "VERSION": 0x00 + }) + + EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ + "P2PKH": 0x04358394, + "P2SH": 0x04358394, + "P2WPKH": 0x04358394, + "P2WPKH_IN_P2SH": 0x04358394, + "P2WSH": 0x04358394, + "P2WSH_IN_P2SH": 0x04358394 + }) + EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ + "P2PKH": 0x043587cf, + "P2SH": 0x043587cf, + "P2WPKH": 0x043587cf, + "P2WPKH_IN_P2SH": 0x043587cf, + "P2WSH": 0x043587cf, + "P2WSH_IN_P2SH": 0x043587cf + }) + + class ReddcoinMainnet(Cryptocurrency): NAME = "Reddcoin" diff --git a/hdwallet/symbols.py b/hdwallet/symbols.py index 531f6ea..e78d379 100644 --- a/hdwallet/symbols.py +++ b/hdwallet/symbols.py @@ -14,6 +14,8 @@ ATOM = "ATOM" # Auroracoin AUR = "AUR" +# Aviancoin +AVN = "AVN" # Axe AXE = "AXE" # Bata @@ -96,6 +98,8 @@ ETH = "ETH" # Europe Coin ERC = "ERC" +# Evrmore +EVR, EVRTEST = "EVR", "EVRTEST" # Exclusive Coin EXCL = "EXCL" # FIX @@ -108,6 +112,8 @@ FLASH = "FLASH" # Flux FLUX = "FLUX" +# Foxdcoin +FOXD, FOXDTEST = "FOXD", "FOXDTEST" # Fuji Coin FJC = "FJC" # GCR Coin @@ -217,7 +223,7 @@ # Rapids RPD = "RPD" # Ravencoin -RVN = "RVN" +RVN, RVNTEST = "RVN", "RVNTEST" # Reddcoin RDD = "RDD" # Rubycoin @@ -296,6 +302,7 @@ "AC", "ATOM", "AUR", + "AVN", "AXE", "BTA", "BEET", @@ -337,12 +344,14 @@ "NRG", "ETH", "ERC", + "EVR", "EVRTEST", "EXCL", "FIX", "FIXTEST", "FLUX", "FTC", "FRST", "FLASH", + "FOXD", "FOXDTEST", "FJC", "GCR", "GAME", @@ -397,7 +406,7 @@ "QTUM", "QTUMTEST", "RBTC", "RBTCTEST", "RPD", - "RVN", + "RVN", "RVNTEST", "RDD", "RBY", "SAFE", From 9317afe6c8955662656be6e4e9724429d99d7b75 Mon Sep 17 00:00:00 2001 From: Joshua Infante Date: Sat, 22 Apr 2023 04:53:41 -0700 Subject: [PATCH 3/5] Added p2wpkh, p2wsh, p2wpkh in p2sh, and p2wsh in p2sh to Ravencoin, Evrmore, Foxdcoin, and Aviancoin. --- hdwallet/cryptocurrencies.py | 155 +++++++++++++++++------------------ hdwallet/hdwallet.py | 10 ++- 2 files changed, 81 insertions(+), 84 deletions(-) diff --git a/hdwallet/cryptocurrencies.py b/hdwallet/cryptocurrencies.py index 8464bc1..513ac64 100644 --- a/hdwallet/cryptocurrencies.py +++ b/hdwallet/cryptocurrencies.py @@ -367,26 +367,25 @@ class AviancoinMainnet(Cryptocurrency): SCRIPT_ADDRESS = 0x7a PUBLIC_KEY_ADDRESS = 0x3c SEGWIT_ADDRESS = SegwitAddress({ - "HRP": None, - "VERSION": 0x00 + "HRP": "av", + "VERSION": 0x29 }) EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ "P2PKH": 0x488ade4, "P2SH": 0x488ade4, - "P2WPKH": None, - "P2WPKH_IN_P2SH": None, - "P2WSH": None, - "P2WSH_IN_P2SH": None + "P2WPKH": 0x04b2430c, + "P2WPKH_IN_P2SH": 0x049d7878, + "P2WSH": 0x02aa7a99, + "P2WSH_IN_P2SH": 0x0295b005 }) - EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ "P2PKH": 0x488b21e, "P2SH": 0x488b21e, - "P2WPKH": None, - "P2WPKH_IN_P2SH": None, - "P2WSH": None, - "P2WSH_IN_P2SH": None + "P2WPKH": 0x04b24746, + "P2WPKH_IN_P2SH": 0x049d7cb2, + "P2WSH": 0x02aa7ed3, + "P2WSH_IN_P2SH": 0x0295b43f }) MESSAGE_PREFIX = "Aviancoin Signed Message:\n" @@ -2208,26 +2207,25 @@ class EvrmoreMainnet(Cryptocurrency): SCRIPT_ADDRESS = 0x5c PUBLIC_KEY_ADDRESS = 0x21 SEGWIT_ADDRESS = SegwitAddress({ - "HRP": None, - "VERSION": 0x00 + "HRP": "ev", + "VERSION": 0x18 }) EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ "P2PKH": 0x488ade4, "P2SH": 0x488ade4, - "P2WPKH": None, - "P2WPKH_IN_P2SH": None, - "P2WSH": None, - "P2WSH_IN_P2SH": None + "P2WPKH": 0x04b2430c, + "P2WPKH_IN_P2SH": 0x049d7878, + "P2WSH": 0x02aa7a99, + "P2WSH_IN_P2SH": 0x0295b005 }) - EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ "P2PKH": 0x488b21e, "P2SH": 0x488b21e, - "P2WPKH": None, - "P2WPKH_IN_P2SH": None, - "P2WSH": None, - "P2WSH_IN_P2SH": None + "P2WPKH": 0x04b24746, + "P2WPKH_IN_P2SH": 0x049d7cb2, + "P2WSH": 0x02aa7ed3, + "P2WSH_IN_P2SH": 0x0295b43f }) MESSAGE_PREFIX = "Evrmore Signed Message:\n" @@ -2249,26 +2247,25 @@ class EvrmoreTestnet(Cryptocurrency): SCRIPT_ADDRESS = 0xc4 PUBLIC_KEY_ADDRESS = 0x6f SEGWIT_ADDRESS = SegwitAddress({ - "HRP": None, + "HRP": "te", "VERSION": 0x00 }) EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ - "P2PKH": 0x04358394, - "P2SH": 0x04358394, - "P2WPKH": 0x04358394, - "P2WPKH_IN_P2SH": 0x04358394, - "P2WSH": 0x04358394, - "P2WSH_IN_P2SH": 0x04358394 + "P2PKH": 0x488ade4, + "P2SH": 0x488ade4, + "P2WPKH": 0x04b2430c, + "P2WPKH_IN_P2SH": 0x049d7878, + "P2WSH": 0x02aa7a99, + "P2WSH_IN_P2SH": 0x0295b005 }) - EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ - "P2PKH": 0x043587cf, - "P2SH": 0x043587cf, - "P2WPKH": 0x043587cf, - "P2WPKH_IN_P2SH": 0x043587cf, - "P2WSH": 0x043587cf, - "P2WSH_IN_P2SH": 0x043587cf + "P2PKH": 0x488b21e, + "P2SH": 0x488b21e, + "P2WPKH": 0x04b24746, + "P2WPKH_IN_P2SH": 0x049d7cb2, + "P2WSH": 0x02aa7ed3, + "P2WSH_IN_P2SH": 0x0295b43f }) MESSAGE_PREFIX = "Evrmore Signed Message:\n" @@ -2568,26 +2565,25 @@ class FoxdcoinMainnet(Cryptocurrency): SCRIPT_ADDRESS = 0x1e PUBLIC_KEY_ADDRESS = 0x23 SEGWIT_ADDRESS = SegwitAddress({ - "HRP": None, - "VERSION": 0x00 + "HRP": "fx", + "VERSION": 0x0c }) EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ "P2PKH": 0x488ade4, "P2SH": 0x488ade4, - "P2WPKH": None, - "P2WPKH_IN_P2SH": None, - "P2WSH": None, - "P2WSH_IN_P2SH": None + "P2WPKH": 0x04b2430c, + "P2WPKH_IN_P2SH": 0x049d7878, + "P2WSH": 0x02aa7a99, + "P2WSH_IN_P2SH": 0x0295b005 }) - EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ "P2PKH": 0x488b21e, "P2SH": 0x488b21e, - "P2WPKH": None, - "P2WPKH_IN_P2SH": None, - "P2WSH": None, - "P2WSH_IN_P2SH": None + "P2WPKH": 0x04b24746, + "P2WPKH_IN_P2SH": 0x049d7cb2, + "P2WSH": 0x02aa7ed3, + "P2WSH_IN_P2SH": 0x0295b43f }) MESSAGE_PREFIX = "Foxdcoin Signed Message:\n" @@ -2609,26 +2605,25 @@ class FoxdcoinTestnet(Cryptocurrency): SCRIPT_ADDRESS = 0x5a PUBLIC_KEY_ADDRESS = 0x5f SEGWIT_ADDRESS = SegwitAddress({ - "HRP": None, + "HRP": "tf", "VERSION": 0x00 }) EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ "P2PKH": 0x488ade4, "P2SH": 0x488ade4, - "P2WPKH": 0x488ade4, - "P2WPKH_IN_P2SH": 0x488ade4, - "P2WSH": 0x488ade4, - "P2WSH_IN_P2SH": 0x488ade4 + "P2WPKH": 0x04b2430c, + "P2WPKH_IN_P2SH": 0x049d7878, + "P2WSH": 0x02aa7a99, + "P2WSH_IN_P2SH": 0x0295b005 }) - EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ "P2PKH": 0x488b21e, "P2SH": 0x488b21e, - "P2WPKH": 0x488b21e, - "P2WPKH_IN_P2SH": 0x488b21e, - "P2WSH": 0x488b21e, - "P2WSH_IN_P2SH": 0x488b21e + "P2WPKH": 0x04b24746, + "P2WPKH_IN_P2SH": 0x049d7cb2, + "P2WSH": 0x02aa7ed3, + "P2WSH_IN_P2SH": 0x0295b43f }) MESSAGE_PREFIX = "Foxdcoin Signed Message:\n" @@ -5050,25 +5045,25 @@ class RavencoinMainnet(Cryptocurrency): SCRIPT_ADDRESS = 0x7a PUBLIC_KEY_ADDRESS = 0x3c SEGWIT_ADDRESS = SegwitAddress({ - "HRP": None, - "VERSION": 0x00 + "HRP": "rv", + "VERSION": 0x15 }) EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ "P2PKH": 0x488ade4, "P2SH": 0x488ade4, - "P2WPKH": None, - "P2WPKH_IN_P2SH": None, - "P2WSH": None, - "P2WSH_IN_P2SH": None + "P2WPKH": 0x04b2430c, + "P2WPKH_IN_P2SH": 0x049d7878, + "P2WSH": 0x02aa7a99, + "P2WSH_IN_P2SH": 0x0295b005 }) EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ "P2PKH": 0x488b21e, "P2SH": 0x488b21e, - "P2WPKH": None, - "P2WPKH_IN_P2SH": None, - "P2WSH": None, - "P2WSH_IN_P2SH": None + "P2WPKH": 0x04b24746, + "P2WPKH_IN_P2SH": 0x049d7cb2, + "P2WSH": 0x02aa7ed3, + "P2WSH_IN_P2SH": 0x0295b43f }) MESSAGE_PREFIX = "Raven Signed Message:\n" @@ -5090,25 +5085,25 @@ class RavencoinTestnet(Cryptocurrency): SCRIPT_ADDRESS = 0xc4 PUBLIC_KEY_ADDRESS = 0x6f SEGWIT_ADDRESS = SegwitAddress({ - "HRP": None, + "HRP": "tr", "VERSION": 0x00 }) EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ - "P2PKH": 0x04358394, - "P2SH": 0x04358394, - "P2WPKH": 0x04358394, - "P2WPKH_IN_P2SH": 0x04358394, - "P2WSH": 0x04358394, - "P2WSH_IN_P2SH": 0x04358394 + "P2PKH": 0x488ade4, + "P2SH": 0x488ade4, + "P2WPKH": 0x04b2430c, + "P2WPKH_IN_P2SH": 0x049d7878, + "P2WSH": 0x02aa7a99, + "P2WSH_IN_P2SH": 0x0295b005 }) EXTENDED_PUBLIC_KEY = ExtendedPublicKey({ - "P2PKH": 0x043587cf, - "P2SH": 0x043587cf, - "P2WPKH": 0x043587cf, - "P2WPKH_IN_P2SH": 0x043587cf, - "P2WSH": 0x043587cf, - "P2WSH_IN_P2SH": 0x043587cf + "P2PKH": 0x488b21e, + "P2SH": 0x488b21e, + "P2WPKH": 0x04b24746, + "P2WPKH_IN_P2SH": 0x049d7cb2, + "P2WSH": 0x02aa7ed3, + "P2WSH_IN_P2SH": 0x0295b43f }) diff --git a/hdwallet/hdwallet.py b/hdwallet/hdwallet.py index 1592fb8..a66ac84 100644 --- a/hdwallet/hdwallet.py +++ b/hdwallet/hdwallet.py @@ -1196,9 +1196,10 @@ def p2wpkh_address(self) -> Optional[str]: compressed_public_key = unhexlify(self.compressed()) public_key_hash = ripemd160(sha256(compressed_public_key).digest()) - if self._cryptocurrency.SEGWIT_ADDRESS.HRP is None: + segwit = self._cryptocurrency.SEGWIT_ADDRESS + if segwit.HRP is None: return None - return ensure_string(encode(self._cryptocurrency.SEGWIT_ADDRESS.HRP, 0, public_key_hash)) + return ensure_string(encode(segwit.HRP, segwit.VERSION, public_key_hash)) def p2wpkh_in_p2sh_address(self) -> Optional[str]: """ @@ -1240,9 +1241,10 @@ def p2wsh_address(self) -> Optional[str]: compressed_public_key = unhexlify("5121" + self.compressed() + "51ae") script_hash = sha256(compressed_public_key).digest() - if self._cryptocurrency.SEGWIT_ADDRESS.HRP is None: + segwit = self._cryptocurrency.SEGWIT_ADDRESS + if segwit.HRP is None: return None - return ensure_string(encode(self._cryptocurrency.SEGWIT_ADDRESS.HRP, 0, script_hash)) + return ensure_string(encode(segwit.HRP, segwit.VERSION, script_hash)) def p2wsh_in_p2sh_address(self) -> Optional[str]: """ From d365d785060d1217b475def16edfccf18e484a35 Mon Sep 17 00:00:00 2001 From: Joshua Infante Date: Sat, 22 Apr 2023 05:24:31 -0700 Subject: [PATCH 4/5] fixed a bug with segwit addresses --- hdwallet/cryptocurrencies.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hdwallet/cryptocurrencies.py b/hdwallet/cryptocurrencies.py index 513ac64..a1aeccb 100644 --- a/hdwallet/cryptocurrencies.py +++ b/hdwallet/cryptocurrencies.py @@ -368,7 +368,7 @@ class AviancoinMainnet(Cryptocurrency): PUBLIC_KEY_ADDRESS = 0x3c SEGWIT_ADDRESS = SegwitAddress({ "HRP": "av", - "VERSION": 0x29 + "VERSION": 0x0d }) EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ @@ -2208,7 +2208,7 @@ class EvrmoreMainnet(Cryptocurrency): PUBLIC_KEY_ADDRESS = 0x21 SEGWIT_ADDRESS = SegwitAddress({ "HRP": "ev", - "VERSION": 0x18 + "VERSION": 0x0b }) EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ @@ -5046,7 +5046,7 @@ class RavencoinMainnet(Cryptocurrency): PUBLIC_KEY_ADDRESS = 0x3c SEGWIT_ADDRESS = SegwitAddress({ "HRP": "rv", - "VERSION": 0x15 + "VERSION": 0x0a }) EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ From b0381d4182f9780acfa08e5b0eddb5f2d3fbe8bd Mon Sep 17 00:00:00 2001 From: Joshua Infante <38098280+git-infinianti@users.noreply.github.com> Date: Tue, 25 Apr 2023 06:29:56 -0700 Subject: [PATCH 5/5] Changed prefixes for Ravencoin and Foxdcoin New prefixes are ra1v for Ravencoin and fx1d for Foxdcoin. --- hdwallet/cryptocurrencies.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hdwallet/cryptocurrencies.py b/hdwallet/cryptocurrencies.py index a1aeccb..f36584d 100644 --- a/hdwallet/cryptocurrencies.py +++ b/hdwallet/cryptocurrencies.py @@ -2566,7 +2566,7 @@ class FoxdcoinMainnet(Cryptocurrency): PUBLIC_KEY_ADDRESS = 0x23 SEGWIT_ADDRESS = SegwitAddress({ "HRP": "fx", - "VERSION": 0x0c + "VERSION": 0x0d }) EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({ @@ -5045,8 +5045,8 @@ class RavencoinMainnet(Cryptocurrency): SCRIPT_ADDRESS = 0x7a PUBLIC_KEY_ADDRESS = 0x3c SEGWIT_ADDRESS = SegwitAddress({ - "HRP": "rv", - "VERSION": 0x0a + "HRP": "ra", + "VERSION": 0x0c }) EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({