diff --git a/README.rst b/README.rst index 0b47a0a..6e5b789 100644 --- a/README.rst +++ b/README.rst @@ -16,14 +16,14 @@ PyWallet \ -**Simple BIP32 (HD) wallet creation for: BTC, BTG, BCH, ETH, LTC, DASH, DOGE** +**Simple BIP32 (HD) wallet creation for: BTC, BTX, BTG, BCH, ETH, LTC, DASH, DOGE** BIP32 (or HD for "hierarchical deterministic") wallets allow you to create child wallets which can only generate public keys and don't expose a private key to an insecure server. This library simplify the process of creating new wallets for the -BTC, BTG, BCH, ETH, LTC, DASH and DOGE cryptocurrencies. +BTC, BTX, BTG, BCH, ETH, LTC, DASH and DOGE cryptocurrencies. Most of the code here is forked from: diff --git a/pywallet/network.py b/pywallet/network.py index e8a9c4c..33128b9 100644 --- a/pywallet/network.py +++ b/pywallet/network.py @@ -254,3 +254,31 @@ class QtumTestNet(object): EXT_PUBLIC_KEY = 0x043587CF EXT_SECRET_KEY = 0x04358394 BIP32_PATH = "m/44'/88'/0'/" + + + class BitcoreMainNet(object): + """BitCore MainNet version bytes. + From https://github.com/LIMXTEC/BitCore/blob/0.15/src/chainparams.cpp + """ + NAME = "BitCore Main Net" + COIN = "BTX" + SCRIPT_ADDRESS = 0x7D # int(0x7D) = 125 + PUBKEY_ADDRESS = 0x03 # int(0x03) = 3 # Used to create payment addresses + SECRET_KEY = 0x80 # int(0x80) = 128 # Used for WIF format + EXT_PUBLIC_KEY = 0x0488B21E # Used to serialize public BIP32 addresses + EXT_SECRET_KEY = 0x0488ADE4 # Used to serialize private BIP32 addresses + BIP32_PATH = "m/44'/160'/0'/" + +class BitcoreTestNet(object): + """BitCore TestNet version bytes. + From https://github.com/LIMXTEC/BitCore/blob/0.15/src/chainparams.cpp + """ + NAME = "BitCore Test Net" + COIN = "BTX" + SCRIPT_ADDRESS = 0xC4 # int(0xC4) = 196 + PUBKEY_ADDRESS = 0x6F # int(0x6F) = 111 # Used to create payment addresses + SECRET_KEY = 0xEF # int(0xEF) = 239 # Used for WIF format + EXT_PUBLIC_KEY = 0x043587CF # Used to serialize public BIP32 addresses + EXT_SECRET_KEY = 0x04358394 # Used to serialize private BIP32 addresses + BIP32_PATH = "m/44'/1'/0'/" + diff --git a/pywallet/utils/bip32.py b/pywallet/utils/bip32.py index df32596..ee3fc39 100644 --- a/pywallet/utils/bip32.py +++ b/pywallet/utils/bip32.py @@ -669,6 +669,10 @@ def get_network(self, network): response = QtumMainNet elif network == 'qtum_testnet' or network == 'QTUMTEST': response = QtumTestNet + elif network == 'bitcore' or network == 'BTX': + response = BitcoreMainNet + elif network == 'bitcore_testnet' or network == 'BTX_TESTNET': + response = BitcoreTestNet else: response = network return response diff --git a/pywallet/wallet.py b/pywallet/wallet.py index b456325..cf60132 100644 --- a/pywallet/wallet.py +++ b/pywallet/wallet.py @@ -93,6 +93,10 @@ def get_network(network='btctest'): return QtumMainNet elif network == "qtum_testnet" or network == "qtumtest": return QtumTestNet + elif network == "bitcore" or network == "btx": + return BitcoreMainNet + elif network == "bitcore_testnet" or network == "btxtest": + return BitcoreTestNet return BitcoinTestNet diff --git a/setup.py b/setup.py index 5edb2c0..9861fe7 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ def load_version(): setup( name='pywallet', version=version, - description="Simple BIP32 (HD) wallet creation for BTC, BTG, BCH, LTC, DASH, USDT, QTUM and DOGE", + description="Simple BIP32 (HD) wallet creation for BTC, BTX, BTG, BCH, LTC, DASH, USDT, QTUM and DOGE", long_description=long_description, url='https://github.com/ranaroussi/pywallet', author='Ran Aroussi',