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

Add BitCore BTX support #29

Open
wants to merge 1 commit 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
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
28 changes: 28 additions & 0 deletions pywallet/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'/"

4 changes: 4 additions & 0 deletions pywallet/utils/bip32.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions pywallet/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down