-
Notifications
You must be signed in to change notification settings - Fork 3
/
params_mainnet.go
111 lines (96 loc) · 3.93 KB
/
params_mainnet.go
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
// Copyright (c) 2020-2021 The bitcoinpay developers
// Copyright (c) 2014-2016 The btcsuite developers
// Copyright (c) 2015-2017 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package params
import (
"github.com/btceasypay/bitcoinpay/common"
"github.com/btceasypay/bitcoinpay/core/protocol"
"github.com/btceasypay/bitcoinpay/core/types/pow"
"math/big"
"time"
)
// mainPowLimit is the highest proof of work value a block can
// have for the main network. It is the value 2^224 - 1.
var mainPowLimit = new(big.Int).Sub(new(big.Int).Lsh(common.Big1, 224), common.Big1)
// target time per block unit second(s)
const mainTargetTimePerBlock = 60 * 5
// MainNetParams defines the network parameters for the main network.
var MainNetParams = Params{
Name: "mainnet",
Net: protocol.MainNet,
DefaultPort: "9130",
DNSSeeds: []DNSSeed{
},
// Chain parameters
GenesisBlock: &genesisBlock,
GenesisHash: &genesisHash,
PowConfig: &pow.PowConfig{
Blake2bdPowLimit: mainPowLimit,
Blake2bdPowLimitBits: 0x1d00ffff,
X16rv3PowLimit: mainPowLimit,
X16rv3PowLimitBits: 0x1d00ffff,
X8r16PowLimit: mainPowLimit,
X8r16PowLimitBits: 0x1d00ffff,
BitcoinpayKeccak256PowLimit: mainPowLimit,
BitcoinpayKeccak256PowLimitBits: 0x1d00ffff,
//hash ffffffffffffffff000000000000000000000000000000000000000000000000 corresponding difficulty is 48 for edge bits 24
// Uniform field type uint64 value is 48 . bigToCompact the uint32 value
// 24 edge_bits only need hash 1*4 times use for privnet if GPS is 2. need 50 /2 * 4 find once
CuckarooMinDifficulty: 0x1300000 * 4,
CuckaroomMinDifficulty: 0x1300000 * 4,
CuckatooMinDifficulty: 0x1300000 * 4,
Percent: []pow.Percent{
{
Blake2bDPercent: 10,
CuckarooPercent: 60,
CuckatooPercent: 20,
BitcoinpayKeccak256Percent: 10,
MainHeight: 0,
},
},
// after this height the big graph will be the main pow graph
AdjustmentStartMainHeight: 45 * 1440 * 60 / mainTargetTimePerBlock,
},
ReduceMinDifficulty: false,
MinDiffReductionTime: 0, // Does not apply since ReduceMinDifficulty false
GenerateSupported: false,
WorkDiffAlpha: 1,
WorkDiffWindowSize: 144,
WorkDiffWindows: 20,
MaximumBlockSizes: []int{393216},
MaxTxSize: 393216,
TargetTimePerBlock: time.Second * mainTargetTimePerBlock,
TargetTimespan: time.Second * mainTargetTimePerBlock * 144, // TimePerBlock * WindowSize
RetargetAdjustmentFactor: 4,
// Subsidy parameters.
BaseSubsidy: 3119582664, // 21m
MulSubsidy: 100,
DivSubsidy: 101,
SubsidyReductionInterval: 6144,
WorkRewardProportion: 9,
StakeRewardProportion: 0,
BlockTaxProportion: 1,
// Checkpoints ordered from oldest to newest.
Checkpoints: []Checkpoint{},
Deployments: map[uint32][]ConsensusDeployment{},
// Address encoding magics
NetworkAddressPrefix: "N",
PubKeyAddrID: [2]byte{0x0c, 0x3e}, // starts with Nk
PubKeyHashAddrID: [2]byte{0x0c, 0x41}, // starts with Nm
PKHEdwardsAddrID: [2]byte{0x0c, 0x30}, // starts with Ne
PKHSchnorrAddrID: [2]byte{0x0c, 0x4e}, // starts with Nr
ScriptHashAddrID: [2]byte{0x0c, 0x12}, // starts with NS
PrivateKeyID: [2]byte{0x0c, 0xd1}, // starts with Pm
// BIP32 hierarchical deterministic extended key magics
HDPrivateKeyID: [4]byte{0x03, 0xb8, 0xc4, 0x22}, // starts with nprv
HDPublicKeyID: [4]byte{0x03, 0xb8, 0xc8, 0x58}, // starts with npub
// BIP44 coin type used in the hierarchical deterministic path for
// address generation.
// TODO : register coin type
// https://github.com/satoshilabs/slips/blob/master/slip-0044.md
HDCoinType: 223,
CoinbaseMaturity: 512,
OrganizationPkScript: hexMustDecode("76a914c0f0b73c320e1fe38eb1166a57b953e509c8f93e88ac"),
}