From 428b2566708b35cbff011957ca49bffcdeea4238 Mon Sep 17 00:00:00 2001 From: jamescowens Date: Sun, 24 Jul 2022 12:35:34 -0400 Subject: [PATCH] Insert new alertkeys for mainnet and testnet. --- src/chainparams.cpp | 20 ++++++++++++++++---- src/chainparams.h | 4 ++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 09fb004639..230cfb8451 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -84,7 +84,6 @@ class CMainParams : public CChainParams { pchMessageStart[1] = 0x35; pchMessageStart[2] = 0x22; pchMessageStart[3] = 0x05; - vAlertPubKey = ParseHex("049ac003b3318d9fe28b2830f6a95a2624ce2a69fb0c0c7ac0b513efcc1e93a6a6e8eba84481155dd82f2f1104e0ff62c69d662b0094639b7106abc5d84f948c0a"); nDefaultPort = 32749; m_assumed_blockchain_size = 4; @@ -141,6 +140,13 @@ class CMainParams : public CChainParams { } }; + // Master and alert keys other than the original are shorter because they are compressed. + + // The original alert key was the same as the "master" (administrative contract) key For + // before Kermit's Mom (< 5.3.3.12, < 5.4.0.0) + // TestNet alerts public key for Kermit's Mom and beyond (>= 5.3.3.12, >= 5.4.0.0): + vAlertPubKey = ParseHex("0352063cf6cf0317cc848ae24f3ed8b525334d2f059f242d27975f8c3a2e91b446"); + masterkeys = { {0, ParseHex("049ac003b3318d9fe28b2830f6a95a2624ce2a69fb0c0c7ac0b513efcc1e93a6a6e8eba84481155dd82f2f1104e0ff62c69d662b0094639b7106abc5d84f948c0a")}, {2671700, ParseHex("0288b33697c4c752f922764bf1a5075fa96bad46aaf4f0579bf7d19ab048e200f0")} @@ -176,9 +182,6 @@ class CTestNetParams : public CChainParams { pchMessageStart[1] = 0xf2; pchMessageStart[2] = 0xc0; pchMessageStart[3] = 0xef; - vAlertPubKey = ParseHex("0471dc165db490094d35cde15b1f5d755fa6ad6f2b5ed0f340e3f17f57389c3c2af113a8cbcc885bde73305a553b5640c83021128008ddf882e856336269080496"); - // TestNet alerts private key - // "308201130201010420b665cff1884e53da26376fd1b433812c9a5a8a4d5221533b15b9629789bb7e42a081a53081a2020101302c06072a8648ce3d0101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f300604010004010704410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101a1440342000471dc165db490094d35cde15b1f5d755fa6ad6f2b5ed0f340e3f17f57389c3c2af113a8cbcc885bde73305a553b5640c83021128008ddf882e856336269080496" nDefaultPort = 32748; m_assumed_blockchain_size = 2; @@ -199,6 +202,15 @@ class CTestNetParams : public CChainParams { } }; + + // Master and keys other than the original are shorter because they are compressed. + + // TestNet alerts private key for before Kermit's Mom (< 5.3.3.12, < 5.4.0.0): + // "308201130201010420b665cff1884e53da26376fd1b433812c9a5a8a4d5221533b15b9629789bb7e42a081a53081a2020101302c06072a8648ce3d0101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f300604010004010704410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101a1440342000471dc165db490094d35cde15b1f5d755fa6ad6f2b5ed0f340e3f17f57389c3c2af113a8cbcc885bde73305a553b5640c83021128008ddf882e856336269080496" + // TestNet alerts private key for Kermit's Mom and beyond (>= 5.3.3.12, >= 5.4.0.0): + // "925ekjvCRKuwEzu2WuqifVFE2T3r755rwBNN3ck7Fr8esTdQdrA" + vAlertPubKey = ParseHex("02bf4aa6330f525ab91a25cd5c1362481d16d8c039b3d27cb48ac0870176202462"); + masterkeys = { {0, ParseHex("049ac003b3318d9fe28b2830f6a95a2624ce2a69fb0c0c7ac0b513efcc1e93a6a6e8eba84481155dd82f2f1104e0ff62c69d662b0094639b7106abc5d84f948c0a")}, {1964600, ParseHex("031886a6776699cbd6362df7641c5d128146afabc769dfa36f1630889c706ce730")} diff --git a/src/chainparams.h b/src/chainparams.h index 8e449275d5..24dfd28420 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -52,7 +52,7 @@ class CChainParams } assert(false && "No master key specified or height is negative."); - }; + } int GetDefaultPort() const { return nDefaultPort; } // const CBlock& GenesisBlock() const { return genesis; } @@ -71,7 +71,6 @@ class CChainParams Consensus::Params consensus; CMessageHeader::MessageStartChars pchMessageStart; - std::vector vAlertPubKey; int nDefaultPort; uint64_t m_assumed_blockchain_size; unsigned char base58Prefix[MAX_BASE58_TYPES]; @@ -80,6 +79,7 @@ class CChainParams bool m_is_test_chain; bool m_is_mockable_chain; CCheckpointData checkpointData; + std::vector vAlertPubKey; MapMasterKeys masterkeys; };