diff --git a/lib/blockchain.py b/lib/blockchain.py index cea971e6..784b56dd 100644 --- a/lib/blockchain.py +++ b/lib/blockchain.py @@ -84,7 +84,10 @@ def hash_header(header): if header is None: return '0' * 64 if header.get('prev_block_hash') is None: - header['prev_block_hash'] = '00'*64 ''' TODO 32? ''' + header['prev_block_hash'] = '00'*64 + ''' + TODO 32? + ''' return hash_encode(Hash(bfh(serialize_header(header)))) diff --git a/lib/constants.py b/lib/constants.py index ec35cbe3..6b93e04b 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -37,18 +37,26 @@ def read_json(filename, default): return r + + class BitcoinMainnet: TESTNET = False WIF_PREFIX = 0x80 - ADDRTYPE_P2PKH = 0 - ADDRTYPE_P2SH = 5 - SEGWIT_HRP = "bc" - GENESIS = "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" + ADDRTYPE_P2PKH = [0x1C, 0xB8] + ADDRTYPE_P2SH = [0x1C, 0xBD] + ADDRTYPE_SHIELDED = [0x16, 0x9A] + SEGWIT_HRP = "bc" # (No ZCL Segwit) + GENESIS = "0007104ccda289427919efc39dc9e4d499804b7bebc22df55f8b834301260602" DEFAULT_PORTS = {'t': '50001', 's': '50002'} DEFAULT_SERVERS = read_json('servers.json', {}) CHECKPOINTS = read_json('checkpoints.json', []) + EQUIHASH_N = 200 + EQUIHASH_K = 9 + + CHUNK_SIZE = 200 + XPRV_HEADERS = { 'standard': 0x0488ade4, # xprv 'p2wpkh-p2sh': 0x049d7878, # yprv @@ -69,14 +77,20 @@ class BitcoinTestnet: TESTNET = True WIF_PREFIX = 0xef - ADDRTYPE_P2PKH = 111 - ADDRTYPE_P2SH = 196 - SEGWIT_HRP = "tb" + ADDRTYPE_P2PKH = [0x1D, 0x25] + ADDRTYPE_P2SH = [0x1C, 0xBA] + ADDTYPE_SHIELDED = [0x16, 0xB6] + SEGWIT_HRP = "tb" # (ZCL has no Segwit) GENESIS = "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943" DEFAULT_PORTS = {'t': '51001', 's': '51002'} DEFAULT_SERVERS = read_json('servers_testnet.json', {}) CHECKPOINTS = read_json('checkpoints_testnet.json', []) + EQUIHASH_N = 200 + EQUIHASH_K = 9 + + CHUNK_SIZE = 200 + XPRV_HEADERS = { 'standard': 0x04358394, # tprv 'p2wpkh-p2sh': 0x044a4e28, # uprv diff --git a/lib/interface.py b/lib/interface.py index 6a741bff..81382826 100644 --- a/lib/interface.py +++ b/lib/interface.py @@ -31,9 +31,7 @@ import threading import time import traceback -from .util import print_error, get_cert_path - -ca_path = get_cert_path() +from .util import print_error from . import util from . import x509 diff --git a/lib/servers.json b/lib/servers.json index c6b5588b..bf03998a 100644 --- a/lib/servers.json +++ b/lib/servers.json @@ -1,5 +1,5 @@ { - "electrum.zclassic.org": {"s":"5222"}, - "zcl-electrum.com": {"s":"50002"} + "electrum.zclassic.org": {"s":"5222", "pruning": "-", "version": "1.1"}, + "zcl-electrum.com": {"s":"50002", "pruning": "-", "version": "1.1"} } diff --git a/lib/x509.py b/lib/x509.py index 46933251..122aa730 100644 --- a/lib/x509.py +++ b/lib/x509.py @@ -23,7 +23,7 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. from . import util -from .util import profiler, bh2u, get_cert_path +from .util import profiler, bh2u import ecdsa import hashlib