Skip to content

Commit

Permalink
common: Chainparams for testnet4 support
Browse files Browse the repository at this point in the history
The BIP70 name given as testnet4 to correspond with chaininfo value.
  • Loading branch information
2seaq authored and ShahanaFarooqui committed Jan 13, 2025
1 parent c1484a6 commit 1da0c1f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
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

0 comments on commit 1da0c1f

Please sign in to comment.