github.com/mit-dci/lit@v0.0.0-20221102210550-8c3d3b49f2ce/coinparam/vertcoin.go (about) 1 package coinparam 2 3 import ( 4 "time" 5 6 "github.com/mit-dci/lit/btcutil/chaincfg/chainhash" 7 "github.com/mit-dci/lit/wire" 8 9 "github.com/bitgoin/lyra2rev2" 10 "github.com/vertcoin/lyra2re" 11 "golang.org/x/crypto/scrypt" 12 ) 13 14 var VertcoinTestNetParams = Params{ 15 Name: "vtctest", 16 NetMagicBytes: 0x74726576, 17 DefaultPort: "15889", 18 DNSSeeds: []string{ 19 "fr1.vtconline.org", 20 }, 21 22 // Chain parameters 23 DiffCalcFunction: diffVTCtest, 24 MinHeaders: 4032, 25 FeePerByte: 100, 26 GenesisBlock: &VertcoinTestnetGenesisBlock, 27 GenesisHash: &VertcoinTestnetGenesisHash, 28 PowLimit: liteCoinTestNet4PowLimit, 29 PoWFunction: func(b []byte, height int32) chainhash.Hash { 30 lyraBytes, _ := lyra2rev2.Sum(b) 31 asChainHash, _ := chainhash.NewHash(lyraBytes) 32 return *asChainHash 33 }, 34 PowLimitBits: 0x1e0fffff, 35 CoinbaseMaturity: 120, 36 SubsidyReductionInterval: 840000, 37 TargetTimespan: time.Second * 302400, // 3.5 weeks 38 TargetTimePerBlock: time.Second * 150, // 150 seconds 39 RetargetAdjustmentFactor: 4, // 25% less, 400% more 40 ReduceMinDifficulty: true, 41 MinDiffReductionTime: time.Second * 150 * 2, // ?? unknown 42 GenerateSupported: false, 43 44 // Checkpoints ordered from oldest to newest. 45 Checkpoints: []Checkpoint{}, 46 47 BlockEnforceNumRequired: 26, 48 BlockRejectNumRequired: 49, 49 BlockUpgradeNumToCheck: 50, 50 51 // Mempool parameters 52 RelayNonStdTxs: true, 53 54 // Address encoding magics 55 PubKeyHashAddrID: 0x4a, // starts with X or W 56 ScriptHashAddrID: 0xc4, 57 Bech32Prefix: "tvtc", 58 PrivateKeyID: 0xef, 59 60 // BIP32 hierarchical deterministic extended key magics 61 HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94}, // starts with tprv 62 HDPublicKeyID: [4]byte{0x04, 0x35, 0x87, 0xcf}, // starts with tpub 63 64 // BIP44 coin type used in the hierarchical deterministic path for 65 // address generation. 66 HDCoinType: 65536, 67 TestCoin: true, 68 } 69 70 var VertcoinRegTestParams = Params{ 71 Name: "vtcreg", 72 NetMagicBytes: 0xdbb5befa, 73 DefaultPort: "18444", 74 DNSSeeds: []string{}, 75 76 // Chain parameters 77 DiffCalcFunction: diffVTCregtest, 78 MinHeaders: 4032, 79 FeePerByte: 100, 80 GenesisBlock: &VertcoinRegTestnetGenesisBlock, 81 GenesisHash: &VertcoinRegTestnetGenesisHash, 82 PowLimit: regressionPowLimit, 83 PoWFunction: func(b []byte, height int32) chainhash.Hash { 84 var hashBytes []byte 85 86 if height >= 347000 { 87 hashBytes, _ = lyra2rev2.Sum(b) 88 } else if height >= 208301 { 89 hashBytes, _ = lyra2re.Sum(b) 90 } else { 91 hashBytes, _ = scrypt.Key(b, b, 2048, 1, 1, 32) 92 } 93 94 asChainHash, _ := chainhash.NewHash(hashBytes) 95 return *asChainHash 96 }, 97 PowLimitBits: 0x207fffff, 98 CoinbaseMaturity: 120, 99 SubsidyReductionInterval: 150, 100 TargetTimespan: time.Second * 302400, // 3.5 weeks 101 TargetTimePerBlock: time.Second * 150, // 150 seconds 102 RetargetAdjustmentFactor: 4, // 25% less, 400% more 103 ReduceMinDifficulty: true, 104 MinDiffReductionTime: time.Second * 150 * 2, // ?? unknown 105 GenerateSupported: false, 106 107 // Checkpoints ordered from oldest to newest. 108 Checkpoints: []Checkpoint{}, 109 110 BlockEnforceNumRequired: 26, 111 BlockRejectNumRequired: 49, 112 BlockUpgradeNumToCheck: 50, 113 114 // Mempool parameters 115 RelayNonStdTxs: true, 116 117 // Address encoding magics 118 PubKeyHashAddrID: 0x4a, // starts with X or W 119 ScriptHashAddrID: 0xc4, 120 Bech32Prefix: "rvtc", 121 PrivateKeyID: 0xef, 122 123 // BIP32 hierarchical deterministic extended key magics 124 HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94}, // starts with tprv 125 HDPublicKeyID: [4]byte{0x04, 0x35, 0x87, 0xcf}, // starts with tpub 126 127 // BIP44 coin type used in the hierarchical deterministic path for 128 // address generation. 129 HDCoinType: 261, 130 TestCoin: true, 131 } 132 133 var VertcoinParams = Params{ 134 Name: "vtc", 135 NetMagicBytes: 0xdab5bffa, 136 DefaultPort: "5889", 137 DNSSeeds: []string{ 138 "fr1.vtconline.org", 139 "uk1.vtconline.org", 140 "useast1.vtconline.org", 141 "vtc.alwayshashing.com", 142 "crypto.office-on-the.net", 143 "p2pool.kosmoplovci.org", 144 }, 145 146 // Chain parameters 147 StartHeader: [80]byte{ 148 0x02, 0x00, 0x00, 0x00, 0x36, 0xdc, 0x16, 0xc7, 0x71, 0x63, 149 0x1c, 0x52, 0xa4, 0x3d, 0xb7, 0xb0, 0xa9, 0x86, 0x95, 0x95, 150 0xed, 0x7d, 0xc1, 0x68, 0xe7, 0x2e, 0xaf, 0x0f, 0x55, 0x08, 151 0x02, 0x98, 0x9f, 0x5c, 0x7b, 0xe4, 0x37, 0xa6, 0x90, 0x76, 152 0x66, 0xa7, 0xba, 0x55, 0x75, 0xd8, 0x8a, 0xc5, 0x14, 0x01, 153 0x86, 0x11, 0x8e, 0x34, 0xe2, 0x4a, 0x04, 0x7b, 0x9d, 0x6e, 154 0x96, 0x41, 0xbb, 0x29, 0xe2, 0x04, 0xcb, 0x49, 0x3c, 0x53, 155 0x08, 0x58, 0x3f, 0xf4, 0x4d, 0x1b, 0x42, 0x22, 0x6e, 0x8a, 156 }, 157 StartHeight: 598752, 158 AssumeDiffBefore: 602784, 159 DiffCalcFunction: diffVTC, 160 MinHeaders: 4032, 161 FeePerByte: 100, 162 GenesisBlock: &VertcoinGenesisBlock, 163 GenesisHash: &VertcoinGenesisHash, 164 PowLimit: liteCoinTestNet4PowLimit, 165 PoWFunction: func(b []byte, height int32) chainhash.Hash { 166 var hashBytes []byte 167 168 if height >= 347000 { 169 hashBytes, _ = lyra2rev2.Sum(b) 170 } else if height >= 208301 { 171 hashBytes, _ = lyra2re.Sum(b) 172 } else { 173 hashBytes, _ = scrypt.Key(b, b, 2048, 1, 1, 32) 174 } 175 176 asChainHash, _ := chainhash.NewHash(hashBytes) 177 return *asChainHash 178 }, 179 PowLimitBits: 0x1e0fffff, 180 CoinbaseMaturity: 120, 181 SubsidyReductionInterval: 840000, 182 TargetTimespan: time.Second * 302400, // 3.5 weeks 183 TargetTimePerBlock: time.Second * 150, // 150 seconds 184 RetargetAdjustmentFactor: 4, // 25% less, 400% more 185 ReduceMinDifficulty: false, 186 MinDiffReductionTime: time.Second * 150 * 2, // ?? unknown 187 GenerateSupported: false, 188 189 // Checkpoints ordered from oldest to newest. 190 Checkpoints: []Checkpoint{ 191 {0, newHashFromStr("4d96a915f49d40b1e5c2844d1ee2dccb90013a990ccea12c492d22110489f0c4")}, 192 {24200, newHashFromStr("d7ed819858011474c8b0cae4ad0b9bdbb745becc4c386bc22d1220cc5a4d1787")}, 193 {65000, newHashFromStr("9e673a69c35a423f736ab66f9a195d7c42f979847a729c0f3cef2c0b8b9d0289")}, 194 {84065, newHashFromStr("a904170a5a98109b2909379d9bc03ef97a6b44d5dafbc9084b8699b0cba5aa98")}, 195 {228023, newHashFromStr("15c94667a9e941359d2ee6527e2876db1b5e7510a5ded3885ca02e7e0f516b51")}, 196 {346992, newHashFromStr("f1714fa4c7990f4b3d472eb22132891ccd3c7ad7208e2d1ab15bde68854fb0ee")}, 197 {347269, newHashFromStr("fa1e592b7ea2aa97c5f20ccd7c40f3aaaeb31d1232c978847a79f28f83b6c22a")}, 198 {430000, newHashFromStr("2f5703cf7b6f956b84fd49948cbf49dc164cfcb5a7b55903b1c4f53bc7851611")}, 199 {516999, newHashFromStr("572ed47da461743bcae526542053e7bc532de299345e4f51d77786f2870b7b28")}, 200 {627610, newHashFromStr("6000a787f2d8bb77d4f491a423241a4cc8439d862ca6cec6851aba4c79ccfedc")}, 201 }, 202 203 BlockEnforceNumRequired: 1512, 204 BlockRejectNumRequired: 1915, 205 BlockUpgradeNumToCheck: 2016, 206 207 // Mempool parameters 208 RelayNonStdTxs: true, 209 210 // Address encoding magics 211 PubKeyHashAddrID: 0x47, // starts with V 212 ScriptHashAddrID: 0x05, // starts with 3 213 Bech32Prefix: "vtc", 214 PrivateKeyID: 0x80, 215 216 // BIP32 hierarchical deterministic extended key magics 217 HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94}, // starts with tprv 218 HDPublicKeyID: [4]byte{0x04, 0x35, 0x87, 0xcf}, // starts with tpub 219 220 // BIP44 coin type used in the hierarchical deterministic path for 221 // address generation. 222 HDCoinType: 28, 223 } 224 225 // ==================== VertcoinTestnet 226 227 // VertcoinTestNetGenesisHash 228 var VertcoinTestnetGenesisHash = chainhash.Hash([chainhash.HashSize]byte{ 229 0xc9, 0xd2, 0x7a, 0x49, 0x47, 0x27, 0x2e, 0xe3, 0xc2, 230 0xe8, 0x1a, 0x74, 0xb6, 0x79, 0xac, 0xec, 0x5d, 0x85, 231 0xa4, 0x6a, 0x97, 0x16, 0x79, 0xf0, 0xc8, 0x64, 0x7a, 232 0xeb, 0x4f, 0xf2, 0xe8, 0xce, 233 }) 234 235 var VertcoinTestnetMerkleRoot = chainhash.Hash([chainhash.HashSize]byte{ 236 0xe7, 0x23, 0x01, 0xfc, 0x49, 0x32, 0x3e, 0xe1, 0x51, 237 0xcf, 0x10, 0x48, 0x23, 0x0f, 0x03, 0x2c, 0xa5, 0x89, 238 0x75, 0x3b, 0xa7, 0x08, 0x62, 0x22, 0xa5, 0xc0, 0x23, 239 0xe3, 0xa0, 0x8c, 0xf3, 0x4a, 240 }) 241 242 var VertcoinTestnetGenesisBlock = wire.MsgBlock{ 243 Header: wire.BlockHeader{ 244 Version: 1, 245 PrevBlock: chainhash.Hash{}, // empty 246 MerkleRoot: VertcoinTestnetMerkleRoot, 247 Timestamp: time.Unix(1481291250, 0), // later 248 Bits: 0x1e0ffff0, 249 Nonce: 915027, 250 }, 251 } 252 253 // ==================== Vertcoin 254 255 // VertcoinNetGenesisHash 256 var VertcoinGenesisHash = chainhash.Hash([chainhash.HashSize]byte{ 257 0xc4, 0xf0, 0x89, 0x04, 0x11, 0x22, 0x2d, 0x49, 0x2c, 0xa1, 258 0xce, 0x0c, 0x99, 0x3a, 0x01, 0x90, 0xcb, 0xdc, 0xe2, 0x1e, 259 0x4d, 0x84, 0xc2, 0xe5, 0xb1, 0x40, 0x9d, 0xf4, 0x15, 0xa9, 260 0x96, 0x4d, 261 }) 262 263 var VertcoinMerkleRoot = chainhash.Hash([chainhash.HashSize]byte{ 264 0xe7, 0x23, 0x01, 0xfc, 0x49, 0x32, 0x3e, 0xe1, 0x51, 0xcf, 0x10, 0x48, 0x23, 0x0f, 265 0x03, 0x2c, 0xa5, 0x89, 0x75, 0x3b, 0xa7, 0x08, 0x62, 0x22, 0xa5, 0xc0, 0x23, 0xe3, 266 0xa0, 0x8c, 0xf3, 0x4a, 267 }) 268 269 var VertcoinGenesisBlock = wire.MsgBlock{ 270 Header: wire.BlockHeader{ 271 Version: 1, 272 PrevBlock: chainhash.Hash{}, // empty 273 MerkleRoot: VertcoinMerkleRoot, 274 Timestamp: time.Unix(1389311371, 0), // later 275 Bits: 0x1e0ffff0, 276 Nonce: 5749262, 277 }, 278 } 279 280 // ==================== VertcoinRegTestnet 281 282 // VertcoinRegTestnetGenesisHash 283 var VertcoinRegTestnetGenesisHash = chainhash.Hash([chainhash.HashSize]byte{ 284 0xce, 0x85, 0x4a, 0xdc, 0x33, 0xe8, 0x7c, 0xc1, 0x6f, 285 0xbc, 0x32, 0x19, 0x1a, 0x7b, 0x02, 0x17, 0x73, 0xc9, 286 0x06, 0x72, 0x86, 0x66, 0x0d, 0x65, 0xd1, 0xbb, 0xeb, 287 0x47, 0xb0, 0xc0, 0x99, 0x23, 288 }) 289 290 var VertcoinRegTestnetMerkleRoot = chainhash.Hash([chainhash.HashSize]byte{ 291 0xe7, 0x23, 0x01, 0xfc, 0x49, 0x32, 0x3e, 0xe1, 0x51, 292 0xcf, 0x10, 0x48, 0x23, 0x0f, 0x03, 0x2c, 0xa5, 0x89, 293 0x75, 0x3b, 0xa7, 0x08, 0x62, 0x22, 0xa5, 0xc0, 0x23, 294 0xe3, 0xa0, 0x8c, 0xf3, 0x4a, 295 }) 296 297 var VertcoinRegTestnetGenesisBlock = wire.MsgBlock{ 298 Header: wire.BlockHeader{ 299 Version: 1, 300 PrevBlock: chainhash.Hash{}, // empty 301 MerkleRoot: VertcoinRegTestnetMerkleRoot, 302 Timestamp: time.Unix(1296688602, 0), // later 303 Bits: 0x207fffff, 304 Nonce: 2, 305 }, 306 }