Skip to content
Merged
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
26 changes: 26 additions & 0 deletions bitcoin/chainparams.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,32 @@ const struct chainparams networks[] = {
.bip32_key_version = {.bip32_pubkey_version = BIP32_VER_TEST_PUBLIC,
.bip32_privkey_version = BIP32_VER_TEST_PRIVATE},
.is_elements = false},
{.network_name = "testnet4",
.onchain_hrp = "tb",
.lightning_hrp = "tb",
.bip70_name = "testnet4",
// 00000000da84f2bafbbc53dee25a72ae507ff4914b867c565be350b0da8bf043
.genesis_blockhash = {{{.u.u8 = {0x43, 0xf0, 0x8b, 0xda, 0xb0, 0x50, 0xe3,
0x5b, 0x56, 0x7c, 0x86, 0x4b, 0x91, 0xf4,
0x7f, 0x50, 0xae, 0x72, 0x5a, 0xe2, 0xde,
0x53, 0xbc, 0xfb, 0xba, 0xf2, 0x84, 0xda,
0x00, 0x00, 0x00, 0x00}}}},
.rpc_port = 48332,
.ln_port = 49735,
.cli = "bitcoin-cli",
.cli_args = "-testnet4",
.cli_min_supported_version = 150000,
.dust_limit = { 546 },
.max_funding = AMOUNT_SAT_INIT((1 << 24) - 1),
.max_payment = AMOUNT_MSAT_INIT(0xFFFFFFFFULL),
.max_supply = AMOUNT_SAT_INIT(2100000000000000),
.p2pkh_version = 111,
.p2sh_version = 196,
.testnet = true,
.fee_asset_tag = NULL,
.bip32_key_version = {.bip32_pubkey_version = BIP32_VER_TEST_PUBLIC,
.bip32_privkey_version = BIP32_VER_TEST_PRIVATE},
.is_elements = false},
{.network_name = "litecoin",
.onchain_hrp = "ltc",
.lightning_hrp = "ltc",
Expand Down
3 changes: 3 additions & 0 deletions common/configdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ struct configvar **initial_config_opts(const tal_t *ctx,
opt_register_early_noarg("--testnet",
opt_set_specific_network, "testnet",
"Alias for --network=testnet");
opt_register_early_noarg("--testnet4",
opt_set_specific_network, "testnet4",
"Alias for --network=testnet4");
opt_register_early_noarg("--signet",
opt_set_specific_network, "signet",
"Alias for --network=signet");
Expand Down
4 changes: 2 additions & 2 deletions common/json_param.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,11 +775,11 @@ struct command_result *param_secrets_array(struct command *cmd,

/**
* segwit_addr_net_decode - Try to decode a Bech32(m) address and detect
* testnet/mainnet/regtest/signet
* testnet/mainnet/regtest/signet/testnet4
*
* This processes the address and returns a string if it is a Bech32
* address specified by BIP173 or Bech32m as by BIP350. The string is
* set whether it is testnet or signet (both "tb"), mainnet ("bc"),
* set whether it is testnet/testnet4/signet ("tb"), mainnet ("bc"),
* regtest ("bcrt"). It does not check witness version and program size
* restrictions.
*
Expand Down
4 changes: 4 additions & 0 deletions contrib/msggen/msggen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -20838,6 +20838,10 @@
"set": false,
"source": "default"
},
"testnet4": {
"set": false,
"source": "default"
},
"watchtime-blocks": {
"value_int": 5,
"source": "cmdline"
Expand Down
1 change: 1 addition & 0 deletions contrib/pyln-spec/bolt1/pyln/spec/bolt1/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Bitcoin mainet with port number 9735 or the corresponding hexadecimal `0x2607`;
- Bitcoin testnet with port number 19735 (`0x4D17`);
- Bitcoin signet with port number 39735 (`0x9B37`).
- Bitcoin testnet4 with port number 49735 (`0xC247`).

The Unicode code point for LIGHTNING <sup>[1](#reference-1)</sup>, and the port convention try to follow the Bitcoin Core convention.

Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ check-manpages: all-programs check-config-docs default-targets
# Makes sure that fields mentioned in schema are in man page, and vice versa.
check-config-docs:
@for c in `sed -n 's/^ "\(.*\)": {/\1/p' doc/schemas/lightning-listconfigs.json | grep -v '^# version$$' | grep -v '^plugins$$' | grep -v '^important-plugins$$'`; do if ! grep -q "^ \*\*$$c\*\*" doc/lightningd-config.5.md; then echo "$$c undocumented!"; exit 1; fi; done
@for c in `grep -v '\[plugin ' doc/lightningd-config.5.md | sed -n 's/^ \*\*\([^*]*\)\*\*.*/\1/p' | grep -v '^\(help\|version\|mainnet\|testnet\|signet\|plugin\|important-plugin\|plugin-dir\|clear-plugins\)$$'`; do if ! grep -q '"'"$$c"'"' doc/schemas/lightning-listconfigs.json; then echo "$$c documented but not in schema!"; exit 1; fi; done
@for c in `grep -v '\[plugin ' doc/lightningd-config.5.md | sed -n 's/^ \*\*\([^*]*\)\*\*.*/\1/p' | grep -v '^\(help\|version\|mainnet\|testnet\|testnet4\|signet\|plugin\|important-plugin\|plugin-dir\|clear-plugins\)$$'`; do if ! grep -q '"'"$$c"'"' doc/schemas/lightning-listconfigs.json; then echo "$$c documented but not in schema!"; exit 1; fi; done

doc-clean:
$(RM) $(MANPAGES) $(MARKDOWN_WITH_SCHEMA) doc/.doc_version
Expand Down
10 changes: 7 additions & 3 deletions doc/getting-started/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The [`lightning-listconfigs`](ref:lightning-listconfigs) command will output a v

**network**=_NETWORK_

- Select the network parameters (_bitcoin_, _testnet_, _signet_, or _regtest_).
- Select the network parameters (_bitcoin_, _testnet_, _testnet4_, _signet_, or _regtest_).
This is not valid within the per-network configuration file.

- **mainnet**
Expand All @@ -74,6 +74,10 @@ The [`lightning-listconfigs`](ref:lightning-listconfigs) command will output a v

Alias for _network=testnet_.

- **testnet4**

Alias for _network=testnet4_.

- **signet**

Alias for _network=signet_.
Expand Down Expand Up @@ -384,11 +388,11 @@ You can instead use _addr_ to override this (eg. to change the port), or precise
Set an IP address (v4 or v6) or automatic Tor address to listen on and (maybe) announce as our node address.

An empty 'IPADDRESS' is a special value meaning bind to IPv4 and/or IPv6 on all interfaces, '0.0.0.0' means bind to all IPv4 interfaces, '::' means 'bind to all IPv6 interfaces' (if you want to specify an IPv6 address _and_ a port, use `[]` around the IPv6 address, like `[::]:9750`).
If 'PORT' is not specified, the default port 9735 is used for mainnet (testnet: 19735, signet: 39735, regtest: 19846). If we can determine a public IP address from the resulting binding,
If 'PORT' is not specified, the default port 9735 is used for mainnet (testnet: 19735, signet: 39735, regtest: 19846, testnet4: 49735). If we can determine a public IP address from the resulting binding,
the address is announced.

If the argument begins with 'autotor:' then it is followed by the IPv4 or IPv6 address of the Tor control port (default port 9051), and this will be used to configure a Tor hidden service for port 9735 in case of mainnet (bitcoin) network whereas other networks (testnet,
signet, regtest) will set the same default ports they use for non-Tor addresses (see above).
signet, regtest, testnet4) will set the same default ports they use for non-Tor addresses (see above).
The Tor hidden service will be configured to point to the first IPv4 or IPv6 address we bind to and is by default unique to your node's id.

If the argument begins with 'statictor:' then it is followed by the IPv4 or IPv6 address of the Tor control port (default port 9051), and this will be used to configure a static Tor hidden service.
Expand Down
1 change: 1 addition & 0 deletions doc/lightning-cli.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ OPTIONS
* **--network**=*network*
* **--mainnet**
* **--testnet**
* **--testnet4**
* **--signet**
* **--regtest**

Expand Down
12 changes: 8 additions & 4 deletions doc/lightningd-config.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Bitcoin control options:

* **network**=*NETWORK*

Select the network parameters (*bitcoin*, *testnet*, *signet*, or *regtest*).
Select the network parameters (*bitcoin*, *testnet*, *testnet4*, *signet*, or *regtest*).
This is not valid within the per-network configuration file.

* **mainnet**
Expand All @@ -112,6 +112,10 @@ This is not valid within the per-network configuration file.

Alias for *network=testnet*.

* **testnet4**

Alias for *network=testnet4*.

* **signet**

Alias for *network=signet*.
Expand Down Expand Up @@ -571,16 +575,16 @@ interfaces, '::' means 'bind to all IPv6 interfaces' (if you want to
specify an IPv6 address *and* a port, use `[]` around the IPv6
address, like `[::]:9750`).
If 'PORT' is not specified, the default port 9735 is used for mainnet
(testnet: 19735, signet: 39735, regtest: 19846).
(testnet: 19735, signet: 39735, regtest: 19846, testnet4: 49735).
If we can determine a public IP address from the resulting binding,
the address is announced.

If the argument begins with 'autotor:' then it is followed by the
IPv4 or IPv6 address of the Tor control port (default port 9051),
and this will be used to configure a Tor hidden service for port 9735
in case of mainnet (bitcoin) network whereas other networks (testnet,
signet, regtest) will set the same default ports they use for non-Tor
addresses (see above).
testnet4, signet, regtest) will set the same default ports they use for
non-Tor addresses (see above).
The Tor hidden service will be configured to point to the
first IPv4 or IPv6 address we bind to and is by default unique to
your node's id.
Expand Down
4 changes: 4 additions & 0 deletions doc/schemas/lightning-listconfigs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2972,6 +2972,10 @@
"set": false,
"source": "default"
},
"testnet4": {
"set": false,
"source": "default"
},
"watchtime-blocks": {
"value_int": 5,
"source": "cmdline"
Expand Down
1 change: 1 addition & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def default_ln_port(network: str) -> int:
"signet": 39735,
"liquid-regtest": 20735,
"liquid": 9735,
"testnet4": 49735,
}
return network_map[network]

Expand Down
2 changes: 1 addition & 1 deletion tools/hsmtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ int main(int argc, char *argv[])
next);
}

if (net && (streq(net, "testnet") || streq(net, "signet")))
if (net && (streq(net, "testnet") || streq(net, "testnet4") || streq(net, "signet")))
version = BIP32_VER_TEST_PRIVATE;
else if (net && !streq(net, "bitcoin"))
errx(ERROR_USAGE, "Network '%s' not supported."
Expand Down
2 changes: 1 addition & 1 deletion tools/reckless
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,7 @@ if __name__ == '__main__':

NETWORK = 'regtest' if args.regtest else 'bitcoin'
SUPPORTED_NETWORKS = ['bitcoin', 'regtest', 'liquid', 'liquid-regtest',
'litecoin', 'signet', 'testnet']
'litecoin', 'signet', 'testnet', 'testnet4']
if args.version:
report_version()
elif args.cmd1 is None:
Expand Down