Files
plm-lottery/app/wallet/plm_network.py
T
davideandClaude Sonnet 5.5 2c0e71a74c Refuse an Electrum server that is not on the PLM chain (B-99, ELC-30)
PLM shares Bitcoin's genesis and powLimit, so a Bitcoin server passed every
header check. connect() now asks server.features and requires PLM's genesis.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 00:32:24 +02:00

33 lines
1.2 KiB
Python

"""PLM mainnet params for embit, verified against PalladiumWallet/src/Core/Chain/ChainProfiles.cs.
Threaded explicitly through every embit call via `network=PLM_MAINNET` rather than
registered globally, since this is a long-lived async server (embit has no
concept of "current network" beyond what you pass in).
"""
PLM_MAINNET = {
"name": "PLM Mainnet",
"wif": bytes([0x80]),
"p2pkh": bytes([55]),
"p2sh": bytes([5]),
"bech32": "plm",
"xprv": bytes.fromhex("0488ade4"),
"xpub": bytes.fromhex("0488b21e"),
"yprv": bytes.fromhex("049d7878"),
"ypub": bytes.fromhex("049d7cb2"),
"zprv": bytes.fromhex("04b2430c"),
"zpub": bytes.fromhex("04b24746"),
"Yprv": bytes.fromhex("0295b005"),
"Ypub": bytes.fromhex("0295b43f"),
"Zprv": bytes.fromhex("02aa7a99"),
"Zpub": bytes.fromhex("02aa7ed3"),
"bip32": 0,
}
BIP44_COIN_TYPE = 746
ACCOUNT_PATH = f"m/84h/{BIP44_COIN_TYPE}h/0h"
# PLM shares Bitcoin's genesis block (palladiumcore chainparams.cpp) and its powLimit, so a
# Bitcoin Electrum server would pass every header check; the handshake asks for this instead.
GENESIS_HASH = "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"