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 PowMinBits = uint64(2305843009213861724)
26 BlocksPerRetarget = uint64(2016)
27 TargetSecondsPerBlock = uint64(150)
28 SeedPerRetarget = uint64(256)
30 // MaxTimeOffsetSeconds is the maximum number of seconds a block time is allowed to be ahead of the current time
31 MaxTimeOffsetSeconds = uint64(60 * 60)
34 PayToWitnessPubKeyHashDataSize = 20
35 PayToWitnessScriptHashDataSize = 32
36 CoinbaseArbitrarySizeLimit = 128
41 // BTMAssetID is BTM's asset id, the soul asset of Bytom
42 var BTMAssetID = &bc.AssetID{
43 V0: uint64(18446744073709551615),
44 V1: uint64(18446744073709551615),
45 V2: uint64(18446744073709551615),
46 V3: uint64(18446744073709551615),
49 // InitialSeed is SHA3-256 of Byte[0^32]
50 var InitialSeed = &bc.Hash{
51 V0: uint64(11412844483649490393),
52 V1: uint64(4614157290180302959),
53 V2: uint64(1780246333311066183),
54 V3: uint64(9357197556716379726),
57 // BTMDefinitionMap is the ....
58 var BTMDefinitionMap = map[string]interface{}{
62 "description": `Bytom Official Issue`,
65 // BlockSubsidy calculate the coinbase rewards on given block height
66 func BlockSubsidy(height uint64) uint64 {
68 return InitialBlockSubsidy
70 return baseSubsidy >> uint(height/subsidyReductionInterval)
73 // IsBech32SegwitPrefix returns whether the prefix is a known prefix for segwit
74 // addresses on any default or registered network. This is used when decoding
75 // an address string into a specific address type.
76 func IsBech32SegwitPrefix(prefix string, params *Params) bool {
77 prefix = strings.ToLower(prefix)
78 return prefix == params.Bech32HRPSegwit+"1"
81 // Params store the config for different network
83 // Name defines a human-readable identifier for the network.
85 Bech32HRPSegwit string
88 // ActiveNetParams is ...
89 var ActiveNetParams = MainNetParams
91 // NetParams is the correspondence between chain_id and Params
92 var NetParams = map[string]Params{
93 "mainnet": MainNetParams,
94 "testnet": TestNetParams,
97 // MainNetParams is the config for production
98 var MainNetParams = Params{
100 Bech32HRPSegwit: "bm",
103 // TestNetParams is the config for test-net
104 var TestNetParams = Params{
106 Bech32HRPSegwit: "tm",