Skip to content

Commit

Permalink
Change alertkey to allow changing alert key based on height
Browse files Browse the repository at this point in the history
Insert new alertkeys for mainnet and testnet at 2671700 and 1964600
respectively.
  • Loading branch information
jamescowens committed Jul 27, 2022
1 parent 4d3b560 commit e257cb8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
20 changes: 16 additions & 4 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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")}
Expand Down Expand Up @@ -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;

Expand All @@ -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")}
Expand Down
4 changes: 2 additions & 2 deletions src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -71,7 +71,6 @@ class CChainParams

Consensus::Params consensus;
CMessageHeader::MessageStartChars pchMessageStart;
std::vector<unsigned char> vAlertPubKey;
int nDefaultPort;
uint64_t m_assumed_blockchain_size;
unsigned char base58Prefix[MAX_BASE58_TYPES];
Expand All @@ -80,6 +79,7 @@ class CChainParams
bool m_is_test_chain;
bool m_is_mockable_chain;
CCheckpointData checkpointData;
std::vector<unsigned char> vAlertPubKey;
MapMasterKeys masterkeys;
};

Expand Down

0 comments on commit e257cb8

Please sign in to comment.