diff --git a/README.md b/README.md index e153544d..58e11fcb 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ Do the following: import bitcoin bitcoin.SelectParams(NAME) -Where NAME is one of 'testnet', 'mainnet', or 'regtest'. The chain currently +Where NAME is one of 'testnet', 'mainnet', 'signet', or 'regtest'. The chain currently selected is a global variable that changes behavior everywhere, just like in the Satoshi codebase. diff --git a/bitcoin/__init__.py b/bitcoin/__init__.py index 33c022f7..8a2bf953 100644 --- a/bitcoin/__init__.py +++ b/bitcoin/__init__.py @@ -50,6 +50,11 @@ class SigNetParams(bitcoin.core.CoreSigNetParams): DEFAULT_PORT = 38333 RPC_PORT = 38332 DNS_SEEDS = (("signet.bitcoin.sprovoost.nl", "seed.signet.bitcoin.sprovoost.nl")) + BASE58_PREFIXES = {'PUBKEY_ADDR':111, + 'SCRIPT_ADDR':196, + 'SECRET_KEY' :239} + + BECH32_HRP = 'tb' class RegTestParams(bitcoin.core.CoreRegTestParams): MESSAGE_START = b'\xfa\xbf\xb5\xda' @@ -84,5 +89,7 @@ def SelectParams(name): params = bitcoin.core.coreparams = TestNetParams() elif name == 'regtest': params = bitcoin.core.coreparams = RegTestParams() + elif name == 'signet': + params = bitcoin.core.coreparams = SigNetParams() else: raise ValueError('Unknown chain %r' % name) diff --git a/bitcoin/core/__init__.py b/bitcoin/core/__init__.py index 4c03c106..80cb6367 100644 --- a/bitcoin/core/__init__.py +++ b/bitcoin/core/__init__.py @@ -736,6 +736,8 @@ def _SelectCoreParams(name): coreparams = CoreTestNetParams() elif name == 'regtest': coreparams = CoreRegTestParams() + elif name == 'signet': + coreparams = CoreSigNetParams() else: raise ValueError('Unknown chain %r' % name) diff --git a/bitcoin/rpc.py b/bitcoin/rpc.py index 5907740a..56925390 100644 --- a/bitcoin/rpc.py +++ b/bitcoin/rpc.py @@ -355,7 +355,7 @@ def __init__(self, out of the file ``btc_conf_file``. If ``btc_conf_file`` is not specified, ``~/.bitcoin/bitcoin.conf`` or equivalent is used by default. The default port is set according to the chain parameters in - use: mainnet, testnet, or regtest. + use: mainnet, testnet, signet, or regtest. Usually no arguments to ``Proxy()`` are needed; the local bitcoind will be used. diff --git a/examples/make-bootstrap-rpc.py b/examples/make-bootstrap-rpc.py index 4279cc28..a26d98e2 100755 --- a/examples/make-bootstrap-rpc.py +++ b/examples/make-bootstrap-rpc.py @@ -29,7 +29,7 @@ if len(sys.argv) == 3: bitcoin.SelectParams(sys.argv[2]) except Exception as ex: - print('Usage: %s [network=(mainnet|testnet|regtest)] > bootstrap.dat' % sys.argv[0], file=sys.stderr) + print('Usage: %s [network=(mainnet|testnet|regtest|signet)] > bootstrap.dat' % sys.argv[0], file=sys.stderr) sys.exit(1)