Skip to content

Commit e257cb8

Browse files
committed
Change alertkey to allow changing alert key based on height
Insert new alertkeys for mainnet and testnet at 2671700 and 1964600 respectively.
1 parent 4d3b560 commit e257cb8

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

src/chainparams.cpp

+16-4
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ class CMainParams : public CChainParams {
8484
pchMessageStart[1] = 0x35;
8585
pchMessageStart[2] = 0x22;
8686
pchMessageStart[3] = 0x05;
87-
vAlertPubKey = ParseHex("049ac003b3318d9fe28b2830f6a95a2624ce2a69fb0c0c7ac0b513efcc1e93a6a6e8eba84481155dd82f2f1104e0ff62c69d662b0094639b7106abc5d84f948c0a");
8887
nDefaultPort = 32749;
8988
m_assumed_blockchain_size = 4;
9089

@@ -141,6 +140,13 @@ class CMainParams : public CChainParams {
141140
}
142141
};
143142

143+
// Master and alert keys other than the original are shorter because they are compressed.
144+
145+
// The original alert key was the same as the "master" (administrative contract) key For
146+
// before Kermit's Mom (< 5.3.3.12, < 5.4.0.0)
147+
// TestNet alerts public key for Kermit's Mom and beyond (>= 5.3.3.12, >= 5.4.0.0):
148+
vAlertPubKey = ParseHex("0352063cf6cf0317cc848ae24f3ed8b525334d2f059f242d27975f8c3a2e91b446");
149+
144150
masterkeys = {
145151
{0, ParseHex("049ac003b3318d9fe28b2830f6a95a2624ce2a69fb0c0c7ac0b513efcc1e93a6a6e8eba84481155dd82f2f1104e0ff62c69d662b0094639b7106abc5d84f948c0a")},
146152
{2671700, ParseHex("0288b33697c4c752f922764bf1a5075fa96bad46aaf4f0579bf7d19ab048e200f0")}
@@ -176,9 +182,6 @@ class CTestNetParams : public CChainParams {
176182
pchMessageStart[1] = 0xf2;
177183
pchMessageStart[2] = 0xc0;
178184
pchMessageStart[3] = 0xef;
179-
vAlertPubKey = ParseHex("0471dc165db490094d35cde15b1f5d755fa6ad6f2b5ed0f340e3f17f57389c3c2af113a8cbcc885bde73305a553b5640c83021128008ddf882e856336269080496");
180-
// TestNet alerts private key
181-
// "308201130201010420b665cff1884e53da26376fd1b433812c9a5a8a4d5221533b15b9629789bb7e42a081a53081a2020101302c06072a8648ce3d0101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f300604010004010704410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101a1440342000471dc165db490094d35cde15b1f5d755fa6ad6f2b5ed0f340e3f17f57389c3c2af113a8cbcc885bde73305a553b5640c83021128008ddf882e856336269080496"
182185
nDefaultPort = 32748;
183186
m_assumed_blockchain_size = 2;
184187

@@ -199,6 +202,15 @@ class CTestNetParams : public CChainParams {
199202
}
200203
};
201204

205+
206+
// Master and keys other than the original are shorter because they are compressed.
207+
208+
// TestNet alerts private key for before Kermit's Mom (< 5.3.3.12, < 5.4.0.0):
209+
// "308201130201010420b665cff1884e53da26376fd1b433812c9a5a8a4d5221533b15b9629789bb7e42a081a53081a2020101302c06072a8648ce3d0101022100fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f300604010004010704410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141020101a1440342000471dc165db490094d35cde15b1f5d755fa6ad6f2b5ed0f340e3f17f57389c3c2af113a8cbcc885bde73305a553b5640c83021128008ddf882e856336269080496"
210+
// TestNet alerts private key for Kermit's Mom and beyond (>= 5.3.3.12, >= 5.4.0.0):
211+
// "925ekjvCRKuwEzu2WuqifVFE2T3r755rwBNN3ck7Fr8esTdQdrA"
212+
vAlertPubKey = ParseHex("02bf4aa6330f525ab91a25cd5c1362481d16d8c039b3d27cb48ac0870176202462");
213+
202214
masterkeys = {
203215
{0, ParseHex("049ac003b3318d9fe28b2830f6a95a2624ce2a69fb0c0c7ac0b513efcc1e93a6a6e8eba84481155dd82f2f1104e0ff62c69d662b0094639b7106abc5d84f948c0a")},
204216
{1964600, ParseHex("031886a6776699cbd6362df7641c5d128146afabc769dfa36f1630889c706ce730")}

src/chainparams.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class CChainParams
5252
}
5353

5454
assert(false && "No master key specified or height is negative.");
55-
};
55+
}
5656
int GetDefaultPort() const { return nDefaultPort; }
5757

5858
// const CBlock& GenesisBlock() const { return genesis; }
@@ -71,7 +71,6 @@ class CChainParams
7171

7272
Consensus::Params consensus;
7373
CMessageHeader::MessageStartChars pchMessageStart;
74-
std::vector<unsigned char> vAlertPubKey;
7574
int nDefaultPort;
7675
uint64_t m_assumed_blockchain_size;
7776
unsigned char base58Prefix[MAX_BASE58_TYPES];
@@ -80,6 +79,7 @@ class CChainParams
8079
bool m_is_test_chain;
8180
bool m_is_mockable_chain;
8281
CCheckpointData checkpointData;
82+
std::vector<unsigned char> vAlertPubKey;
8383
MapMasterKeys masterkeys;
8484
};
8585

0 commit comments

Comments
 (0)