-
Notifications
You must be signed in to change notification settings - Fork 3
/
params_privnet.go
140 lines (125 loc) · 5.04 KB
/
params_privnet.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// 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"
)
// privNetPowLimit is the highest proof of work value a block can
// have for the private test network. It is the value 2^255 - 1.
var privNetPowLimit = new(big.Int).Sub(new(big.Int).Lsh(common.Big1, 255), common.Big1)
// target time per block unit second(s)
const privTargetTimePerBlock = 30
// PirvNetParams defines the network parameters for the private test network.
// This network is similar to the normal test network except it is
// intended for private use within a group of individuals doing simulation
// testing. The functionality is intended to differ in that the only nodes
// which are specifically specified are used to create the network rather than
// following normal discovery rules. This is important as otherwise it would
// just turn into another public testnet.
var PrivNetParams = Params{
Name: "privnet",
Net: protocol.PrivNet,
DefaultPort: "39130",
DNSSeeds: []DNSSeed{}, // NOTE: There must NOT be any seeds.
// Chain parameters
GenesisBlock: &privNetGenesisBlock,
GenesisHash: &privNetGenesisHash,
PowConfig: &pow.PowConfig{
Blake2bdPowLimit: privNetPowLimit,
Blake2bdPowLimitBits: 0x207fffff,
X8r16PowLimit: privNetPowLimit,
X8r16PowLimitBits: 0x207fffff,
X16rv3PowLimit: privNetPowLimit,
X16rv3PowLimitBits: 0x207fffff,
BitcoinpayKeccak256PowLimit: privNetPowLimit,
BitcoinpayKeccak256PowLimitBits: 0x207fffff,
//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 times use for privnet if GPS is 2. need 50 /2 = 25s find once
CuckarooMinDifficulty: 0x1300000,
CuckatooMinDifficulty: 0x1300000,
CuckaroomMinDifficulty: 0x1300000,
Percent: []pow.Percent{
{
Blake2bDPercent: 10,
CuckarooPercent: 10,
CuckatooPercent: 20,
CuckaroomPercent: 10,
X16rv3Percent: 10,
X8r16Percent: 20,
BitcoinpayKeccak256Percent: 20,
MainHeight: 0,
},
{
Blake2bDPercent: 0,
CuckarooPercent: 30,
CuckatooPercent: 0,
CuckaroomPercent: 30,
X16rv3Percent: 10,
X8r16Percent: 0,
BitcoinpayKeccak256Percent: 30,
MainHeight: 50,
},
{
Blake2bDPercent: 0,
CuckarooPercent: 0,
CuckatooPercent: 0,
CuckaroomPercent: 70,
X16rv3Percent: 0,
X8r16Percent: 0,
BitcoinpayKeccak256Percent: 30,
MainHeight: 100,
},
},
// after this height the big graph will be the main pow graph
AdjustmentStartMainHeight: 45 * 1440 * 60 / privTargetTimePerBlock,
},
ReduceMinDifficulty: false,
MinDiffReductionTime: 0, // Does not apply since ReduceMinDifficulty false
GenerateSupported: true,
MaximumBlockSizes: []int{1000000, 1310720},
MaxTxSize: 1000000,
WorkDiffAlpha: 1,
WorkDiffWindowSize: 16,
WorkDiffWindows: 20,
TargetTimePerBlock: time.Second * privTargetTimePerBlock,
TargetTimespan: time.Second * privTargetTimePerBlock * 16, // TimePerBlock * WindowSize
RetargetAdjustmentFactor: 2,
// Subsidy parameters.
BaseSubsidy: 50000000000,
MulSubsidy: 100,
DivSubsidy: 101,
SubsidyReductionInterval: 128,
WorkRewardProportion: 10,
StakeRewardProportion: 0,
BlockTaxProportion: 0,
// Checkpoints ordered from oldest to newest.
Checkpoints: nil,
// Consensus rule change deployments.
Deployments: map[uint32][]ConsensusDeployment{},
// Address encoding magics
NetworkAddressPrefix: "R",
PubKeyAddrID: [2]byte{0x0d, 0xef}, // starts with Rk
PubKeyHashAddrID: [2]byte{0x0d, 0xf1}, // starts with Rm
PKHEdwardsAddrID: [2]byte{0x0d, 0xdf}, // starts with Re
PKHSchnorrAddrID: [2]byte{0x0d, 0xfd}, // starts with Rr
ScriptHashAddrID: [2]byte{0x0d, 0xc2}, // starts with RS
PrivateKeyID: [2]byte{0x0c, 0xdd}, // starts with Pr
// BIP32 hierarchical deterministic extended key magics
HDPrivateKeyID: [4]byte{0x04, 0x0b, 0xee, 0x6e}, // starts with rprv
HDPublicKeyID: [4]byte{0x04, 0x0b, 0xf2, 0xa7}, // starts with rpub
// BIP44 coin type used in the hierarchical deterministic path for
// address generation.
// TODO coin type
HDCoinType: 223, // ASCII for s
// TODO replace the test pkh
//OrganizationPkScript: hexMustDecode("76a91408ff3106060bf8d7d61a25d8108ec977698729f788ac"),
CoinbaseMaturity: 16,
}