6 "github.com/bytom/protocol/bc"
11 // Max gas that one block contains
12 MaxBlockGas = uint64(10000000)
13 VMGasRate = int64(200)
14 StorageGasRate = int64(1)
15 MaxGasAmount = int64(200000)
16 DefaultGasCredit = int64(30000)
18 //config parameter for coinbase reward
19 CoinbasePendingBlockNumber = uint64(100)
20 subsidyReductionInterval = uint64(840000)
21 baseSubsidy = uint64(41250000000)
22 InitialBlockSubsidy = uint64(147000041250000000)
24 // config for pow mining
25 BlocksPerRetarget = uint64(2016)
26 TargetSecondsPerBlock = uint64(150)
27 SeedPerRetarget = uint64(256)
29 // MaxTimeOffsetSeconds is the maximum number of seconds a block time is allowed to be ahead of the current time
30 MaxTimeOffsetSeconds = uint64(60 * 60)
33 PayToWitnessPubKeyHashDataSize = 20
34 PayToWitnessScriptHashDataSize = 32
35 CoinbaseArbitrarySizeLimit = 128
40 // BTMAssetID is BTM's asset id, the soul asset of Bytom
41 var BTMAssetID = &bc.AssetID{
42 V0: uint64(18446744073709551615),
43 V1: uint64(18446744073709551615),
44 V2: uint64(18446744073709551615),
45 V3: uint64(18446744073709551615),
48 // InitialSeed is SHA3-256 of Byte[0^32]
49 var InitialSeed = &bc.Hash{
50 V0: uint64(11412844483649490393),
51 V1: uint64(4614157290180302959),
52 V2: uint64(1780246333311066183),
53 V3: uint64(9357197556716379726),
56 // BTMDefinitionMap is the ....
57 var BTMDefinitionMap = map[string]interface{}{
61 "description": `Bytom Official Issue`,
64 // BlockSubsidy calculate the coinbase rewards on given block height
65 func BlockSubsidy(height uint64) uint64 {
67 return InitialBlockSubsidy
69 return baseSubsidy >> uint(height/subsidyReductionInterval)
72 // IsBech32SegwitPrefix returns whether the prefix is a known prefix for segwit
73 // addresses on any default or registered network. This is used when decoding
74 // an address string into a specific address type.
75 func IsBech32SegwitPrefix(prefix string, params *Params) bool {
76 prefix = strings.ToLower(prefix)
77 return prefix == params.Bech32HRPSegwit+"1"
80 // Params store the config for different network
82 // Name defines a human-readable identifier for the network.
84 Bech32HRPSegwit string
87 // ActiveNetParams is ...
88 var ActiveNetParams = MainNetParams
90 // NetParams is the correspondence between chain_id and Params
91 var NetParams = map[string]Params{
92 "mainnet": MainNetParams,
93 "testnet": TestNetParams,
94 "solonet": SoloNetParams,
98 // MainNetParams is the config for production
99 var MainNetParams = Params{
101 Bech32HRPSegwit: "bm",
104 // TestNetParams is the config for test-net
105 var TestNetParams = Params{
107 Bech32HRPSegwit: "tm",
110 // TestNetParams is the config for test-net
111 var SoloNetParams = Params{
113 Bech32HRPSegwit: "sm",