Skip to content

Commit eeb635f

Browse files
2seaqShahanaFarooqui
authored andcommitted
common: Chainparams for testnet4 support
The BIP70 name given as testnet4 to correspond with chaininfo value.
1 parent c1484a6 commit eeb635f

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

bitcoin/chainparams.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,32 @@ const struct chainparams networks[] = {
137137
.bip32_key_version = {.bip32_pubkey_version = BIP32_VER_TEST_PUBLIC,
138138
.bip32_privkey_version = BIP32_VER_TEST_PRIVATE},
139139
.is_elements = false},
140+
{.network_name = "testnet4",
141+
.onchain_hrp = "tb",
142+
.lightning_hrp = "tb",
143+
.bip70_name = "testnet4",
144+
// 00000000da84f2bafbbc53dee25a72ae507ff4914b867c565be350b0da8bf043
145+
.genesis_blockhash = {{{.u.u8 = {0x43, 0xf0, 0x8b, 0xda, 0xb0, 0x50, 0xe3,
146+
0x5b, 0x56, 0x7c, 0x86, 0x4b, 0x91, 0xf4,
147+
0x7f, 0x50, 0xae, 0x72, 0x5a, 0xe2, 0xde,
148+
0x53, 0xbc, 0xfb, 0xba, 0xf2, 0x84, 0xda,
149+
0x00, 0x00, 0x00, 0x00}}}},
150+
.rpc_port = 48332,
151+
.ln_port = 49735,
152+
.cli = "bitcoin-cli",
153+
.cli_args = "-testnet4",
154+
.cli_min_supported_version = 150000,
155+
.dust_limit = { 546 },
156+
.max_funding = AMOUNT_SAT_INIT((1 << 24) - 1),
157+
.max_payment = AMOUNT_MSAT_INIT(0xFFFFFFFFULL),
158+
.max_supply = AMOUNT_SAT_INIT(2100000000000000),
159+
.p2pkh_version = 111,
160+
.p2sh_version = 196,
161+
.testnet = true,
162+
.fee_asset_tag = NULL,
163+
.bip32_key_version = {.bip32_pubkey_version = BIP32_VER_TEST_PUBLIC,
164+
.bip32_privkey_version = BIP32_VER_TEST_PRIVATE},
165+
.is_elements = false},
140166
{.network_name = "litecoin",
141167
.onchain_hrp = "ltc",
142168
.lightning_hrp = "ltc",

common/configdir.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ struct configvar **initial_config_opts(const tal_t *ctx,
336336
opt_register_early_noarg("--testnet",
337337
opt_set_specific_network, "testnet",
338338
"Alias for --network=testnet");
339+
opt_register_early_noarg("--testnet4",
340+
opt_set_specific_network, "testnet4",
341+
"Alias for --network=testnet4");
339342
opt_register_early_noarg("--signet",
340343
opt_set_specific_network, "signet",
341344
"Alias for --network=signet");

common/json_param.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,11 +775,11 @@ struct command_result *param_secrets_array(struct command *cmd,
775775

776776
/**
777777
* segwit_addr_net_decode - Try to decode a Bech32(m) address and detect
778-
* testnet/mainnet/regtest/signet
778+
* testnet/mainnet/regtest/signet/testnet4
779779
*
780780
* This processes the address and returns a string if it is a Bech32
781781
* address specified by BIP173 or Bech32m as by BIP350. The string is
782-
* set whether it is testnet or signet (both "tb"), mainnet ("bc"),
782+
* set whether it is testnet/testnet4/signet ("tb"), mainnet ("bc"),
783783
* regtest ("bcrt"). It does not check witness version and program size
784784
* restrictions.
785785
*

0 commit comments

Comments
 (0)