From eab66b6c3ec6f965c02f59b1420b38605b0678e6 Mon Sep 17 00:00:00 2001 From: Davide Grilli Date: Mon, 1 Dec 2025 16:17:29 +0100 Subject: [PATCH] Rename BitcoinTestnet to PalladiumTestnet and update params Update testnet constants to reflect Palladium-specific values including WIF prefix, address types, and segwit HRP. Also updates checkpoints for Palladium testnet chain. --- electrum/chains/testnet/checkpoints.json | 40 +++++------------------- electrum/constants.py | 28 +++++++++-------- 2 files changed, 23 insertions(+), 45 deletions(-) diff --git a/electrum/chains/testnet/checkpoints.json b/electrum/chains/testnet/checkpoints.json index 18f666da8..fad53e955 100644 --- a/electrum/chains/testnet/checkpoints.json +++ b/electrum/chains/testnet/checkpoints.json @@ -1,42 +1,18 @@ [ [ - "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943", - 26959535291011309493156476344723991336010898738574164086137773096960 + "0000000000265b05d2f1e549900fc6b4ed31314bd6958fae831f7089264ce672", + 18133479806237104990991743559445002972828967478631036821889351680 ], [ - "000000000002540a8bc872dccdcbf05e026c62c95ac86605713114fdf42756a1", - 3139982046889008545132049271592324555994049059273355056316940288 + "0000000000049cdfc630f8f6c1c7cb7e0338b6de06787c72115f0b3364dc17cb", + 10204188400181031369987499837944269887010727159985068248888508416 ], [ - "000000000029160ca9abd86896d439151f516e3e3aaa6263698f1fd30a06ed69", - 20177184866346035900762163715642378212249988466595081642632544256 + "000000000000e9a2cdeab1d53e48c1556f1b907ce6607995f4d8bb313fa0ab42", + 2420996537016082743761534115268695237027269164309000079175319552 ], [ - "000000000001a1a490bb9122381c46eb42fede0d194ec5fe10ceb8886c022421", - 767576554406554097163368002248679864693828228459951068305948672 - ], - [ - "000000000029b52e7b4b9cc9f485e57471ab6d4e41404fe6f3de7ac4d2083db6", - 18639056411310354419753369546958418048981099493194503553661534208 - ], - [ - "000000000003c39c4da2bb28d46a93d347db8b4162efa7d1684145a865464924", - 2998037945346709533019430565365329595326726495607689843876823040 - ], - [ - "000000000001c7a6d092b155ce2de3d6de93bb8d4360c1ba69d208178f6bd0d4", - 2414248652650542061940410641638746995629959132206201242073956352 - ], - [ - "0000000000004e352da34e50fc227e7db8de24beb9db208bab3f1fac52b2981e", - 2182027273949911807082305611927179376566252492538254285269368832 - ], - [ - "0000000000005f66e1968f7348fd77db09105b3ea7d60065c9d4db24d06c804c", - 2331918186289210357041940427563955242916360638196610965402812416 - ], - [ - "0000000000029b10a2f57e849d2dda2fd271a56fdb18b3409f089f52592f52fe", - 2283741430470117582179500743740836403172775060160349500516335616 + "000000000001353c9842ec56cd8197e6c25cc032f41391e31e1f6229b7e17159", + 2200946458580367262904506681248727283144384991847868885291237376 ] ] diff --git a/electrum/constants.py b/electrum/constants.py index 6d36f3fe1..59cfd956a 100644 --- a/electrum/constants.py +++ b/electrum/constants.py @@ -217,20 +217,20 @@ class Palladium(AbstractNet): SKIP_POW_DIFFICULTY_VALIDATION = True # Palladium uses LWMA, not Bitcoin's difficulty algo -class BitcoinTestnet(AbstractNet): +class PalladiumTestnet(AbstractNet): NET_NAME = "testnet" TESTNET = True - WIF_PREFIX = 0xef - ADDRTYPE_P2PKH = 111 - ADDRTYPE_P2SH = 196 - SEGWIT_HRP = "tb" + WIF_PREFIX = 0xff # 255 from base58Prefixes[SECRET_KEY] + ADDRTYPE_P2PKH = 127 # base58Prefixes[PUBKEY_ADDRESS] + ADDRTYPE_P2SH = 115 # base58Prefixes[SCRIPT_ADDRESS] + SEGWIT_HRP = "tplm" BOLT11_HRP = SEGWIT_HRP GENESIS = "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943" - DEFAULT_PORTS = {'t': '51001', 's': '51002'} + DEFAULT_PORTS = {'t': '50001', 's': '50002'} XPRV_HEADERS = { - 'standard': 0x04358394, # tprv + 'standard': 0x04358394, # tprv - from base58Prefixes[EXT_SECRET_KEY] 'p2wpkh-p2sh': 0x044a4e28, # uprv 'p2wsh-p2sh': 0x024285b5, # Uprv 'p2wpkh': 0x045f18bc, # vprv @@ -238,7 +238,7 @@ class BitcoinTestnet(AbstractNet): } XPRV_HEADERS_INV = inv_dict(XPRV_HEADERS) XPUB_HEADERS = { - 'standard': 0x043587cf, # tpub + 'standard': 0x043587cf, # tpub - from base58Prefixes[EXT_PUBLIC_KEY] 'p2wpkh-p2sh': 0x044a5262, # upub 'p2wsh-p2sh': 0x024289ef, # Upub 'p2wpkh': 0x045f1cf6, # vpub @@ -247,13 +247,15 @@ class BitcoinTestnet(AbstractNet): XPUB_HEADERS_INV = inv_dict(XPUB_HEADERS) BIP44_COIN_TYPE = 1 LN_REALM_BYTE = 1 - LN_DNS_SEEDS = [ # TODO investigate this again - #'test.nodes.lightning.directory.', # times out. - #'lseed.bitcoinstats.com.', # ignores REALM byte and returns mainnet peers... - ] + LN_DNS_SEEDS = [] # No DNS seeds for Palladium testnet + SKIP_POW_DIFFICULTY_VALIDATION = True # Palladium uses LWMA, not Bitcoin's difficulty algo -class BitcoinRegtest(BitcoinTestnet): +# Alias for backwards compatibility +BitcoinTestnet = PalladiumTestnet + + +class BitcoinRegtest(PalladiumTestnet): NET_NAME = "regtest" SEGWIT_HRP = "bcrt"