lbry-sdk/torba/coin/bitcoinsegwit.py

45 lines
1.3 KiB
Python
Raw Normal View History

2018-06-08 05:47:46 +02:00
__node_daemon__ = 'bitcoind'
__node_cli__ = 'bitcoin-cli'
2018-06-12 16:02:04 +02:00
__node_bin__ = 'bitcoin-0.16.0/bin'
2018-06-08 05:47:46 +02:00
__node_url__ = (
'https://bitcoin.org/bin/bitcoin-core-0.16.0/bitcoin-0.16.0-x86_64-linux-gnu.tar.gz'
)
2018-06-14 02:57:57 +02:00
__electrumx__ = 'electrumx.lib.coins.BitcoinSegwitRegtest'
2018-06-08 05:47:46 +02:00
from six import int2byte
from binascii import unhexlify
2018-06-11 15:33:32 +02:00
from torba.baseledger import BaseLedger
from torba.baseheader import BaseHeaders
2018-06-08 05:47:46 +02:00
2018-06-11 15:33:32 +02:00
class MainNetLedger(BaseLedger):
name = 'BitcoinSegwit'
symbol = 'BTC'
network_name = 'mainnet'
2018-06-08 05:47:46 +02:00
2018-06-11 15:33:32 +02:00
pubkey_address_prefix = int2byte(0x00)
script_address_prefix = int2byte(0x05)
extended_public_key_prefix = unhexlify('0488b21e')
extended_private_key_prefix = unhexlify('0488ade4')
2018-06-08 05:47:46 +02:00
2018-06-11 15:33:32 +02:00
default_fee_per_byte = 50
2018-06-08 05:47:46 +02:00
class UnverifiedHeaders(BaseHeaders):
verify_bits_to_target = False
2018-06-11 15:33:32 +02:00
class RegTestLedger(MainNetLedger):
2018-06-08 05:47:46 +02:00
headers_class = UnverifiedHeaders
2018-06-12 16:02:04 +02:00
network_name = 'regtest'
pubkey_address_prefix = int2byte(111)
script_address_prefix = int2byte(196)
extended_public_key_prefix = unhexlify('043587cf')
extended_private_key_prefix = unhexlify('04358394')
2018-06-08 05:47:46 +02:00
max_target = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
genesis_hash = '0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206'
genesis_bits = 0x207fffff
target_timespan = 1