forked from hodlwallet/breadwallet-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BRChainParams.h
119 lines (106 loc) · 5.89 KB
/
BRChainParams.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
//
// BRChainParams.h
//
// Created by Aaron Voisine on 1/10/18.
// Copyright (c) 2019 breadwallet LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef BRChainParams_h
#define BRChainParams_h
#include "BRMerkleBlock.h"
#include "BRPeer.h"
#include "BRSet.h"
#include "BRPeer.h"
#include <assert.h>
typedef struct {
uint32_t height;
UInt256 hash;
uint32_t timestamp;
uint32_t target;
} BRCheckPoint;
typedef struct {
const char * const *dnsSeeds; // NULL terminated array of dns seeds
uint16_t standardPort;
uint32_t magicNumber;
uint64_t services;
int (*verifyDifficulty)(const BRMerkleBlock *block, const BRSet *blockSet); // blockSet must have last 2016 blocks
const BRCheckPoint *checkpoints;
size_t checkpointsCount;
} BRChainParams;
static const char *BRMainNetDNSSeeds[] = {
"80.211.71.14",NULL
};
static const char *BRTestNetDNSSeeds[] = {
"testnet-seed.bitcoin.jonasschnelli.ch.", "seed.testnet.bitcoin.sprovoost.nl.",
"testnet-seed.bluematt.me.", NULL
};
// blockchain checkpoints - these are also used as starting points for partial chain downloads, so they must be at
// difficulty transition boundaries in order to verify the block difficulty at the immediately following transition
static const BRCheckPoint BRMainNetCheckpoints[] = {
{ 0, uint256("0000093cfce0a5a3cecea522e2c13bdf055d65c559fd2222730ba6f0d18dd2cd"), 1558130910, 0x1e0ffff0 },
{ 20160, uint256("c92b97034af39e6cee4ae1530f797d8d3d9eb00f7b760a05eceb0c8d470ba097"), 1559438388, 0x1b06f4e6 },
{ 40320, uint256("f7e44b25b6139ee89624e967e6ef416001fdf1063cca6051d7f3fb33be246066"), 1560649490, 0x1b06af99 },
{ 60480, uint256("f08b3e8328d72ca016fd3150a06518cd49d800a5133f5a547d490717d7220076"), 1561864133, 0x1b06a430 },
{ 80640, uint256("acb0793326c46512b06b7fa80c751c82c52a3c0f83432c8bdd88f4db93b5ed7d"), 1563078552, 0x1b051662 },
{ 100800, uint256("cf08e247757de18ff24a4a2bcd621246913f77fd6df006eb03960c1d3a533f2b"), 1564292359, 0x1b06ce8b },
{ 120960, uint256("f3e04a20513c141c8370e14aae757902807bfa1edd71598ea067514afe791380"), 1565506938, 0x1b0598d8 },
{ 131542, uint256("0e2f8579edeadb338adbf221ec027f3ef36cd337f23213b41d48c6a52c8e87c2"), 1566143580, 0x1b05d948 }
};
static const BRCheckPoint BRTestNetCheckpoints[] = {
{ 0, uint256("000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943"), 1296688602, 0x1d00ffff },
{ 100800, uint256("0000000000a33112f86f3f7b0aa590cb4949b84c2d9c673e9e303257b3be9000"), 1376543922, 0x1c00d907 },
{ 201600, uint256("0000000000376bb71314321c45de3015fe958543afcbada242a3b1b072498e38"), 1393813869, 0x1b602ac0 },
{ 302400, uint256("0000000000001c93ebe0a7c33426e8edb9755505537ef9303a023f80be29d32d"), 1413766239, 0x1a33605e },
{ 403200, uint256("0000000000ef8b05da54711e2106907737741ac0278d59f358303c71d500f3c4"), 1431821666, 0x1c02346c },
{ 504000, uint256("0000000000005d105473c916cd9d16334f017368afea6bcee71629e0fcf2f4f5"), 1436951946, 0x1b00ab86 },
{ 604800, uint256("00000000000008653c7e5c00c703c5a9d53b318837bb1b3586a3d060ce6fff2e"), 1447484641, 0x1a092a20 },
{ 705600, uint256("00000000004ee3bc2e2dd06c31f2d7a9c3e471ec0251924f59f222e5e9c37e12"), 1455728685, 0x1c0ffff0 },
{ 806400, uint256("0000000000000faf114ff29df6dbac969c6b4a3b407cd790d3a12742b50c2398"), 1462006183, 0x1a34e280 },
{ 907200, uint256("0000000000166938e6f172a21fe69fe335e33565539e74bf74eeb00d2022c226"), 1469705562, 0x1c00ffff },
{ 1008000, uint256("000000000000390aca616746a9456a0d64c1bd73661fd60a51b5bf1c92bae5a0"), 1476926743, 0x1a52ccc0 },
{ 1108800, uint256("00000000000288d9a219419d0607fb67cc324d4b6d2945ca81eaa5e739fab81e"), 1490751239, 0x1b09ecf0 },
{ 1209600, uint256("0000000000000026b4692a26f1651bec8e9d4905640bd8e56056c9a9c53badf8"), 1507353706, 0x1973e180 },
{ 1310400, uint256("0000000000013b434bbe5668293c92ef26df6d6d4843228e8958f6a3d8101709"), 1527063804, 0x1b0ffff0 },
{ 1411200, uint256("00000000000000008b3baea0c3de24b9333c169e1543874f4202397f5b8502cb"), 1535560970, 0x194ac105 }
};
static int BRMainNetVerifyDifficulty(const BRMerkleBlock *block, const BRSet *blockSet) {
return 1; // skip diff check for now
}
static int BRTestNetVerifyDifficulty(const BRMerkleBlock *block, const BRSet *blockSet) {
return 1; // XXX skip testnet difficulty check for now
}
static const BRChainParams BRMainNetParams = {
BRMainNetDNSSeeds,
56740, // standardPort
0x191643a0, // magicNumber
0, // services
BRMainNetVerifyDifficulty,
BRMainNetCheckpoints,
sizeof(BRMainNetCheckpoints)/sizeof(*BRMainNetCheckpoints)
};
static const BRChainParams BRTestNetParams = {
BRTestNetDNSSeeds,
18333, // standardPort
0x0709110b, // magicNumber
0, // services
BRTestNetVerifyDifficulty,
BRTestNetCheckpoints,
sizeof(BRTestNetCheckpoints)/sizeof(*BRTestNetCheckpoints)
};
#endif // BRChainParams_h